diff --git a/bundles/pixi.js/pixi.js-5.0.4.tgz b/bundles/pixi.js/pixi.js-5.0.4.tgz index 5f544e1..4aa5d2b 100644 --- a/bundles/pixi.js/pixi.js-5.0.4.tgz +++ b/bundles/pixi.js/pixi.js-5.0.4.tgz Binary files differ diff --git a/bundles/pixi.js/pixi.js-5.0.4.tgz b/bundles/pixi.js/pixi.js-5.0.4.tgz index 5f544e1..4aa5d2b 100644 --- a/bundles/pixi.js/pixi.js-5.0.4.tgz +++ b/bundles/pixi.js/pixi.js-5.0.4.tgz Binary files differ diff --git a/dist/pixi-legacy.js b/dist/pixi-legacy.js index 786c92b..7504d17 100644 --- a/dist/pixi-legacy.js +++ b/dist/pixi-legacy.js @@ -1,6 +1,6 @@ /*! * pixi.js-legacy - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * pixi.js-legacy is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -475,7 +475,7 @@ /*! * @pixi/polyfill - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/polyfill is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -639,7 +639,7 @@ /*! * @pixi/settings - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/settings is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -3383,7 +3383,7 @@ /*! * @pixi/constants - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/constants is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -3714,7 +3714,7 @@ /*! * @pixi/utils - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/utils is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -4684,7 +4684,7 @@ /*! * @pixi/math - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/math is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -6498,7 +6498,7 @@ /*! * @pixi/display - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/display is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -8286,7 +8286,7 @@ /*! * @pixi/accessibility - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/accessibility is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -8921,7 +8921,7 @@ /*! * @pixi/runner - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/runner is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -9113,7 +9113,7 @@ /*! * @pixi/ticker - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/ticker is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -10052,7 +10052,7 @@ /*! * @pixi/core - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/core is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -20049,8 +20049,19 @@ glTexture.width = width; glTexture.height = height; + var internalFormat = texture.format; + + // guess sized format by type and format + // https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D + if (renderer.context.webGLVersion === 2 + && texture.type === gl.FLOAT + && texture.format === gl.RGBA) + { + internalFormat = gl.RGBA32F; + } + gl.texImage2D(texture.target, 0, - texture.format, + internalFormat, width, height, 0, @@ -21684,7 +21695,7 @@ /*! * @pixi/extract - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/extract is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -21929,7 +21940,7 @@ /*! * @pixi/interaction - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/interaction is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -24295,7 +24306,7 @@ /*! * @pixi/graphics - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/graphics is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -27690,7 +27701,7 @@ /*! * @pixi/sprite - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/sprite is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -28342,7 +28353,7 @@ /*! * @pixi/text - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/text is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -30584,7 +30595,7 @@ /*! * @pixi/prepare - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/prepare is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -31275,7 +31286,7 @@ /*! * @pixi/app - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/app is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -34094,7 +34105,7 @@ /*! * @pixi/loaders - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/loaders is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -36016,7 +36027,7 @@ /*! * @pixi/particles - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/particles is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -36984,7 +36995,7 @@ /*! * @pixi/spritesheet - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/spritesheet is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -37392,7 +37403,7 @@ /*! * @pixi/sprite-tiling - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/sprite-tiling is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -37888,7 +37899,7 @@ /*! * @pixi/text-bitmap - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/text-bitmap is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -38713,7 +38724,7 @@ /*! * @pixi/filter-alpha - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/filter-alpha is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -38777,7 +38788,7 @@ /*! * @pixi/filter-blur - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/filter-blur is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -39202,7 +39213,7 @@ /*! * @pixi/filter-color-matrix - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/filter-color-matrix is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -39800,7 +39811,7 @@ /*! * @pixi/filter-displacement - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/filter-displacement is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -39917,7 +39928,7 @@ /*! * @pixi/filter-fxaa - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/filter-fxaa is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -39954,7 +39965,7 @@ /*! * @pixi/filter-noise - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/filter-noise is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -40033,7 +40044,7 @@ /*! * @pixi/mixin-cache-as-bitmap - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/mixin-cache-as-bitmap is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -40454,7 +40465,7 @@ /*! * @pixi/mixin-get-child-by-name - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/mixin-get-child-by-name is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -40491,7 +40502,7 @@ /*! * @pixi/mixin-get-global-position - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/mixin-get-global-position is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -40528,7 +40539,7 @@ /*! * @pixi/mesh - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/mesh is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -41305,7 +41316,7 @@ /*! * @pixi/mesh-extras - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/mesh-extras is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -42060,7 +42071,7 @@ /*! * @pixi/sprite-animated - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/sprite-animated is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -42502,7 +42513,7 @@ /*! * pixi.js - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * pixi.js is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -43683,7 +43694,7 @@ /*! * @pixi/canvas-renderer - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-renderer is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -44670,7 +44681,7 @@ /*! * @pixi/canvas-mesh - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-mesh is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -45204,7 +45215,7 @@ /*! * @pixi/canvas-graphics - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-graphics is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -45601,7 +45612,7 @@ /*! * @pixi/canvas-sprite - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-sprite is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -45825,7 +45836,7 @@ /*! * @pixi/canvas-extract - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-extract is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -46003,7 +46014,7 @@ /*! * @pixi/canvas-prepare - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-prepare is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -46104,7 +46115,7 @@ /*! * @pixi/canvas-sprite-tiling - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-sprite-tiling is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -46200,7 +46211,7 @@ /*! * @pixi/canvas-particles - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-particles is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -46331,7 +46342,7 @@ /*! * @pixi/canvas-display - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-display is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license diff --git a/bundles/pixi.js/pixi.js-5.0.4.tgz b/bundles/pixi.js/pixi.js-5.0.4.tgz index 5f544e1..4aa5d2b 100644 --- a/bundles/pixi.js/pixi.js-5.0.4.tgz +++ b/bundles/pixi.js/pixi.js-5.0.4.tgz Binary files differ diff --git a/dist/pixi-legacy.js b/dist/pixi-legacy.js index 786c92b..7504d17 100644 --- a/dist/pixi-legacy.js +++ b/dist/pixi-legacy.js @@ -1,6 +1,6 @@ /*! * pixi.js-legacy - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * pixi.js-legacy is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -475,7 +475,7 @@ /*! * @pixi/polyfill - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/polyfill is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -639,7 +639,7 @@ /*! * @pixi/settings - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/settings is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -3383,7 +3383,7 @@ /*! * @pixi/constants - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/constants is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -3714,7 +3714,7 @@ /*! * @pixi/utils - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/utils is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -4684,7 +4684,7 @@ /*! * @pixi/math - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/math is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -6498,7 +6498,7 @@ /*! * @pixi/display - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/display is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -8286,7 +8286,7 @@ /*! * @pixi/accessibility - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/accessibility is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -8921,7 +8921,7 @@ /*! * @pixi/runner - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/runner is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -9113,7 +9113,7 @@ /*! * @pixi/ticker - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/ticker is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -10052,7 +10052,7 @@ /*! * @pixi/core - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/core is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -20049,8 +20049,19 @@ glTexture.width = width; glTexture.height = height; + var internalFormat = texture.format; + + // guess sized format by type and format + // https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D + if (renderer.context.webGLVersion === 2 + && texture.type === gl.FLOAT + && texture.format === gl.RGBA) + { + internalFormat = gl.RGBA32F; + } + gl.texImage2D(texture.target, 0, - texture.format, + internalFormat, width, height, 0, @@ -21684,7 +21695,7 @@ /*! * @pixi/extract - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/extract is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -21929,7 +21940,7 @@ /*! * @pixi/interaction - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/interaction is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -24295,7 +24306,7 @@ /*! * @pixi/graphics - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/graphics is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -27690,7 +27701,7 @@ /*! * @pixi/sprite - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/sprite is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -28342,7 +28353,7 @@ /*! * @pixi/text - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/text is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -30584,7 +30595,7 @@ /*! * @pixi/prepare - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/prepare is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -31275,7 +31286,7 @@ /*! * @pixi/app - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/app is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -34094,7 +34105,7 @@ /*! * @pixi/loaders - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/loaders is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -36016,7 +36027,7 @@ /*! * @pixi/particles - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/particles is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -36984,7 +36995,7 @@ /*! * @pixi/spritesheet - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/spritesheet is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -37392,7 +37403,7 @@ /*! * @pixi/sprite-tiling - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/sprite-tiling is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -37888,7 +37899,7 @@ /*! * @pixi/text-bitmap - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/text-bitmap is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -38713,7 +38724,7 @@ /*! * @pixi/filter-alpha - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/filter-alpha is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -38777,7 +38788,7 @@ /*! * @pixi/filter-blur - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/filter-blur is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -39202,7 +39213,7 @@ /*! * @pixi/filter-color-matrix - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/filter-color-matrix is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -39800,7 +39811,7 @@ /*! * @pixi/filter-displacement - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/filter-displacement is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -39917,7 +39928,7 @@ /*! * @pixi/filter-fxaa - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/filter-fxaa is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -39954,7 +39965,7 @@ /*! * @pixi/filter-noise - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/filter-noise is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -40033,7 +40044,7 @@ /*! * @pixi/mixin-cache-as-bitmap - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/mixin-cache-as-bitmap is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -40454,7 +40465,7 @@ /*! * @pixi/mixin-get-child-by-name - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/mixin-get-child-by-name is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -40491,7 +40502,7 @@ /*! * @pixi/mixin-get-global-position - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/mixin-get-global-position is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -40528,7 +40539,7 @@ /*! * @pixi/mesh - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/mesh is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -41305,7 +41316,7 @@ /*! * @pixi/mesh-extras - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/mesh-extras is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -42060,7 +42071,7 @@ /*! * @pixi/sprite-animated - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/sprite-animated is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -42502,7 +42513,7 @@ /*! * pixi.js - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * pixi.js is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -43683,7 +43694,7 @@ /*! * @pixi/canvas-renderer - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-renderer is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -44670,7 +44681,7 @@ /*! * @pixi/canvas-mesh - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-mesh is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -45204,7 +45215,7 @@ /*! * @pixi/canvas-graphics - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-graphics is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -45601,7 +45612,7 @@ /*! * @pixi/canvas-sprite - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-sprite is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -45825,7 +45836,7 @@ /*! * @pixi/canvas-extract - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-extract is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -46003,7 +46014,7 @@ /*! * @pixi/canvas-prepare - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-prepare is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -46104,7 +46115,7 @@ /*! * @pixi/canvas-sprite-tiling - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-sprite-tiling is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -46200,7 +46211,7 @@ /*! * @pixi/canvas-particles - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-particles is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -46331,7 +46342,7 @@ /*! * @pixi/canvas-display - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * @pixi/canvas-display is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license diff --git a/dist/pixi-legacy.min.js b/dist/pixi-legacy.min.js index 87c7c1f..cdfd218 100644 --- a/dist/pixi-legacy.min.js +++ b/dist/pixi-legacy.min.js @@ -1,9 +1,9 @@ /*! * pixi.js-legacy - v5.0.4 - * Compiled Sat, 20 Jul 2019 00:27:08 UTC + * Compiled Wed, 28 Aug 2019 02:24:41 UTC * * pixi.js-legacy is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).PIXI={})}(this,function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function i(t,e){return t(e={exports:{}},e.exports),e.exports}var n=i(function(t,r){!function(t){var e=t.Promise,i=e&&"resolve"in e&&"reject"in e&&"all"in e&&"race"in e&&function(){var t;return new e(function(e){t=e}),"function"==typeof t}();r?(r.Promise=i?e:E,r.Polyfill=E):i||(t.Promise=E);var n="pending",o="sealed",s="fulfilled",a="rejected",h=function(){};function u(t){return"[object Array]"===Object.prototype.toString.call(t)}var l,c="undefined"!=typeof setImmediate?setImmediate:setTimeout,d=[];function p(){for(var t=0;t0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+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 s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==F(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,r,i)),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,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(F(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&F(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(F(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&L(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&R(or.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function L(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)}function F(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||F(t,e,r)>0!=F(t,e,i)>0&&F(r,i,t)>0!=F(r,i,e)>0}function B(t,e){return F(t.prev,t,t.next)<0?F(t,e,t.next)>=0&&F(t,t.prev,e)>=0:F(t,e,t.prev)<0||F(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function X(t,e,r,i){var n=new G(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Ot}function Lt(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function Ut(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Bt=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function kt(t,e){return Bt[e?1:0][t]}function Xt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function jt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Gt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Kt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Jt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Ie.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Ie.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Fe=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=gf?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Ne.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Yt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort(Be),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=Vt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Zt(this.realWidth)&&Zt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $t[this.cacheId],delete Qt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+Vt()),i=t._pixiId);var n=$t[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$t[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Ft(t),Lt(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Lr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i0&&(e+="\nelse "),rthis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=qt(Math.ceil(t/12)),r=Kt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=qt(Math.ceil(t/8)),r=Kt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;ithis.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,r=si?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,r=s-(h=n.radius+d/2)i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,r=s-(h=n.height+d/2)i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;sl*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Le,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Le,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Ln.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Fe(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Lo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Lt(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(kt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Xt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=i&&$o.x=n&&$o.y0&&i.x>h&&(Yt(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ys="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",bs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ue.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ue.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Gt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Fs=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(Bs),Gs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;iw?w:E,e.moveTo(_,x+E),e.lineTo(_,x+T-E),e.quadraticCurveTo(_,x+T,_+E,x+T),e.lineTo(_+b-E,x+T),e.quadraticCurveTo(_+b,x+T,_+b,x+T-E),e.lineTo(_+b,x+E),e.quadraticCurveTo(_+b,x,_+b-E,x),e.lineTo(_+E,x),e.quadraticCurveTo(_,x,_,x+E),e.closePath()}}}},zs.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},zs.prototype.destroy=function(){};var qs=function(t){function e(r,i,n){var o;t.call(this,"Canvas",r,i,n),this.type=yt.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new zs(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),Ws()?(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="multiply",o[_t.SCREEN]="screen",o[_t.OVERLAY]="overlay",o[_t.DARKEN]="darken",o[_t.LIGHTEN]="lighten",o[_t.COLOR_DODGE]="color-dodge",o[_t.COLOR_BURN]="color-burn",o[_t.HARD_LIGHT]="hard-light",o[_t.SOFT_LIGHT]="soft-light",o[_t.DIFFERENCE]="difference",o[_t.EXCLUSION]="exclusion",o[_t.HUE]="hue",o[_t.SATURATION]="saturate",o[_t.COLOR]="color",o[_t.LUMINOSITY]="luminosity"):(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="source-over",o[_t.SCREEN]="source-over",o[_t.OVERLAY]="source-over",o[_t.DARKEN]="source-over",o[_t.LIGHTEN]="source-over",o[_t.COLOR_DODGE]="source-over",o[_t.COLOR_BURN]="source-over",o[_t.HARD_LIGHT]="source-over",o[_t.SOFT_LIGHT]="source-over",o[_t.DIFFERENCE]="source-over",o[_t.EXCLUSION]="source-over",o[_t.HUE]="source-over",o[_t.SATURATION]="source-over",o[_t.COLOR]="source-over",o[_t.LUMINOSITY]="source-over"),o[_t.NORMAL_NPM]=o[_t.NORMAL],o[_t.ADD_NPM]=o[_t.ADD],o[_t.SCREEN_NPM]=o[_t.SCREEN],o[_t.SRC_IN]="source-in",o[_t.SRC_OUT]="source-out",o[_t.SRC_ATOP]="source-atop",o[_t.DST_OVER]="destination-over",o[_t.DST_IN]="destination-in",o[_t.DST_OUT]="destination-out",o[_t.DST_ATOP]="destination-atop",o[_t.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,Dt("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ee(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=_t.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[_t.NORMAL],(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===_t.SRC_IN||t===_t.SRC_OUT||t===_t.DST_IN||t===_t.DST_ATOP;!e&&r&&(t=_t.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===wt.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi),Zs={getTintedCanvas:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=Zs.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=Zs.canvas||document.createElement("canvas");if(Zs.tintMethod(r,e,n),n.tintId=r._updateID,Zs.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,Zs.canvas=null;return n},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=Lt(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=w/Math.abs(t.worldTransform.a),P=w/Math.abs(t.worldTransform.d),I=(y+_+x)/3,A=(b+T+E)/3,O=y-I,C=b-A,M=Math.sqrt(O*O+C*C);y=I+O/M*(M+S),b=A+C/M*(M+P),C=T-A,_=I+(O=_-I)/(M=Math.sqrt(O*O+C*C))*(M+S),T=A+C/M*(M+P),C=E-A,x=I+(O=x-I)/(M=Math.sqrt(O*O+C*C))*(M+S),E=A+C/M*(M+P)}n.save(),n.beginPath(),n.moveTo(y,b),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=d*g+v*f+p*m-g*f-v*p-d*m,R=y*g+v*x+_*m-g*x-v*_-y*m,L=d*_+y*f+p*x-_*f-y*p-d*x,F=d*g*x+v*_*f+y*p*m-y*g*f-v*p*x-d*_*m,N=b*g+v*E+T*m-g*E-v*T-b*m,U=d*T+b*f+p*E-T*f-b*p-d*E,B=d*g*E+v*T*f+b*p*m-b*g*f-v*p*E-d*T*m;n.transform(R/D,N/D,L/D,U/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Js.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0){g=0,y=f[0],_=f[1];for(var b=2;b+2=0;S-=2)r.lineTo(f[S],f[S+1])}v[T].shape.closeStroke&&r.closePath()}}l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RECT)l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===ge.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke());else if(h.type===ge.ELIP){var P=2*u.width,I=2*u.height,A=u.x-P/2,O=u.y-I/2;r.beginPath();var C=P/2*.5522848,M=I/2*.5522848,D=A+P,R=O+I,L=A+P/2,F=O+I/2;r.moveTo(A,F),r.bezierCurveTo(A,F-M,L-C,O,L,O),r.bezierCurveTo(L+C,O,D,F-M,D,F),r.bezierCurveTo(D,F+M,L+C,R,L,R),r.bezierCurveTo(L-C,R,A,F+M,A,F),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RREC){var N=u.x,U=u.y,B=u.width,k=u.height,X=u.radius,j=Math.min(B,k)/2|0;X=X>j?j:X,r.beginPath(),r.moveTo(N,U+X),r.lineTo(N,U+k-X),r.quadraticCurveTo(N,U+k,N+X,U+k),r.lineTo(N+B-X,U+k),r.quadraticCurveTo(N+B,U+k,N+B,U+k-X),r.lineTo(N+B,U+X),r.quadraticCurveTo(N+B,U,N+B-X,U),r.lineTo(N+X,U),r.quadraticCurveTo(N,U,N,U+X),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}}},$s.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},$s.prototype.destroy=function(){this.renderer=null};var ta=new me;Xn.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=br.create(r.width,r.height,t,e);Qs||(Qs=new qs),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(ta),ta.invert(),ta.tx-=r.x,ta.ty-=r.y,Qs.render(this,i,!0,ta);var n=_r.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},Xn.prototype.cachedGraphicsData=[],Xn.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var ea=new me,ra=function(t){this.renderer=t};ra.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===wt.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(ea),s=ea,Pe.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution|0,s.ty*r.resolution|0),a|=0,h|=0):r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution,s.ty*r.resolution);var c=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Zs.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution)):i.drawImage(u,e._frame.x*c,e._frame.y*c,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),d&&i.restore(),r.setBlendMode(_t.NORMAL)}},ra.prototype.destroy=function(){this.renderer=null},Hn.prototype._tintedCanvas=null,Hn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var ia=new Oe,na=function(t){this.renderer=t,t.extract=this};na.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},na.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},na.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=ia).width=this.renderer.width,i.height=this.renderer.height);var s=i.width*r,a=i.height*r,h=new ee(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},na.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=ia).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},na.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var oa={CanvasExtract:na},sa=16,aa=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=sa,this.canvas.height=sa,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ha)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(io);function ha(t,e){if(e instanceof or){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}var ua={CanvasPrepare:aa};ts.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ee(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Zs.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,u),r.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(h+c,u+d),r.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},zo.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+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 s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==F(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,r,i)),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,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(F(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&F(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(F(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&L(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&R(or.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function L(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)}function F(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||F(t,e,r)>0!=F(t,e,i)>0&&F(r,i,t)>0!=F(r,i,e)>0}function B(t,e){return F(t.prev,t,t.next)<0?F(t,e,t.next)>=0&&F(t,t.prev,e)>=0:F(t,e,t.prev)<0||F(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function X(t,e,r,i){var n=new G(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Ot}function Lt(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function Ut(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Bt=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function kt(t,e){return Bt[e?1:0][t]}function Xt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function jt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Gt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Kt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Jt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Ie.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Ie.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Fe=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=gf?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Ne.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Yt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort(Be),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=Vt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Zt(this.realWidth)&&Zt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $t[this.cacheId],delete Qt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+Vt()),i=t._pixiId);var n=$t[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$t[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Ft(t),Lt(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Lr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i0&&(e+="\nelse "),rthis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=qt(Math.ceil(t/12)),r=Kt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=qt(Math.ceil(t/8)),r=Kt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;ithis.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,r=si?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,r=s-(h=n.radius+d/2)i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,r=s-(h=n.height+d/2)i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;sl*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Le,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Le,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Ln.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Fe(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Lo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Lt(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(kt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Xt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=i&&$o.x=n&&$o.y0&&i.x>h&&(Yt(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ys="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",bs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ue.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ue.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Gt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Fs=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(Bs),Gs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;iw?w:E,e.moveTo(_,x+E),e.lineTo(_,x+T-E),e.quadraticCurveTo(_,x+T,_+E,x+T),e.lineTo(_+b-E,x+T),e.quadraticCurveTo(_+b,x+T,_+b,x+T-E),e.lineTo(_+b,x+E),e.quadraticCurveTo(_+b,x,_+b-E,x),e.lineTo(_+E,x),e.quadraticCurveTo(_,x,_,x+E),e.closePath()}}}},zs.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},zs.prototype.destroy=function(){};var qs=function(t){function e(r,i,n){var o;t.call(this,"Canvas",r,i,n),this.type=yt.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new zs(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),Ws()?(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="multiply",o[_t.SCREEN]="screen",o[_t.OVERLAY]="overlay",o[_t.DARKEN]="darken",o[_t.LIGHTEN]="lighten",o[_t.COLOR_DODGE]="color-dodge",o[_t.COLOR_BURN]="color-burn",o[_t.HARD_LIGHT]="hard-light",o[_t.SOFT_LIGHT]="soft-light",o[_t.DIFFERENCE]="difference",o[_t.EXCLUSION]="exclusion",o[_t.HUE]="hue",o[_t.SATURATION]="saturate",o[_t.COLOR]="color",o[_t.LUMINOSITY]="luminosity"):(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="source-over",o[_t.SCREEN]="source-over",o[_t.OVERLAY]="source-over",o[_t.DARKEN]="source-over",o[_t.LIGHTEN]="source-over",o[_t.COLOR_DODGE]="source-over",o[_t.COLOR_BURN]="source-over",o[_t.HARD_LIGHT]="source-over",o[_t.SOFT_LIGHT]="source-over",o[_t.DIFFERENCE]="source-over",o[_t.EXCLUSION]="source-over",o[_t.HUE]="source-over",o[_t.SATURATION]="source-over",o[_t.COLOR]="source-over",o[_t.LUMINOSITY]="source-over"),o[_t.NORMAL_NPM]=o[_t.NORMAL],o[_t.ADD_NPM]=o[_t.ADD],o[_t.SCREEN_NPM]=o[_t.SCREEN],o[_t.SRC_IN]="source-in",o[_t.SRC_OUT]="source-out",o[_t.SRC_ATOP]="source-atop",o[_t.DST_OVER]="destination-over",o[_t.DST_IN]="destination-in",o[_t.DST_OUT]="destination-out",o[_t.DST_ATOP]="destination-atop",o[_t.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,Dt("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ee(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=_t.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[_t.NORMAL],(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===_t.SRC_IN||t===_t.SRC_OUT||t===_t.DST_IN||t===_t.DST_ATOP;!e&&r&&(t=_t.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===wt.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi),Zs={getTintedCanvas:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=Zs.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=Zs.canvas||document.createElement("canvas");if(Zs.tintMethod(r,e,n),n.tintId=r._updateID,Zs.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,Zs.canvas=null;return n},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=Lt(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=w/Math.abs(t.worldTransform.a),P=w/Math.abs(t.worldTransform.d),I=(y+_+x)/3,A=(b+T+E)/3,O=y-I,C=b-A,M=Math.sqrt(O*O+C*C);y=I+O/M*(M+S),b=A+C/M*(M+P),C=T-A,_=I+(O=_-I)/(M=Math.sqrt(O*O+C*C))*(M+S),T=A+C/M*(M+P),C=E-A,x=I+(O=x-I)/(M=Math.sqrt(O*O+C*C))*(M+S),E=A+C/M*(M+P)}n.save(),n.beginPath(),n.moveTo(y,b),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=d*g+v*f+p*m-g*f-v*p-d*m,R=y*g+v*x+_*m-g*x-v*_-y*m,L=d*_+y*f+p*x-_*f-y*p-d*x,F=d*g*x+v*_*f+y*p*m-y*g*f-v*p*x-d*_*m,N=b*g+v*E+T*m-g*E-v*T-b*m,U=d*T+b*f+p*E-T*f-b*p-d*E,B=d*g*E+v*T*f+b*p*m-b*g*f-v*p*E-d*T*m;n.transform(R/D,N/D,L/D,U/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Js.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0){g=0,y=f[0],_=f[1];for(var b=2;b+2=0;S-=2)r.lineTo(f[S],f[S+1])}v[T].shape.closeStroke&&r.closePath()}}l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RECT)l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===ge.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke());else if(h.type===ge.ELIP){var P=2*u.width,I=2*u.height,A=u.x-P/2,O=u.y-I/2;r.beginPath();var C=P/2*.5522848,M=I/2*.5522848,D=A+P,R=O+I,L=A+P/2,F=O+I/2;r.moveTo(A,F),r.bezierCurveTo(A,F-M,L-C,O,L,O),r.bezierCurveTo(L+C,O,D,F-M,D,F),r.bezierCurveTo(D,F+M,L+C,R,L,R),r.bezierCurveTo(L-C,R,A,F+M,A,F),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RREC){var N=u.x,U=u.y,B=u.width,k=u.height,X=u.radius,j=Math.min(B,k)/2|0;X=X>j?j:X,r.beginPath(),r.moveTo(N,U+X),r.lineTo(N,U+k-X),r.quadraticCurveTo(N,U+k,N+X,U+k),r.lineTo(N+B-X,U+k),r.quadraticCurveTo(N+B,U+k,N+B,U+k-X),r.lineTo(N+B,U+X),r.quadraticCurveTo(N+B,U,N+B-X,U),r.lineTo(N+X,U),r.quadraticCurveTo(N,U,N,U+X),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}}},$s.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},$s.prototype.destroy=function(){this.renderer=null};var ta=new me;Xn.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=br.create(r.width,r.height,t,e);Qs||(Qs=new qs),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(ta),ta.invert(),ta.tx-=r.x,ta.ty-=r.y,Qs.render(this,i,!0,ta);var n=_r.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},Xn.prototype.cachedGraphicsData=[],Xn.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var ea=new me,ra=function(t){this.renderer=t};ra.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===wt.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(ea),s=ea,Pe.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution|0,s.ty*r.resolution|0),a|=0,h|=0):r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution,s.ty*r.resolution);var c=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Zs.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution)):i.drawImage(u,e._frame.x*c,e._frame.y*c,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),d&&i.restore(),r.setBlendMode(_t.NORMAL)}},ra.prototype.destroy=function(){this.renderer=null},Hn.prototype._tintedCanvas=null,Hn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var ia=new Oe,na=function(t){this.renderer=t,t.extract=this};na.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},na.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},na.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=ia).width=this.renderer.width,i.height=this.renderer.height);var s=i.width*r,a=i.height*r,h=new ee(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},na.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=ia).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},na.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var oa={CanvasExtract:na},sa=16,aa=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=sa,this.canvas.height=sa,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ha)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(io);function ha(t,e){if(e instanceof or){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}var ua={CanvasPrepare:aa};ts.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ee(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Zs.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,u),r.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(h+c,u+d),r.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},zo.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+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 s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==F(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,r,i)),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,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(F(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&F(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(F(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&L(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&R(or.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function L(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)}function F(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||F(t,e,r)>0!=F(t,e,i)>0&&F(r,i,t)>0!=F(r,i,e)>0}function B(t,e){return F(t.prev,t,t.next)<0?F(t,e,t.next)>=0&&F(t,t.prev,e)>=0:F(t,e,t.prev)<0||F(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function X(t,e,r,i){var n=new G(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Ot}function Lt(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function Ut(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Bt=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function kt(t,e){return Bt[e?1:0][t]}function Xt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function jt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Gt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Kt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Jt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Ie.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Ie.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Fe=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=gf?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Ne.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Yt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort(Be),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=Vt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Zt(this.realWidth)&&Zt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $t[this.cacheId],delete Qt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+Vt()),i=t._pixiId);var n=$t[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$t[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Ft(t),Lt(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Lr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i0&&(e+="\nelse "),rthis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=qt(Math.ceil(t/12)),r=Kt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=qt(Math.ceil(t/8)),r=Kt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;ithis.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,r=si?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,r=s-(h=n.radius+d/2)i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,r=s-(h=n.height+d/2)i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;sl*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Le,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Le,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Ln.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Fe(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Lo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Lt(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(kt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Xt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=i&&$o.x=n&&$o.y0&&i.x>h&&(Yt(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ys="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",bs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ue.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ue.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Gt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Fs=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(Bs),Gs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;iw?w:E,e.moveTo(_,x+E),e.lineTo(_,x+T-E),e.quadraticCurveTo(_,x+T,_+E,x+T),e.lineTo(_+b-E,x+T),e.quadraticCurveTo(_+b,x+T,_+b,x+T-E),e.lineTo(_+b,x+E),e.quadraticCurveTo(_+b,x,_+b-E,x),e.lineTo(_+E,x),e.quadraticCurveTo(_,x,_,x+E),e.closePath()}}}},zs.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},zs.prototype.destroy=function(){};var qs=function(t){function e(r,i,n){var o;t.call(this,"Canvas",r,i,n),this.type=yt.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new zs(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),Ws()?(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="multiply",o[_t.SCREEN]="screen",o[_t.OVERLAY]="overlay",o[_t.DARKEN]="darken",o[_t.LIGHTEN]="lighten",o[_t.COLOR_DODGE]="color-dodge",o[_t.COLOR_BURN]="color-burn",o[_t.HARD_LIGHT]="hard-light",o[_t.SOFT_LIGHT]="soft-light",o[_t.DIFFERENCE]="difference",o[_t.EXCLUSION]="exclusion",o[_t.HUE]="hue",o[_t.SATURATION]="saturate",o[_t.COLOR]="color",o[_t.LUMINOSITY]="luminosity"):(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="source-over",o[_t.SCREEN]="source-over",o[_t.OVERLAY]="source-over",o[_t.DARKEN]="source-over",o[_t.LIGHTEN]="source-over",o[_t.COLOR_DODGE]="source-over",o[_t.COLOR_BURN]="source-over",o[_t.HARD_LIGHT]="source-over",o[_t.SOFT_LIGHT]="source-over",o[_t.DIFFERENCE]="source-over",o[_t.EXCLUSION]="source-over",o[_t.HUE]="source-over",o[_t.SATURATION]="source-over",o[_t.COLOR]="source-over",o[_t.LUMINOSITY]="source-over"),o[_t.NORMAL_NPM]=o[_t.NORMAL],o[_t.ADD_NPM]=o[_t.ADD],o[_t.SCREEN_NPM]=o[_t.SCREEN],o[_t.SRC_IN]="source-in",o[_t.SRC_OUT]="source-out",o[_t.SRC_ATOP]="source-atop",o[_t.DST_OVER]="destination-over",o[_t.DST_IN]="destination-in",o[_t.DST_OUT]="destination-out",o[_t.DST_ATOP]="destination-atop",o[_t.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,Dt("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ee(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=_t.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[_t.NORMAL],(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===_t.SRC_IN||t===_t.SRC_OUT||t===_t.DST_IN||t===_t.DST_ATOP;!e&&r&&(t=_t.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===wt.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi),Zs={getTintedCanvas:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=Zs.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=Zs.canvas||document.createElement("canvas");if(Zs.tintMethod(r,e,n),n.tintId=r._updateID,Zs.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,Zs.canvas=null;return n},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=Lt(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=w/Math.abs(t.worldTransform.a),P=w/Math.abs(t.worldTransform.d),I=(y+_+x)/3,A=(b+T+E)/3,O=y-I,C=b-A,M=Math.sqrt(O*O+C*C);y=I+O/M*(M+S),b=A+C/M*(M+P),C=T-A,_=I+(O=_-I)/(M=Math.sqrt(O*O+C*C))*(M+S),T=A+C/M*(M+P),C=E-A,x=I+(O=x-I)/(M=Math.sqrt(O*O+C*C))*(M+S),E=A+C/M*(M+P)}n.save(),n.beginPath(),n.moveTo(y,b),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=d*g+v*f+p*m-g*f-v*p-d*m,R=y*g+v*x+_*m-g*x-v*_-y*m,L=d*_+y*f+p*x-_*f-y*p-d*x,F=d*g*x+v*_*f+y*p*m-y*g*f-v*p*x-d*_*m,N=b*g+v*E+T*m-g*E-v*T-b*m,U=d*T+b*f+p*E-T*f-b*p-d*E,B=d*g*E+v*T*f+b*p*m-b*g*f-v*p*E-d*T*m;n.transform(R/D,N/D,L/D,U/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Js.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0){g=0,y=f[0],_=f[1];for(var b=2;b+2=0;S-=2)r.lineTo(f[S],f[S+1])}v[T].shape.closeStroke&&r.closePath()}}l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RECT)l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===ge.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke());else if(h.type===ge.ELIP){var P=2*u.width,I=2*u.height,A=u.x-P/2,O=u.y-I/2;r.beginPath();var C=P/2*.5522848,M=I/2*.5522848,D=A+P,R=O+I,L=A+P/2,F=O+I/2;r.moveTo(A,F),r.bezierCurveTo(A,F-M,L-C,O,L,O),r.bezierCurveTo(L+C,O,D,F-M,D,F),r.bezierCurveTo(D,F+M,L+C,R,L,R),r.bezierCurveTo(L-C,R,A,F+M,A,F),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RREC){var N=u.x,U=u.y,B=u.width,k=u.height,X=u.radius,j=Math.min(B,k)/2|0;X=X>j?j:X,r.beginPath(),r.moveTo(N,U+X),r.lineTo(N,U+k-X),r.quadraticCurveTo(N,U+k,N+X,U+k),r.lineTo(N+B-X,U+k),r.quadraticCurveTo(N+B,U+k,N+B,U+k-X),r.lineTo(N+B,U+X),r.quadraticCurveTo(N+B,U,N+B-X,U),r.lineTo(N+X,U),r.quadraticCurveTo(N,U,N,U+X),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}}},$s.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},$s.prototype.destroy=function(){this.renderer=null};var ta=new me;Xn.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=br.create(r.width,r.height,t,e);Qs||(Qs=new qs),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(ta),ta.invert(),ta.tx-=r.x,ta.ty-=r.y,Qs.render(this,i,!0,ta);var n=_r.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},Xn.prototype.cachedGraphicsData=[],Xn.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var ea=new me,ra=function(t){this.renderer=t};ra.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===wt.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(ea),s=ea,Pe.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution|0,s.ty*r.resolution|0),a|=0,h|=0):r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution,s.ty*r.resolution);var c=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Zs.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution)):i.drawImage(u,e._frame.x*c,e._frame.y*c,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),d&&i.restore(),r.setBlendMode(_t.NORMAL)}},ra.prototype.destroy=function(){this.renderer=null},Hn.prototype._tintedCanvas=null,Hn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var ia=new Oe,na=function(t){this.renderer=t,t.extract=this};na.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},na.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},na.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=ia).width=this.renderer.width,i.height=this.renderer.height);var s=i.width*r,a=i.height*r,h=new ee(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},na.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=ia).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},na.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var oa={CanvasExtract:na},sa=16,aa=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=sa,this.canvas.height=sa,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ha)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(io);function ha(t,e){if(e instanceof or){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}var ua={CanvasPrepare:aa};ts.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ee(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Zs.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,u),r.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(h+c,u+d),r.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},zo.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+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 s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==F(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,r,i)),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,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(F(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&F(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(F(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&L(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&R(or.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function L(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)}function F(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||F(t,e,r)>0!=F(t,e,i)>0&&F(r,i,t)>0!=F(r,i,e)>0}function B(t,e){return F(t.prev,t,t.next)<0?F(t,e,t.next)>=0&&F(t,t.prev,e)>=0:F(t,e,t.prev)<0||F(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function X(t,e,r,i){var n=new G(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Ot}function Lt(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function Ut(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Bt=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function kt(t,e){return Bt[e?1:0][t]}function Xt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function jt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Gt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Kt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Jt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Ie.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Ie.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Fe=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=gf?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Ne.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Yt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort(Be),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=Vt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Zt(this.realWidth)&&Zt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $t[this.cacheId],delete Qt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+Vt()),i=t._pixiId);var n=$t[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$t[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Ft(t),Lt(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Lr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i0&&(e+="\nelse "),rthis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=qt(Math.ceil(t/12)),r=Kt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=qt(Math.ceil(t/8)),r=Kt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;ithis.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,r=si?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,r=s-(h=n.radius+d/2)i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,r=s-(h=n.height+d/2)i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;sl*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Le,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Le,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Ln.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Fe(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Lo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Lt(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(kt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Xt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=i&&$o.x=n&&$o.y0&&i.x>h&&(Yt(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ys="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",bs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ue.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ue.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Gt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Fs=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(Bs),Gs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;iw?w:E,e.moveTo(_,x+E),e.lineTo(_,x+T-E),e.quadraticCurveTo(_,x+T,_+E,x+T),e.lineTo(_+b-E,x+T),e.quadraticCurveTo(_+b,x+T,_+b,x+T-E),e.lineTo(_+b,x+E),e.quadraticCurveTo(_+b,x,_+b-E,x),e.lineTo(_+E,x),e.quadraticCurveTo(_,x,_,x+E),e.closePath()}}}},zs.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},zs.prototype.destroy=function(){};var qs=function(t){function e(r,i,n){var o;t.call(this,"Canvas",r,i,n),this.type=yt.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new zs(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),Ws()?(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="multiply",o[_t.SCREEN]="screen",o[_t.OVERLAY]="overlay",o[_t.DARKEN]="darken",o[_t.LIGHTEN]="lighten",o[_t.COLOR_DODGE]="color-dodge",o[_t.COLOR_BURN]="color-burn",o[_t.HARD_LIGHT]="hard-light",o[_t.SOFT_LIGHT]="soft-light",o[_t.DIFFERENCE]="difference",o[_t.EXCLUSION]="exclusion",o[_t.HUE]="hue",o[_t.SATURATION]="saturate",o[_t.COLOR]="color",o[_t.LUMINOSITY]="luminosity"):(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="source-over",o[_t.SCREEN]="source-over",o[_t.OVERLAY]="source-over",o[_t.DARKEN]="source-over",o[_t.LIGHTEN]="source-over",o[_t.COLOR_DODGE]="source-over",o[_t.COLOR_BURN]="source-over",o[_t.HARD_LIGHT]="source-over",o[_t.SOFT_LIGHT]="source-over",o[_t.DIFFERENCE]="source-over",o[_t.EXCLUSION]="source-over",o[_t.HUE]="source-over",o[_t.SATURATION]="source-over",o[_t.COLOR]="source-over",o[_t.LUMINOSITY]="source-over"),o[_t.NORMAL_NPM]=o[_t.NORMAL],o[_t.ADD_NPM]=o[_t.ADD],o[_t.SCREEN_NPM]=o[_t.SCREEN],o[_t.SRC_IN]="source-in",o[_t.SRC_OUT]="source-out",o[_t.SRC_ATOP]="source-atop",o[_t.DST_OVER]="destination-over",o[_t.DST_IN]="destination-in",o[_t.DST_OUT]="destination-out",o[_t.DST_ATOP]="destination-atop",o[_t.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,Dt("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ee(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=_t.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[_t.NORMAL],(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===_t.SRC_IN||t===_t.SRC_OUT||t===_t.DST_IN||t===_t.DST_ATOP;!e&&r&&(t=_t.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===wt.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi),Zs={getTintedCanvas:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=Zs.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=Zs.canvas||document.createElement("canvas");if(Zs.tintMethod(r,e,n),n.tintId=r._updateID,Zs.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,Zs.canvas=null;return n},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=Lt(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=w/Math.abs(t.worldTransform.a),P=w/Math.abs(t.worldTransform.d),I=(y+_+x)/3,A=(b+T+E)/3,O=y-I,C=b-A,M=Math.sqrt(O*O+C*C);y=I+O/M*(M+S),b=A+C/M*(M+P),C=T-A,_=I+(O=_-I)/(M=Math.sqrt(O*O+C*C))*(M+S),T=A+C/M*(M+P),C=E-A,x=I+(O=x-I)/(M=Math.sqrt(O*O+C*C))*(M+S),E=A+C/M*(M+P)}n.save(),n.beginPath(),n.moveTo(y,b),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=d*g+v*f+p*m-g*f-v*p-d*m,R=y*g+v*x+_*m-g*x-v*_-y*m,L=d*_+y*f+p*x-_*f-y*p-d*x,F=d*g*x+v*_*f+y*p*m-y*g*f-v*p*x-d*_*m,N=b*g+v*E+T*m-g*E-v*T-b*m,U=d*T+b*f+p*E-T*f-b*p-d*E,B=d*g*E+v*T*f+b*p*m-b*g*f-v*p*E-d*T*m;n.transform(R/D,N/D,L/D,U/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Js.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0){g=0,y=f[0],_=f[1];for(var b=2;b+2=0;S-=2)r.lineTo(f[S],f[S+1])}v[T].shape.closeStroke&&r.closePath()}}l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RECT)l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===ge.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke());else if(h.type===ge.ELIP){var P=2*u.width,I=2*u.height,A=u.x-P/2,O=u.y-I/2;r.beginPath();var C=P/2*.5522848,M=I/2*.5522848,D=A+P,R=O+I,L=A+P/2,F=O+I/2;r.moveTo(A,F),r.bezierCurveTo(A,F-M,L-C,O,L,O),r.bezierCurveTo(L+C,O,D,F-M,D,F),r.bezierCurveTo(D,F+M,L+C,R,L,R),r.bezierCurveTo(L-C,R,A,F+M,A,F),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RREC){var N=u.x,U=u.y,B=u.width,k=u.height,X=u.radius,j=Math.min(B,k)/2|0;X=X>j?j:X,r.beginPath(),r.moveTo(N,U+X),r.lineTo(N,U+k-X),r.quadraticCurveTo(N,U+k,N+X,U+k),r.lineTo(N+B-X,U+k),r.quadraticCurveTo(N+B,U+k,N+B,U+k-X),r.lineTo(N+B,U+X),r.quadraticCurveTo(N+B,U,N+B-X,U),r.lineTo(N+X,U),r.quadraticCurveTo(N,U,N,U+X),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}}},$s.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},$s.prototype.destroy=function(){this.renderer=null};var ta=new me;Xn.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=br.create(r.width,r.height,t,e);Qs||(Qs=new qs),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(ta),ta.invert(),ta.tx-=r.x,ta.ty-=r.y,Qs.render(this,i,!0,ta);var n=_r.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},Xn.prototype.cachedGraphicsData=[],Xn.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var ea=new me,ra=function(t){this.renderer=t};ra.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===wt.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(ea),s=ea,Pe.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution|0,s.ty*r.resolution|0),a|=0,h|=0):r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution,s.ty*r.resolution);var c=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Zs.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution)):i.drawImage(u,e._frame.x*c,e._frame.y*c,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),d&&i.restore(),r.setBlendMode(_t.NORMAL)}},ra.prototype.destroy=function(){this.renderer=null},Hn.prototype._tintedCanvas=null,Hn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var ia=new Oe,na=function(t){this.renderer=t,t.extract=this};na.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},na.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},na.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=ia).width=this.renderer.width,i.height=this.renderer.height);var s=i.width*r,a=i.height*r,h=new ee(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},na.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=ia).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},na.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var oa={CanvasExtract:na},sa=16,aa=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=sa,this.canvas.height=sa,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ha)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(io);function ha(t,e){if(e instanceof or){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}var ua={CanvasPrepare:aa};ts.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ee(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Zs.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,u),r.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(h+c,u+d),r.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},zo.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+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 s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==F(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,r,i)),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,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(F(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&F(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(F(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&L(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&R(or.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function L(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)}function F(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||F(t,e,r)>0!=F(t,e,i)>0&&F(r,i,t)>0!=F(r,i,e)>0}function B(t,e){return F(t.prev,t,t.next)<0?F(t,e,t.next)>=0&&F(t,t.prev,e)>=0:F(t,e,t.prev)<0||F(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function X(t,e,r,i){var n=new G(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Ot}function Lt(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function Ut(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Bt=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function kt(t,e){return Bt[e?1:0][t]}function Xt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function jt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Gt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Kt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Jt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Ie.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Ie.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Fe=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=gf?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Ne.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Yt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort(Be),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=Vt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Zt(this.realWidth)&&Zt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $t[this.cacheId],delete Qt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+Vt()),i=t._pixiId);var n=$t[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$t[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Ft(t),Lt(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Lr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i0&&(e+="\nelse "),rthis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=qt(Math.ceil(t/12)),r=Kt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=qt(Math.ceil(t/8)),r=Kt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;ithis.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,r=si?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,r=s-(h=n.radius+d/2)i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,r=s-(h=n.height+d/2)i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;sl*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Le,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Le,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Ln.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Fe(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Lo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Lt(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(kt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Xt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=i&&$o.x=n&&$o.y0&&i.x>h&&(Yt(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ys="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",bs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ue.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ue.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Gt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Fs=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(Bs),Gs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;iw?w:E,e.moveTo(_,x+E),e.lineTo(_,x+T-E),e.quadraticCurveTo(_,x+T,_+E,x+T),e.lineTo(_+b-E,x+T),e.quadraticCurveTo(_+b,x+T,_+b,x+T-E),e.lineTo(_+b,x+E),e.quadraticCurveTo(_+b,x,_+b-E,x),e.lineTo(_+E,x),e.quadraticCurveTo(_,x,_,x+E),e.closePath()}}}},zs.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},zs.prototype.destroy=function(){};var qs=function(t){function e(r,i,n){var o;t.call(this,"Canvas",r,i,n),this.type=yt.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new zs(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),Ws()?(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="multiply",o[_t.SCREEN]="screen",o[_t.OVERLAY]="overlay",o[_t.DARKEN]="darken",o[_t.LIGHTEN]="lighten",o[_t.COLOR_DODGE]="color-dodge",o[_t.COLOR_BURN]="color-burn",o[_t.HARD_LIGHT]="hard-light",o[_t.SOFT_LIGHT]="soft-light",o[_t.DIFFERENCE]="difference",o[_t.EXCLUSION]="exclusion",o[_t.HUE]="hue",o[_t.SATURATION]="saturate",o[_t.COLOR]="color",o[_t.LUMINOSITY]="luminosity"):(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="source-over",o[_t.SCREEN]="source-over",o[_t.OVERLAY]="source-over",o[_t.DARKEN]="source-over",o[_t.LIGHTEN]="source-over",o[_t.COLOR_DODGE]="source-over",o[_t.COLOR_BURN]="source-over",o[_t.HARD_LIGHT]="source-over",o[_t.SOFT_LIGHT]="source-over",o[_t.DIFFERENCE]="source-over",o[_t.EXCLUSION]="source-over",o[_t.HUE]="source-over",o[_t.SATURATION]="source-over",o[_t.COLOR]="source-over",o[_t.LUMINOSITY]="source-over"),o[_t.NORMAL_NPM]=o[_t.NORMAL],o[_t.ADD_NPM]=o[_t.ADD],o[_t.SCREEN_NPM]=o[_t.SCREEN],o[_t.SRC_IN]="source-in",o[_t.SRC_OUT]="source-out",o[_t.SRC_ATOP]="source-atop",o[_t.DST_OVER]="destination-over",o[_t.DST_IN]="destination-in",o[_t.DST_OUT]="destination-out",o[_t.DST_ATOP]="destination-atop",o[_t.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,Dt("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ee(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=_t.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[_t.NORMAL],(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===_t.SRC_IN||t===_t.SRC_OUT||t===_t.DST_IN||t===_t.DST_ATOP;!e&&r&&(t=_t.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===wt.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi),Zs={getTintedCanvas:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=Zs.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=Zs.canvas||document.createElement("canvas");if(Zs.tintMethod(r,e,n),n.tintId=r._updateID,Zs.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,Zs.canvas=null;return n},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=Lt(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=w/Math.abs(t.worldTransform.a),P=w/Math.abs(t.worldTransform.d),I=(y+_+x)/3,A=(b+T+E)/3,O=y-I,C=b-A,M=Math.sqrt(O*O+C*C);y=I+O/M*(M+S),b=A+C/M*(M+P),C=T-A,_=I+(O=_-I)/(M=Math.sqrt(O*O+C*C))*(M+S),T=A+C/M*(M+P),C=E-A,x=I+(O=x-I)/(M=Math.sqrt(O*O+C*C))*(M+S),E=A+C/M*(M+P)}n.save(),n.beginPath(),n.moveTo(y,b),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=d*g+v*f+p*m-g*f-v*p-d*m,R=y*g+v*x+_*m-g*x-v*_-y*m,L=d*_+y*f+p*x-_*f-y*p-d*x,F=d*g*x+v*_*f+y*p*m-y*g*f-v*p*x-d*_*m,N=b*g+v*E+T*m-g*E-v*T-b*m,U=d*T+b*f+p*E-T*f-b*p-d*E,B=d*g*E+v*T*f+b*p*m-b*g*f-v*p*E-d*T*m;n.transform(R/D,N/D,L/D,U/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Js.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0){g=0,y=f[0],_=f[1];for(var b=2;b+2=0;S-=2)r.lineTo(f[S],f[S+1])}v[T].shape.closeStroke&&r.closePath()}}l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RECT)l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===ge.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke());else if(h.type===ge.ELIP){var P=2*u.width,I=2*u.height,A=u.x-P/2,O=u.y-I/2;r.beginPath();var C=P/2*.5522848,M=I/2*.5522848,D=A+P,R=O+I,L=A+P/2,F=O+I/2;r.moveTo(A,F),r.bezierCurveTo(A,F-M,L-C,O,L,O),r.bezierCurveTo(L+C,O,D,F-M,D,F),r.bezierCurveTo(D,F+M,L+C,R,L,R),r.bezierCurveTo(L-C,R,A,F+M,A,F),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RREC){var N=u.x,U=u.y,B=u.width,k=u.height,X=u.radius,j=Math.min(B,k)/2|0;X=X>j?j:X,r.beginPath(),r.moveTo(N,U+X),r.lineTo(N,U+k-X),r.quadraticCurveTo(N,U+k,N+X,U+k),r.lineTo(N+B-X,U+k),r.quadraticCurveTo(N+B,U+k,N+B,U+k-X),r.lineTo(N+B,U+X),r.quadraticCurveTo(N+B,U,N+B-X,U),r.lineTo(N+X,U),r.quadraticCurveTo(N,U,N,U+X),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}}},$s.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},$s.prototype.destroy=function(){this.renderer=null};var ta=new me;Xn.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=br.create(r.width,r.height,t,e);Qs||(Qs=new qs),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(ta),ta.invert(),ta.tx-=r.x,ta.ty-=r.y,Qs.render(this,i,!0,ta);var n=_r.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},Xn.prototype.cachedGraphicsData=[],Xn.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var ea=new me,ra=function(t){this.renderer=t};ra.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===wt.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(ea),s=ea,Pe.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution|0,s.ty*r.resolution|0),a|=0,h|=0):r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution,s.ty*r.resolution);var c=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Zs.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution)):i.drawImage(u,e._frame.x*c,e._frame.y*c,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),d&&i.restore(),r.setBlendMode(_t.NORMAL)}},ra.prototype.destroy=function(){this.renderer=null},Hn.prototype._tintedCanvas=null,Hn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var ia=new Oe,na=function(t){this.renderer=t,t.extract=this};na.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},na.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},na.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=ia).width=this.renderer.width,i.height=this.renderer.height);var s=i.width*r,a=i.height*r,h=new ee(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},na.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=ia).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},na.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var oa={CanvasExtract:na},sa=16,aa=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=sa,this.canvas.height=sa,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ha)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(io);function ha(t,e){if(e instanceof or){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}var ua={CanvasPrepare:aa};ts.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ee(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Zs.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,u),r.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(h+c,u+d),r.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},zo.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+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 s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==F(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,r,i)),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,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(F(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&F(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(F(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&L(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&R(or.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function L(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)}function F(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||F(t,e,r)>0!=F(t,e,i)>0&&F(r,i,t)>0!=F(r,i,e)>0}function B(t,e){return F(t.prev,t,t.next)<0?F(t,e,t.next)>=0&&F(t,t.prev,e)>=0:F(t,e,t.prev)<0||F(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function X(t,e,r,i){var n=new G(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Ot}function Lt(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function Ut(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Bt=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function kt(t,e){return Bt[e?1:0][t]}function Xt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function jt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Gt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Kt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Jt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Ie.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Ie.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Fe=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=gf?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Ne.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Yt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort(Be),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=Vt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Zt(this.realWidth)&&Zt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $t[this.cacheId],delete Qt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+Vt()),i=t._pixiId);var n=$t[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$t[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Ft(t),Lt(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Lr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i0&&(e+="\nelse "),rthis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=qt(Math.ceil(t/12)),r=Kt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=qt(Math.ceil(t/8)),r=Kt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;ithis.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,r=si?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,r=s-(h=n.radius+d/2)i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,r=s-(h=n.height+d/2)i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;sl*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Le,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Le,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Ln.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Fe(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Lo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Lt(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(kt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Xt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=i&&$o.x=n&&$o.y0&&i.x>h&&(Yt(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ys="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",bs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ue.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ue.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Gt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Fs=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(Bs),Gs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;iw?w:E,e.moveTo(_,x+E),e.lineTo(_,x+T-E),e.quadraticCurveTo(_,x+T,_+E,x+T),e.lineTo(_+b-E,x+T),e.quadraticCurveTo(_+b,x+T,_+b,x+T-E),e.lineTo(_+b,x+E),e.quadraticCurveTo(_+b,x,_+b-E,x),e.lineTo(_+E,x),e.quadraticCurveTo(_,x,_,x+E),e.closePath()}}}},zs.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},zs.prototype.destroy=function(){};var qs=function(t){function e(r,i,n){var o;t.call(this,"Canvas",r,i,n),this.type=yt.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new zs(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),Ws()?(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="multiply",o[_t.SCREEN]="screen",o[_t.OVERLAY]="overlay",o[_t.DARKEN]="darken",o[_t.LIGHTEN]="lighten",o[_t.COLOR_DODGE]="color-dodge",o[_t.COLOR_BURN]="color-burn",o[_t.HARD_LIGHT]="hard-light",o[_t.SOFT_LIGHT]="soft-light",o[_t.DIFFERENCE]="difference",o[_t.EXCLUSION]="exclusion",o[_t.HUE]="hue",o[_t.SATURATION]="saturate",o[_t.COLOR]="color",o[_t.LUMINOSITY]="luminosity"):(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="source-over",o[_t.SCREEN]="source-over",o[_t.OVERLAY]="source-over",o[_t.DARKEN]="source-over",o[_t.LIGHTEN]="source-over",o[_t.COLOR_DODGE]="source-over",o[_t.COLOR_BURN]="source-over",o[_t.HARD_LIGHT]="source-over",o[_t.SOFT_LIGHT]="source-over",o[_t.DIFFERENCE]="source-over",o[_t.EXCLUSION]="source-over",o[_t.HUE]="source-over",o[_t.SATURATION]="source-over",o[_t.COLOR]="source-over",o[_t.LUMINOSITY]="source-over"),o[_t.NORMAL_NPM]=o[_t.NORMAL],o[_t.ADD_NPM]=o[_t.ADD],o[_t.SCREEN_NPM]=o[_t.SCREEN],o[_t.SRC_IN]="source-in",o[_t.SRC_OUT]="source-out",o[_t.SRC_ATOP]="source-atop",o[_t.DST_OVER]="destination-over",o[_t.DST_IN]="destination-in",o[_t.DST_OUT]="destination-out",o[_t.DST_ATOP]="destination-atop",o[_t.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,Dt("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ee(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=_t.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[_t.NORMAL],(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===_t.SRC_IN||t===_t.SRC_OUT||t===_t.DST_IN||t===_t.DST_ATOP;!e&&r&&(t=_t.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===wt.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi),Zs={getTintedCanvas:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=Zs.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=Zs.canvas||document.createElement("canvas");if(Zs.tintMethod(r,e,n),n.tintId=r._updateID,Zs.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,Zs.canvas=null;return n},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=Lt(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=w/Math.abs(t.worldTransform.a),P=w/Math.abs(t.worldTransform.d),I=(y+_+x)/3,A=(b+T+E)/3,O=y-I,C=b-A,M=Math.sqrt(O*O+C*C);y=I+O/M*(M+S),b=A+C/M*(M+P),C=T-A,_=I+(O=_-I)/(M=Math.sqrt(O*O+C*C))*(M+S),T=A+C/M*(M+P),C=E-A,x=I+(O=x-I)/(M=Math.sqrt(O*O+C*C))*(M+S),E=A+C/M*(M+P)}n.save(),n.beginPath(),n.moveTo(y,b),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=d*g+v*f+p*m-g*f-v*p-d*m,R=y*g+v*x+_*m-g*x-v*_-y*m,L=d*_+y*f+p*x-_*f-y*p-d*x,F=d*g*x+v*_*f+y*p*m-y*g*f-v*p*x-d*_*m,N=b*g+v*E+T*m-g*E-v*T-b*m,U=d*T+b*f+p*E-T*f-b*p-d*E,B=d*g*E+v*T*f+b*p*m-b*g*f-v*p*E-d*T*m;n.transform(R/D,N/D,L/D,U/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Js.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0){g=0,y=f[0],_=f[1];for(var b=2;b+2=0;S-=2)r.lineTo(f[S],f[S+1])}v[T].shape.closeStroke&&r.closePath()}}l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RECT)l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===ge.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke());else if(h.type===ge.ELIP){var P=2*u.width,I=2*u.height,A=u.x-P/2,O=u.y-I/2;r.beginPath();var C=P/2*.5522848,M=I/2*.5522848,D=A+P,R=O+I,L=A+P/2,F=O+I/2;r.moveTo(A,F),r.bezierCurveTo(A,F-M,L-C,O,L,O),r.bezierCurveTo(L+C,O,D,F-M,D,F),r.bezierCurveTo(D,F+M,L+C,R,L,R),r.bezierCurveTo(L-C,R,A,F+M,A,F),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RREC){var N=u.x,U=u.y,B=u.width,k=u.height,X=u.radius,j=Math.min(B,k)/2|0;X=X>j?j:X,r.beginPath(),r.moveTo(N,U+X),r.lineTo(N,U+k-X),r.quadraticCurveTo(N,U+k,N+X,U+k),r.lineTo(N+B-X,U+k),r.quadraticCurveTo(N+B,U+k,N+B,U+k-X),r.lineTo(N+B,U+X),r.quadraticCurveTo(N+B,U,N+B-X,U),r.lineTo(N+X,U),r.quadraticCurveTo(N,U,N,U+X),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}}},$s.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},$s.prototype.destroy=function(){this.renderer=null};var ta=new me;Xn.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=br.create(r.width,r.height,t,e);Qs||(Qs=new qs),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(ta),ta.invert(),ta.tx-=r.x,ta.ty-=r.y,Qs.render(this,i,!0,ta);var n=_r.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},Xn.prototype.cachedGraphicsData=[],Xn.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var ea=new me,ra=function(t){this.renderer=t};ra.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===wt.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(ea),s=ea,Pe.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution|0,s.ty*r.resolution|0),a|=0,h|=0):r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution,s.ty*r.resolution);var c=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Zs.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution)):i.drawImage(u,e._frame.x*c,e._frame.y*c,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),d&&i.restore(),r.setBlendMode(_t.NORMAL)}},ra.prototype.destroy=function(){this.renderer=null},Hn.prototype._tintedCanvas=null,Hn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var ia=new Oe,na=function(t){this.renderer=t,t.extract=this};na.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},na.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},na.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=ia).width=this.renderer.width,i.height=this.renderer.height);var s=i.width*r,a=i.height*r,h=new ee(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},na.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=ia).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},na.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var oa={CanvasExtract:na},sa=16,aa=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=sa,this.canvas.height=sa,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ha)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(io);function ha(t,e){if(e instanceof or){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}var ua={CanvasPrepare:aa};ts.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ee(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Zs.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,u),r.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(h+c,u+d),r.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},zo.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=r(function(t){!function(e){var i=/iPhone/i,r=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(i,e)&&!g(u,e),ipod:g(r,e),tablet:!g(i,e)&&g(n,e)&&!g(u,e),device:(g(i,e)||g(r,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var i=navigator.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)>=11&&(e=!0)}if(g.android.device){var r=navigator.userAgent.match(/Android\s([0-9.]*)/);r&&parseInt(r[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=r(function(t){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new n(r,o||t,s),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 s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,r,n=[];if(0===this._eventsCount)return n;for(r in t=this._events)e.call(t,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,s=new Array(o);n80*i){r=o=t[0],n=s=t[1];for(var f=i;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-r,s-n))?1/u:0}return w(d,p,i,r,n,u),p}function T(t,e,i,r,n){var o,s;if(n===H(t,e,i,r)>0)for(o=e;o=e;o-=r)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!N(r,r.next)&&0!==L(r.prev,r,r.next))r=r.next;else{if(j(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function w(t,e,i,r,n,o,s){if(t){!s&&o&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,i,r)),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,r,n,o,s,a,h,u=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,r=i,a=0,e=0;e0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(s>1)}(n)}(t,r,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,r,n,o):S(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,i),e,i,r,n,o,2):2===s&&A(t,e,i,r,n,o):w(E(t),e,i,r,n,o,1);break}}}function S(t){var e=t.prev,i=t,r=t.next;if(L(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&L(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,i,r){var n=t.prev,o=t,s=t.next;if(L(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,i,r),d=M(u,l,e,i,r),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!N(n,o)&&U(n,r,r.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),j(r),j(r.next),r=t=o),r=r.next}while(r!==t);return r}function A(t,e,i,r,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&F(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,i,r,n,o),void w(h,e,i,r,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var i,r=e,n=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>s){if(s=a,a===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x=r.x&&r.x>=l&&n!==r.x&&R(oi.x)&&B(r,t)&&(i=r,d=h),r=r.next;return i}(t,e)){var i=k(e,t);E(i,i.next)}}function M(t,e,i,r,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-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,i=t;do{(e.x=0&&(t-s)*(r-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(n-s)*(r-a)>=0}function F(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&&U(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)}function L(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,i,r){return!!(N(t,e)&&N(i,r)||N(t,r)&&N(i,e))||L(t,e,i)>0!=L(t,e,r)>0&&L(i,r,t)>0!=L(i,r,e)>0}function B(t,e){return L(t.prev,t,t.next)<0?L(t,e,t.next)>=0&&L(t,t.prev,e)>=0:L(t,e,t.prev)<0||L(t,t.next,e)<0}function k(t,e){var i=new G(t.i,t.x,t.y),r=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function X(t,e,i,r){var n=new G(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function j(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 G(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 H(t,e,i,r){for(var n=0,o=e,s=i-r;o0&&(r+=t[n-1].length,i.holes.push(r))}return i},_.default=x;var Y=r(function(t,i){!function(r){var n=i&&!i.nodeType&&i,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(r=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function I(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,i,r=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,i){var r=0;for(t=i?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;r+=l)t=E(t/T);return E(r+(T+1)*t/(t+p))}function D(t){var e,i,r,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((i=t.lastIndexOf(m))<0&&(i=0),r=0;r=128&&S("not-basic"),_.push(t.charCodeAt(r));for(n=i>0?i+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,i,r,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,i=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(r=n=P.length,n&&P.push(m);r<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-i)/(x=r+1))&&S("overflow"),i+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=i,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(i,x,r==n),i=0,++r}++i,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else r.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,i,r){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,i,r){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(r){var n=encodeURIComponent(q(r))+i;return Array.isArray(t[r])?t[r].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[r]))}).join(e):r?encodeURIComponent(q(r))+i+encodeURIComponent(q(t)):""},K=r(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof it))return it.prototype.format.call(t);return t.format()},et=it;function it(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var rt=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,i){if(t&&z.isObject(t)&&t instanceof it)return t;var r=new it;return r.parse(t,e,i),r}it.prototype.parse=function(t,e,i){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),n=-1!==r&&r127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift());return i.search=t.search,i.query=t.query,z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!_.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var b=_.slice(-1)[0],T=(i.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(i.hostname=i.host=P?"":_.length?_.shift():"",(S=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift()));return(m=m||i.host&&_.length)&&!P&&_.unshift(""),_.length?i.pathname=_.join("/"):(i.pathname=null,i.path=null),z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},it.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch(t){return!1}}()),Ot}function Ft(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Lt(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}var Ut=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}();function Bt(t,e){return Ut[e?1:0][t]}function kt(t,e,i,r){return i=i||new Float32Array(4),r||void 0===r?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function Xt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,r=t>>8&255,n=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(n=n*e+.5|0)}function jt(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(r||void 0===r)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function Gt(t){for(var e=6*t,i=new Uint16Array(e),r=0,n=0;r=n||0===i)){var o=n-(i=e+i>n?n-e:i);for(r=e;r>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function qt(t){return!(t&t-1||!t)}function Zt(t){var e=(t>65535)<<4,i=((t>>>=e)>255)<<3;return e|=i,e|=i=((t>>>=i)>15)<<2,(e|=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1}var Kt={},Jt=Object.create(null),Qt=Object.create(null);function $t(t){var e,i,r,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];Ee.push(e);for(var i=0;i<16;i++)for(var r=we(ye[t]*ye[i]+xe[t]*_e[i]),n=we(_e[t]*ye[i]+be[t]*_e[i]),o=we(ye[t]*xe[i]+xe[t]*be[i]),s=we(_e[t]*xe[i]+be[t]*be[i]),a=0;a<16;a++)if(ye[a]===r&&_e[a]===n&&xe[a]===o&&be[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new ge;u.set(ye[h],_e[h],xe[h],be[h],0,0),Te.push(u)}}();var Se={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return ye[t]},uY:function(t){return _e[t]},vX:function(t){return xe[t]},vY:function(t){return be[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return Ee[t][e]},sub:function(t,e){return Ee[t][Se.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Se.S:Se.N:2*Math.abs(e)<=Math.abs(t)?t>0?Se.E:Se.W:e>0?t>0?Se.SE:Se.SW:t>0?Se.NE:Se.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=Te[Se.inv(e)];n.tx=i,n.ty=r,t.append(n)}},Pe=function(){this.worldTransform=new ge,this.localTransform=new ge,this.position=new le(this.onChange,this,0,0),this.scale=new le(this.onChange,this,1,1),this.pivot=new le(this.onChange,this,0,0),this.skew=new le(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ie={rotation:{configurable:!0}};Pe.prototype.onChange=function(){this._localID++},Pe.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Pe.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Pe.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},Pe.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ie.rotation.get=function(){return this._rotation},Ie.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Pe.prototype,Ie),Pe.IDENTITY=new Pe;var Ae=function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=ve.RECT},Oe={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Ce={EMPTY:{configurable:!0}};Oe.left.get=function(){return this.x},Oe.right.get=function(){return this.x+this.width},Oe.top.get=function(){return this.y},Oe.bottom.get=function(){return this.y+this.height},Ce.EMPTY.get=function(){return new Ae(0,0,0,0)},Ae.prototype.clone=function(){return new Ae(this.x,this.y,this.width,this.height)},Ae.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Ae.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Ae.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(i=!i)}return i};var Fe=function(t,e,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=ve.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var i=t-(this.x+this.radius),r=e-(this.y+this.radius),n=this.radius*this.radius;if(i*i+r*r<=n)return!0;if((i=t-(this.x+this.width-this.radius))*i+r*r<=n)return!0;if(i*i+(r=e-(this.y+this.height-this.radius))*r<=n)return!0;if((i=t-(this.x+this.radius))*i+r*r<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Le=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Le.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Le.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Le.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ae.EMPTY:((t=t||new Ae(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Le.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Le.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,o=t[0],s=t[1];e=or?o:r,n=s>n?s:n,e=(o=t[2])r?o:r,n=s>n?s:n,e=(o=t[4])r?o:r,n=s>n?s:n,e=(o=t[6])r?o:r,n=s>n?s:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},Le.prototype.addFrame=function(t,e,i,r,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*i+l,m=a*e+u*i+c;d=gf?g:f,v=m>v?m:v,d=(g=s*r+h*i+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*r+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Le.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=r,this.minY=n,this.maxX=o,this.maxY=s},Le.prototype.addVertices=function(t,e,i,r){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=i;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Le.prototype.addBounds=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minXr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},Le.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Le.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ne=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Pe,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Le,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var i=Object.keys(t),r=0;r1)for(var r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);Ht(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,i=arguments.length;if(i>1)for(var r=0;r0&&o<=n){i=this.children.splice(r,o);for(var s=0;s1&&this.children.sort(Ue),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},Xe.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},Xe.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},Xe.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},Xe.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},Xe.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},Xe.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},Xe.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},Ve.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Ve.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},Ve.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},Ve.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},Ve.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),i=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/i}},qe.shared.get=function(){if(!Ve._shared){var t=Ve._shared=new Ve;t.autoStart=!0,t._protected=!0}return Ve._shared},qe.system.get=function(){if(!Ve._system){var t=Ve._system=new Ve;t.autoStart=!0,t._protected=!0}return Ve._system},Object.defineProperties(Ve.prototype,We),Object.defineProperties(Ve,qe);var Ze=function(){};Ze.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ye.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Ve.shared:new Ve,t.autoStart&&this.start()},Ze.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Ke=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Ge("setRealSize",2),this.onUpdate=new Ge("update")},Je={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Ke.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Ke.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Ke.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Je.valid.get=function(){return!!this._width&&!!this._height},Ke.prototype.update=function(){this.destroyed||this.onUpdate.run()},Ke.prototype.load=function(){return Promise.resolve()},Je.width.get=function(){return this._width},Je.height.get=function(){return this._height},Ke.prototype.upload=function(t,e,i){return!1},Ke.prototype.style=function(t,e,i){return!1},Ke.prototype.dispose=function(){},Ke.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Ke.prototype,Je);var Qe=function(t){function e(e){var i=e.naturalWidth||e.videoWidth||e.width,r=e.naturalHeight||e.videoHeight||e.height;t.call(this,i,r),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=ne(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,r){var n=t.gl,o=e.realWidth,s=e.realHeight;return r=r||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&i.width===o&&i.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,r):(i.width=o,i.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,r)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,i=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Ke),$e=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLImageElement)){var r=new Image;t.crossOrigin(r,e,i.crossorigin),r.src=e,e=r}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==i.createBitmap?i.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==i.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==i.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var i=e.source,r=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?r():i.onload=r}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,i,r){if(i.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,i,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,r,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in i._glTextures){var s=i._glTextures[o];if(s!==r&&s.dirtyId!==i.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}(Qe),ti=[];function ei(t,e){if(!t)return null;var i="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(i=r[1].toLowerCase())}for(var n=ti.length-1;n>=0;--n){var o=ti[n];if(o.test&&o.test(t,i))return new o(t,e)}return new $e(t,e)}var ii=function(t){function e(e,i){var r=i||{},n=r.width,o=r.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;if(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height)r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{i.width=e.width,i.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),r.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Ke),ri={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},ni=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null),t.call(this);var r=(i=i||{}).premultiplyAlpha,n=i.mipmap,o=i.scaleMode,s=i.width,a=i.height,h=i.wrapMode,u=i.format,l=i.type,c=i.target,d=i.resolution,p=i.resourceOptions;!e||e instanceof Ke||((e=ei(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==r,this.uid=zt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={realWidth:{configurable:!0},realHeight:{configurable:!0}};return i.realWidth.get=function(){return this.width*this.resolution},i.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=qt(this.realWidth)&&qt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Qt[this.cacheId],delete Jt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,i){var r=null;"string"==typeof t?r=t:(t._pixiId||(t._pixiId="pixiid_"+zt()),r=t._pixiId);var n=Qt[r];return n||((n=new e(t,i)).cacheId=r,e.addToCache(n,r)),n},e.fromBuffer=function(t,i,r,n){t=t||new Float32Array(i*r*4);var o=new ii(t,{width:i,height:r}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(ri,n||{width:i,height:r,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Qt[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),Qt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=Qt[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var ui=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(r,e[0].src||e[0],i.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&Ve.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},i.autoUpdate.get=function(){return this._autoUpdate},i.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0))},i.updateFPS.get=function(){return this._updateFPS},i.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,i){return t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},Object.defineProperties(e.prototype,i),e}(Qe);ui.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],ti.push($e,si,ui,hi,ii,ai,oi);var li={INSTALLED:ti,autoDetectResource:ei,ArrayResource:oi,BufferResource:ii,CanvasResource:si,CubeResource:ai,ImageResource:$e,SVGResource:hi,VideoResource:ui,Resource:Ke,BaseImageResource:Qe},ci=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};ci.prototype.contextChange=function(t){},ci.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,r.texImage2D(e.target,0,r.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ii),pi=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ge("disposeFramebuffer",2)},fi={colorTexture:{configurable:!0}};fi.colorTexture.get=function(){return this.colorTextures[0]},pi.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new ni(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.addDepthTexture=function(t){return this.depthTexture=t||new ni(new di(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&e.textureCacheIds.splice(i,1),delete Jt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;rthis.baseTexture.width,s=i+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,u="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},i.rotate.get=function(){return this._rotate},i.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},i.width.get=function(){return this.orig.width},i.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,i),e}(y);function _i(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}yi.EMPTY=new yi(new ni),_i(yi.EMPTY),_i(yi.EMPTY.baseTexture),yi.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new yi(new ni(new si(t)))}(),_i(yi.WHITE),_i(yi.WHITE.baseTexture);var xi=function(t){function e(e,i){var r=null;if(!(e instanceof vi)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),r=arguments[0],i=null,e=new vi({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,i),this.legacyRenderer=r,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,i){void 0===i&&(i=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,i&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new vi(t))},e}(yi),bi=function(t,e,i,r,n,o,s){void 0===i&&(i=!1),void 0===r&&(r=5126),this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=o,this.instance=s};bi.prototype.destroy=function(){this.buffer=null},bi.from=function(t,e,i,r,n){return new bi(t,e,i,r,n)};var Ti=0,Ei=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=Ti++,this.disposeRunner=new Ge("disposeBuffer",2)};function wi(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}Ei.prototype.update=function(t){this.data=t||this.data,this._updateID++},Ei.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Ei.prototype.destroy=function(){this.dispose(),this.data=null},Ei.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new Ei(t)};var Si={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Pi={5126:4,5123:2,5121:1},Ii=0,Ai={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Oi=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ii++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new Ge("disposeGeometry",2),this.refCount=0};Oi.prototype.addAttribute=function(t,e,i,r,n,o,s,a){if(void 0===r&&(r=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new Ei(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),i},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,i),e}(ci),Xi=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new pi(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ae,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var i=this.gl;if(t){var r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,r.framebuffer)),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):r.dirtySize!==t.dirtySize&&(r.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}i.stencil||!t.stencil&&!t.depth||(i.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.stencil&&r.deleteRenderbuffer(i.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=r.data.byteLength)e.bufferSubData(o,0,r.data);else{var s=r.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=r.data.byteLength,e.bufferData(o,r.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var i=t.attributes,r=e.attributeData;for(var n in r)if(!i[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var i=t.attributes,r=e.attributeData,n=["g",t.id];for(var o in i)r[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var i=this.gl,r=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Gi[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Gi[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Gi[f.type])}s=i.createVertexArray(),i.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Zi=t,t}return Zi}function Ji(t,e,i){if("precision"!==t.substring(0,9)){var r=e;return e===At.HIGH&&i!==At.HIGH&&(r=At.MEDIUM),"precision "+r+" float;\n"+t}return i!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var Qi={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function $i(t){return Qi[t]}var tr=null,er={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ir(t,e){if(!tr){var i=Object.keys(er);tr={};for(var r=0;r0&&(e+="\nelse "),ie.name?1:-1});for(var u=0;u>=1,i++;this.stateId=t.data}for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,r=0;rthis.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,i=!0)}if(i){for(var o=0,s=0;s=0;i--)this.unload(t.children[i])},e}(ci),kr=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},Xr=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ni}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var i=this.gl;e.mipmap&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST):i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR:i.NEAREST),i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode?i.LINEAR:i.NEAREST)},e}(ci),jr={FilterSystem:Li,BatchSystem:Ui,ContextSystem:ki,FramebufferSystem:Xi,GeometrySystem:Hi,MaskSystem:wr,StencilSystem:Sr,ProjectionSystem:Pr,RenderTextureSystem:Ar,ShaderSystem:Mr,StateSystem:Ur,TextureGCSystem:Br,TextureSystem:Xr},Gr=new ge,Hr=function(t){function e(e,i){t.call(this),(i=Object.assign({},m.RENDER_OPTIONS,i)).roundPixels&&(m.ROUND_PIXELS=i.roundPixels,ae("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=i,this.type=yt.UNKNOWN,this.screen=new Ae(0,0,i.width,i.height),this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution||m.RESOLUTION,this.transparent=i.transparent,this.autoDensity=i.autoDensity||i.autoResize||!1,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new Be,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},i.width.get=function(){return this.view.width},i.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,i,r){0===(r=r||t.getLocalBounds()).width&&(r.width=1),0===r.height&&(r.height=1);var n=xi.create(0|r.width,0|r.height,e,i);return Gr.tx=-r.x,Gr.ty=-r.y,this.render(t,n,!1,Gr,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},i.backgroundColor.get=function(){return this._backgroundColor},i.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Lt(t),Ft(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,i),e}(y),Yr=function(t){function e(i){void 0===i&&(i={}),t.call(this,"WebGL",i),i=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new Ge("destroy"),contextChange:new Ge("contextChange",1),reset:new Ge("reset"),update:new Ge("update"),postrender:new Ge("postrender"),prerender:new Ge("prerender"),resize:new Ge("resize",2)},this.globalUniforms=new Ri({projectionMatrix:new ge},!0),this.addSystem(wr,"mask").addSystem(ki,"context").addSystem(Ur,"state").addSystem(Mr,"shader").addSystem(Xr,"texture").addSystem(Hi,"geometry").addSystem(Xi,"framebuffer").addSystem(Sr,"stencil").addSystem(Pr,"projection").addSystem(Br,"textureGC").addSystem(Li,"filter").addSystem(Ar,"renderTexture").addSystem(Ui,"batch"),this.initPlugins(e.__plugins),i.context?this.context.initFromContext(i.context):this.context.initFromOptions({alpha:this.transparent,antialias:i.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=i,this.runners)this.runners[r].add(i);return this},e.prototype.render=function(t,e,i,r,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=r,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.run(e,i)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(Hr);function zr(t){return Yr.create(t)}var Vr="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",Wr="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,i){return new e(new ai(t,i))},e}(ni),Zr=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new Ei(null,e,!1),this._indexBuffer=new Ei(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oi),Kr=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Jr=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Jr.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var Qr="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",$r=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),tn={},en={};function rn(t,e){if(!en[e]){for(var i=new Int32Array(e),r=0;r0&&(e+="\nelse "),ithis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=Wt(Math.ceil(t/12)),i=Zt(e),r=12*e;this.iBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.iBuffers[i];return n||(this.iBuffers[i]=n=new Uint16Array(r)),n},e.prototype.getAttributeBuffer=function(t){var e=Wt(Math.ceil(t/8)),i=Zt(e),r=8*e;this.aBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.aBuffers[r];return n||(this.aBuffers[r]=n=new Jr(r*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,i=this.renderer.gl,r=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++ni._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,i,r,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(r=!1),s=!0)}}return n&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),i&&i(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=e.length,r=0;rthis.maxSegments&&(i=this.maxSegments),i}},_n=function(){this.reset()};_n.prototype.clone=function(){var t=new _n;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},_n.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=yi.WHITE,this.matrix=null,this.visible=!1},_n.prototype.destroy=function(){this.texture=null,this.matrix=null};var xn=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]};xn.prototype.clone=function(){return new xn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},xn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var bn={build:function(t){var e,i,r=t.shape,n=t.points,o=r.x,s=r.y;if(n.length=0,t.type===ve.CIRC?(e=r.radius,i=r.radius):(e=r.width,i=r.height),0!==e&&0!==i){var a=Math.floor(30*Math.sqrt(r.radius))||Math.floor(15*Math.sqrt(r.width+r.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=r[2*(d-2)],m=r[2*(d-2)+1],y=r[2*(d-1)],_=r[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(r=In.pop()||new Cn,this.batches.push(r)),r.style=d,r.start=f,r.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),En.triangulate(a,this)):h.triangulate(a,this);else{Tn(a,this);for(var m=0;m0&&(o=An.pop()||new Kr,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(r,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}ni._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,i=sr?s+h:r;else if(c===ve.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,i=s-(h=n.radius+d/2)r?s+h:r;else if(c===ve.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,i=s-(h=n.height+d/2)r?s+h:r;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,i=(b=(v+s)/2)-(_=(h/a*g+m)/2)r?b+_:r)}else t=0,e=0,i=0,r=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=i-E,this._bounds.maxY=r+E},e.prototype.transformPoints=function(t,e){for(var i=0;i>16)+(65280&e)+((255&e)<<16),i);r-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,i,r,n,o){for(var s=0,a=e.length,h=i.frame;sl*a}},Ln.arc=function(t,e,i,r,n,o,s,a,h){for(var u=s-o,l=yn._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/de)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+i,(p*-x+f*_)*n+r)}};var Nn=function(t){function e(e,i,r,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*r,u=de/h,l=[],c=0;c0&&r>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:i,width:t,alpha:r,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Re,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Re,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,i,r,n),this},e.prototype.bezierCurveTo=function(t,e,i,r,n,o){return this._initCurve(),Rn.curveTo(t,e,i,r,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var o=this.currentPath.points,s=Ln.curveTo(t,e,i,r,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,i,r,n,o){if(void 0===o&&(o=!1),r===n)return this;if(!o&&n<=r?n+=de:o&&r<=n&&(r+=de),0===n-r)return this;var s=t+Math.cos(r)*i,a=e+Math.sin(r)*i,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Ln.arc(s,a,t,e,i,r,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(yi.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,i,r){void 0===t&&(t=yi.WHITE),void 0===e&&(e=16777215),void 0===i&&(i=1),void 0===r&&(r=null),this.currentPath&&this.startPoly();var n=i>0;return n?(r&&(r=r.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:i,texture:t,matrix:r,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,r){return this.drawShape(new Ae(t,e,i,r))},e.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new Fe(t,e,i,r,n))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new Me(t,e,i))},e.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new De(t,e,i,r))},e.prototype.drawPolygon=function(t){var e=arguments,i=t,r=!0;if(i.points&&(r=i.closeStroke,i=i.points),!Array.isArray(i)){i=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,i=t.b,r=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=r&&Xn.x=n&&Xn.y>16)+(65280&t)+((255&t)<<16)},i.texture.get=function(){return this._texture},i.texture.set=function(t){this._texture!==t&&(this._texture=t||yi.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,i),e}(Be),Hn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},Yn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Hn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},zn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Vn=function(t){this.styleID=0,this.reset(),Kn(this,t,t)},Wn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function qn(t){return"number"==typeof t?Lt(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Zn(t){if(Array.isArray(t)){for(var e=0;e=0;i--){var r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&zn.indexOf(r)<0&&(r='"'+r+'"'),e[i]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Vn.prototype,Wn);var Jn=function(t,e,i,r,n,o,s,a,h){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Jn.measureText=function(t,e,i,r){void 0===r&&(r=Jn._canvas),i=null==i?e.wordWrap:i;var n=e.toFontString(),o=Jn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=r.getContext("2d");s.font=n;for(var a=(i?Jn.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Jn.addLine(o),o="",n=0),Jn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Jn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Jn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Jn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Jn.addLine(o),o="",n=0),(o.length>0||!Jn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Jn.addLine(o,!1)},Jn.addLine=function(t,e){return void 0===e&&(e=!0),t=Jn.trimRight(t),t=e?t+"\n":t},Jn.getFromCache=function(t,e,i,r){var n=i[t];if(void 0===n){var o=t.length*e;n=r.measureText(t).width+o,i[t]=n}return n},Jn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Jn.collapseNewlines=function(t){return"normal"===t},Jn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var i=t[e];if(!Jn.isBreakingSpace(i))break;t=t.slice(0,-1)}return t},Jn.isNewline=function(t){return"string"==typeof t&&Jn._newlines.indexOf(t.charCodeAt(0))>=0},Jn.isBreakingSpace=function(t){return"string"==typeof t&&Jn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Jn.tokenize=function(t){var e=[],i="";if("string"!=typeof t)return e;for(var r=0;rs;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new eo(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(ho),this.registerFindHook(uo),this.registerFindHook(ro),this.registerFindHook(no),this.registerFindHook(oo),this.registerUploadHook(so),this.registerUploadHook(ao)};function ro(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var r=0;r=0;r--)this.add(t.children[r]);return this},io.prototype.destroy=function(){this.ticking&&Ve.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var lo=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(fo),this.registerUploadHook(co),this.registerUploadHook(po)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function co(t,e){return e instanceof ni&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function po(t,e){return e instanceof kn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function fo(t,e){return t instanceof kn&&(e.push(t),!0)}var vo=function(t){this.maxMilliseconds=t,this.frameStart=0};vo.prototype.beginFrame=function(){this.frameStart=Date.now()},vo.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),wo=(i(Eo),Eo.Resource,r(function(t,e){e.__esModule=!0,e.Loader=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=i,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,i){return e._loadResource(t,i)},this._queue=s.queue(this._boundLoadResource,r),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Do(No);No.Resource;var Uo=Ro(function(t,e){e.__esModule=!0,e.encodeBinary=r;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(t){for(var e="",r=0;r>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(r=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=r,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(i),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t,Ft(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(o=i);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(Bt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=kt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;cr&&(p=r),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=r&&Qo.x=n&&Qo.y0&&r.x>h&&(Ht(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,r.x=0,r.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,r.x=0,r.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},i.align.get=function(){return this._font.align},i.align.set=function(t){this._font.align=t||"left",this.dirty=!0},i.anchor.get=function(){return this._anchor},i.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},i.font.get=function(){return this._font},i.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},i.text.get=function(){return this._text},i.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},i.maxWidth.get=function(){return this._maxWidth},i.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},i.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},i.textWidth.get=function(){return this.validate(),this._textWidth},i.letterSpacing.get=function(){return this._letterSpacing},i.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},i.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,i){var r={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=oe(s[0].getAttribute("file"),m.RESOLUTION),h={};r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,r.chars={},i instanceof yi&&(i=[i]);for(var u=0;u=r&&(e=t-s-1),o+=a=a.replace("%value%",i[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=r||4,this.blur=i||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,i,r);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",vs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,Wr,fs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),r=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[i+(1-i)*n,n*(1-i)-o*r,n*(1-i)+o*r,0,0,n*(1-i)+o*r,i+n*(1-i),n*(1-i)-o*r,0,0,n*(1-i)-o*r,n*(1-i)+o*r,i+n*(1-i),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,r=-.5*(i-1),n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,i,r,n){var o=((i=i||16770432)>>16&255)/255,s=(i>>8&255)/255,a=(255&i)/255,h=((r=r||3375104)>>16&255)/255,u=(r>>8&255)/255,l=(255&r)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},i.matrix.get=function(){return this.uniforms.m},i.matrix.set=function(t){this.uniforms.m=t},i.alpha.get=function(){return this.uniforms.uAlpha},i.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,i),e}(mr);vs.prototype.grayscale=vs.prototype.greyscale;var gs="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ms="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",ys=function(t){function e(e,i){var r=new ge;e.renderable=!1,t.call(this,gs,ms,{mapSampler:e._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=r,null==i&&(i=20),this.scale=new ue(i,i)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={map:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,i,r)},i.map.get=function(){return this.uniforms.mapSampler},i.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,i),e}(mr),_s="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",xs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',bs=function(t){function e(){t.call(this,_s,xs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(mr),Ts="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",Es=function(t){function e(e,i){void 0===e&&(e=.5),void 0===i&&(i=Math.random()),t.call(this,Wr,Ts,{uNoise:0,uSeed:0}),this.noise=e,this.seed=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={noise:{configurable:!0},seed:{configurable:!0}};return i.noise.get=function(){return this.uniforms.uNoise},i.noise.set=function(t){this.uniforms.uNoise=t},i.seed.get=function(){return this.uniforms.uSeed},i.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,i),e}(mr),ws=new ge;Ne.prototype._cacheAsBitmap=!1,Ne.prototype._cacheData=!1;var Ss=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ne.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ss),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ne.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ne.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds().clone();if(this.filters){var r=this.filters[0].padding;i.pad(r)}i.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=xi.create(i.width,i.height),s="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=s,ni.addToCache(o.baseTexture,s),yi.addToCache(o,s);var a=ws;a.tx=-i.x,a.ty=-i.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Gn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-i.x/i.width,h.anchor.y=-i.y/i.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ne.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ne.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),i=this.alpha;this.alpha=1;var r=t.context;e.ceil(m.RESOLUTION);var n=xi.create(e.width,e.height),o="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=o,ni.addToCache(n.baseTexture,o),yi.addToCache(n,o);var s=ws;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Gn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=i,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ne.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ne.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ne.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ni.removeFromCache(this._cacheData.textureCacheId),yi.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ne.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ne.prototype.name=null,Be.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},i.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;jt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,i),e}(pr),Fs=function(t){function e(e,i,r){t.call(this);var n=new Ei(e),o=new Ei(i,!0),s=new Ei(r,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertexDirtyId:{configurable:!0}};return i.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,i),e}(Oi),Ls=function(t){function e(e,i,r,n){void 0===e&&(e=100),void 0===i&&(i=100),void 0===r&&(r=10),void 0===n&&(n=10),t.call(this),this.segWidth=r,this.segHeight=n,this.width=e,this.height=i,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],r=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,i=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width},i.width.get=function(){return this._width},i.width.set=function(t){this._width=t,this._refresh()},i.height.get=function(){return this._height},i.height.set=function(t){this._height=t,this._refresh()},i.leftWidth.get=function(){return this._leftWidth},i.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},i.rightWidth.get=function(){return this._rightWidth},i.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},i.topHeight.get=function(){return this._topHeight},i.topHeight.set=function(t){this._topHeight=t,this._refresh()},i.bottomHeight.get=function(){return this._bottomHeight},i.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,i),e}(Bs),Gs=function(t){function e(e,i){t.call(this,e[0]instanceof yi?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==i,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&Ve.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&Ve.shared.add(this.update,this,Ye.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramei&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],r=0;r0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=r(function(t){!function(e){var i=/iPhone/i,r=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(i,e)&&!g(u,e),ipod:g(r,e),tablet:!g(i,e)&&g(n,e)&&!g(u,e),device:(g(i,e)||g(r,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var i=navigator.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)>=11&&(e=!0)}if(g.android.device){var r=navigator.userAgent.match(/Android\s([0-9.]*)/);r&&parseInt(r[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=r(function(t){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new n(r,o||t,s),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 s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,r,n=[];if(0===this._eventsCount)return n;for(r in t=this._events)e.call(t,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,s=new Array(o);n80*i){r=o=t[0],n=s=t[1];for(var f=i;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-r,s-n))?1/u:0}return w(d,p,i,r,n,u),p}function T(t,e,i,r,n){var o,s;if(n===H(t,e,i,r)>0)for(o=e;o=e;o-=r)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!N(r,r.next)&&0!==L(r.prev,r,r.next))r=r.next;else{if(j(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function w(t,e,i,r,n,o,s){if(t){!s&&o&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,i,r)),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,r,n,o,s,a,h,u=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,r=i,a=0,e=0;e0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(s>1)}(n)}(t,r,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,r,n,o):S(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,i),e,i,r,n,o,2):2===s&&A(t,e,i,r,n,o):w(E(t),e,i,r,n,o,1);break}}}function S(t){var e=t.prev,i=t,r=t.next;if(L(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&L(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,i,r){var n=t.prev,o=t,s=t.next;if(L(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,i,r),d=M(u,l,e,i,r),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!N(n,o)&&U(n,r,r.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),j(r),j(r.next),r=t=o),r=r.next}while(r!==t);return r}function A(t,e,i,r,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&F(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,i,r,n,o),void w(h,e,i,r,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var i,r=e,n=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>s){if(s=a,a===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x=r.x&&r.x>=l&&n!==r.x&&R(oi.x)&&B(r,t)&&(i=r,d=h),r=r.next;return i}(t,e)){var i=k(e,t);E(i,i.next)}}function M(t,e,i,r,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-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,i=t;do{(e.x=0&&(t-s)*(r-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(n-s)*(r-a)>=0}function F(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&&U(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)}function L(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,i,r){return!!(N(t,e)&&N(i,r)||N(t,r)&&N(i,e))||L(t,e,i)>0!=L(t,e,r)>0&&L(i,r,t)>0!=L(i,r,e)>0}function B(t,e){return L(t.prev,t,t.next)<0?L(t,e,t.next)>=0&&L(t,t.prev,e)>=0:L(t,e,t.prev)<0||L(t,t.next,e)<0}function k(t,e){var i=new G(t.i,t.x,t.y),r=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function X(t,e,i,r){var n=new G(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function j(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 G(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 H(t,e,i,r){for(var n=0,o=e,s=i-r;o0&&(r+=t[n-1].length,i.holes.push(r))}return i},_.default=x;var Y=r(function(t,i){!function(r){var n=i&&!i.nodeType&&i,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(r=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function I(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,i,r=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,i){var r=0;for(t=i?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;r+=l)t=E(t/T);return E(r+(T+1)*t/(t+p))}function D(t){var e,i,r,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((i=t.lastIndexOf(m))<0&&(i=0),r=0;r=128&&S("not-basic"),_.push(t.charCodeAt(r));for(n=i>0?i+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,i,r,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,i=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(r=n=P.length,n&&P.push(m);r<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-i)/(x=r+1))&&S("overflow"),i+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=i,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(i,x,r==n),i=0,++r}++i,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else r.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,i,r){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,i,r){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(r){var n=encodeURIComponent(q(r))+i;return Array.isArray(t[r])?t[r].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[r]))}).join(e):r?encodeURIComponent(q(r))+i+encodeURIComponent(q(t)):""},K=r(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof it))return it.prototype.format.call(t);return t.format()},et=it;function it(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var rt=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,i){if(t&&z.isObject(t)&&t instanceof it)return t;var r=new it;return r.parse(t,e,i),r}it.prototype.parse=function(t,e,i){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),n=-1!==r&&r127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift());return i.search=t.search,i.query=t.query,z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!_.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var b=_.slice(-1)[0],T=(i.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(i.hostname=i.host=P?"":_.length?_.shift():"",(S=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift()));return(m=m||i.host&&_.length)&&!P&&_.unshift(""),_.length?i.pathname=_.join("/"):(i.pathname=null,i.path=null),z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},it.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch(t){return!1}}()),Ot}function Ft(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Lt(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}var Ut=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}();function Bt(t,e){return Ut[e?1:0][t]}function kt(t,e,i,r){return i=i||new Float32Array(4),r||void 0===r?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function Xt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,r=t>>8&255,n=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(n=n*e+.5|0)}function jt(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(r||void 0===r)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function Gt(t){for(var e=6*t,i=new Uint16Array(e),r=0,n=0;r=n||0===i)){var o=n-(i=e+i>n?n-e:i);for(r=e;r>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function qt(t){return!(t&t-1||!t)}function Zt(t){var e=(t>65535)<<4,i=((t>>>=e)>255)<<3;return e|=i,e|=i=((t>>>=i)>15)<<2,(e|=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1}var Kt={},Jt=Object.create(null),Qt=Object.create(null);function $t(t){var e,i,r,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];Ee.push(e);for(var i=0;i<16;i++)for(var r=we(ye[t]*ye[i]+xe[t]*_e[i]),n=we(_e[t]*ye[i]+be[t]*_e[i]),o=we(ye[t]*xe[i]+xe[t]*be[i]),s=we(_e[t]*xe[i]+be[t]*be[i]),a=0;a<16;a++)if(ye[a]===r&&_e[a]===n&&xe[a]===o&&be[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new ge;u.set(ye[h],_e[h],xe[h],be[h],0,0),Te.push(u)}}();var Se={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return ye[t]},uY:function(t){return _e[t]},vX:function(t){return xe[t]},vY:function(t){return be[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return Ee[t][e]},sub:function(t,e){return Ee[t][Se.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Se.S:Se.N:2*Math.abs(e)<=Math.abs(t)?t>0?Se.E:Se.W:e>0?t>0?Se.SE:Se.SW:t>0?Se.NE:Se.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=Te[Se.inv(e)];n.tx=i,n.ty=r,t.append(n)}},Pe=function(){this.worldTransform=new ge,this.localTransform=new ge,this.position=new le(this.onChange,this,0,0),this.scale=new le(this.onChange,this,1,1),this.pivot=new le(this.onChange,this,0,0),this.skew=new le(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ie={rotation:{configurable:!0}};Pe.prototype.onChange=function(){this._localID++},Pe.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Pe.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Pe.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},Pe.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ie.rotation.get=function(){return this._rotation},Ie.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Pe.prototype,Ie),Pe.IDENTITY=new Pe;var Ae=function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=ve.RECT},Oe={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Ce={EMPTY:{configurable:!0}};Oe.left.get=function(){return this.x},Oe.right.get=function(){return this.x+this.width},Oe.top.get=function(){return this.y},Oe.bottom.get=function(){return this.y+this.height},Ce.EMPTY.get=function(){return new Ae(0,0,0,0)},Ae.prototype.clone=function(){return new Ae(this.x,this.y,this.width,this.height)},Ae.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Ae.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Ae.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(i=!i)}return i};var Fe=function(t,e,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=ve.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var i=t-(this.x+this.radius),r=e-(this.y+this.radius),n=this.radius*this.radius;if(i*i+r*r<=n)return!0;if((i=t-(this.x+this.width-this.radius))*i+r*r<=n)return!0;if(i*i+(r=e-(this.y+this.height-this.radius))*r<=n)return!0;if((i=t-(this.x+this.radius))*i+r*r<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Le=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Le.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Le.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Le.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ae.EMPTY:((t=t||new Ae(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Le.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Le.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,o=t[0],s=t[1];e=or?o:r,n=s>n?s:n,e=(o=t[2])r?o:r,n=s>n?s:n,e=(o=t[4])r?o:r,n=s>n?s:n,e=(o=t[6])r?o:r,n=s>n?s:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},Le.prototype.addFrame=function(t,e,i,r,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*i+l,m=a*e+u*i+c;d=gf?g:f,v=m>v?m:v,d=(g=s*r+h*i+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*r+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Le.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=r,this.minY=n,this.maxX=o,this.maxY=s},Le.prototype.addVertices=function(t,e,i,r){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=i;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Le.prototype.addBounds=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minXr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},Le.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Le.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ne=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Pe,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Le,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var i=Object.keys(t),r=0;r1)for(var r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);Ht(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,i=arguments.length;if(i>1)for(var r=0;r0&&o<=n){i=this.children.splice(r,o);for(var s=0;s1&&this.children.sort(Ue),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},Xe.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},Xe.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},Xe.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},Xe.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},Xe.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},Xe.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},Xe.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},Ve.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Ve.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},Ve.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},Ve.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},Ve.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),i=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/i}},qe.shared.get=function(){if(!Ve._shared){var t=Ve._shared=new Ve;t.autoStart=!0,t._protected=!0}return Ve._shared},qe.system.get=function(){if(!Ve._system){var t=Ve._system=new Ve;t.autoStart=!0,t._protected=!0}return Ve._system},Object.defineProperties(Ve.prototype,We),Object.defineProperties(Ve,qe);var Ze=function(){};Ze.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ye.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Ve.shared:new Ve,t.autoStart&&this.start()},Ze.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Ke=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Ge("setRealSize",2),this.onUpdate=new Ge("update")},Je={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Ke.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Ke.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Ke.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Je.valid.get=function(){return!!this._width&&!!this._height},Ke.prototype.update=function(){this.destroyed||this.onUpdate.run()},Ke.prototype.load=function(){return Promise.resolve()},Je.width.get=function(){return this._width},Je.height.get=function(){return this._height},Ke.prototype.upload=function(t,e,i){return!1},Ke.prototype.style=function(t,e,i){return!1},Ke.prototype.dispose=function(){},Ke.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Ke.prototype,Je);var Qe=function(t){function e(e){var i=e.naturalWidth||e.videoWidth||e.width,r=e.naturalHeight||e.videoHeight||e.height;t.call(this,i,r),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=ne(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,r){var n=t.gl,o=e.realWidth,s=e.realHeight;return r=r||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&i.width===o&&i.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,r):(i.width=o,i.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,r)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,i=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Ke),$e=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLImageElement)){var r=new Image;t.crossOrigin(r,e,i.crossorigin),r.src=e,e=r}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==i.createBitmap?i.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==i.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==i.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var i=e.source,r=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?r():i.onload=r}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,i,r){if(i.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,i,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,r,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in i._glTextures){var s=i._glTextures[o];if(s!==r&&s.dirtyId!==i.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}(Qe),ti=[];function ei(t,e){if(!t)return null;var i="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(i=r[1].toLowerCase())}for(var n=ti.length-1;n>=0;--n){var o=ti[n];if(o.test&&o.test(t,i))return new o(t,e)}return new $e(t,e)}var ii=function(t){function e(e,i){var r=i||{},n=r.width,o=r.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;if(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height)r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{i.width=e.width,i.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),r.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Ke),ri={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},ni=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null),t.call(this);var r=(i=i||{}).premultiplyAlpha,n=i.mipmap,o=i.scaleMode,s=i.width,a=i.height,h=i.wrapMode,u=i.format,l=i.type,c=i.target,d=i.resolution,p=i.resourceOptions;!e||e instanceof Ke||((e=ei(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==r,this.uid=zt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={realWidth:{configurable:!0},realHeight:{configurable:!0}};return i.realWidth.get=function(){return this.width*this.resolution},i.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=qt(this.realWidth)&&qt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Qt[this.cacheId],delete Jt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,i){var r=null;"string"==typeof t?r=t:(t._pixiId||(t._pixiId="pixiid_"+zt()),r=t._pixiId);var n=Qt[r];return n||((n=new e(t,i)).cacheId=r,e.addToCache(n,r)),n},e.fromBuffer=function(t,i,r,n){t=t||new Float32Array(i*r*4);var o=new ii(t,{width:i,height:r}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(ri,n||{width:i,height:r,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Qt[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),Qt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=Qt[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var ui=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(r,e[0].src||e[0],i.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&Ve.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},i.autoUpdate.get=function(){return this._autoUpdate},i.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0))},i.updateFPS.get=function(){return this._updateFPS},i.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,i){return t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},Object.defineProperties(e.prototype,i),e}(Qe);ui.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],ti.push($e,si,ui,hi,ii,ai,oi);var li={INSTALLED:ti,autoDetectResource:ei,ArrayResource:oi,BufferResource:ii,CanvasResource:si,CubeResource:ai,ImageResource:$e,SVGResource:hi,VideoResource:ui,Resource:Ke,BaseImageResource:Qe},ci=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};ci.prototype.contextChange=function(t){},ci.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,r.texImage2D(e.target,0,r.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ii),pi=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ge("disposeFramebuffer",2)},fi={colorTexture:{configurable:!0}};fi.colorTexture.get=function(){return this.colorTextures[0]},pi.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new ni(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.addDepthTexture=function(t){return this.depthTexture=t||new ni(new di(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&e.textureCacheIds.splice(i,1),delete Jt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;rthis.baseTexture.width,s=i+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,u="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},i.rotate.get=function(){return this._rotate},i.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},i.width.get=function(){return this.orig.width},i.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,i),e}(y);function _i(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}yi.EMPTY=new yi(new ni),_i(yi.EMPTY),_i(yi.EMPTY.baseTexture),yi.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new yi(new ni(new si(t)))}(),_i(yi.WHITE),_i(yi.WHITE.baseTexture);var xi=function(t){function e(e,i){var r=null;if(!(e instanceof vi)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),r=arguments[0],i=null,e=new vi({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,i),this.legacyRenderer=r,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,i){void 0===i&&(i=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,i&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new vi(t))},e}(yi),bi=function(t,e,i,r,n,o,s){void 0===i&&(i=!1),void 0===r&&(r=5126),this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=o,this.instance=s};bi.prototype.destroy=function(){this.buffer=null},bi.from=function(t,e,i,r,n){return new bi(t,e,i,r,n)};var Ti=0,Ei=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=Ti++,this.disposeRunner=new Ge("disposeBuffer",2)};function wi(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}Ei.prototype.update=function(t){this.data=t||this.data,this._updateID++},Ei.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Ei.prototype.destroy=function(){this.dispose(),this.data=null},Ei.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new Ei(t)};var Si={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Pi={5126:4,5123:2,5121:1},Ii=0,Ai={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Oi=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ii++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new Ge("disposeGeometry",2),this.refCount=0};Oi.prototype.addAttribute=function(t,e,i,r,n,o,s,a){if(void 0===r&&(r=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new Ei(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),i},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,i),e}(ci),Xi=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new pi(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ae,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var i=this.gl;if(t){var r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,r.framebuffer)),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):r.dirtySize!==t.dirtySize&&(r.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}i.stencil||!t.stencil&&!t.depth||(i.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.stencil&&r.deleteRenderbuffer(i.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=r.data.byteLength)e.bufferSubData(o,0,r.data);else{var s=r.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=r.data.byteLength,e.bufferData(o,r.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var i=t.attributes,r=e.attributeData;for(var n in r)if(!i[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var i=t.attributes,r=e.attributeData,n=["g",t.id];for(var o in i)r[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var i=this.gl,r=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Gi[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Gi[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Gi[f.type])}s=i.createVertexArray(),i.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Zi=t,t}return Zi}function Ji(t,e,i){if("precision"!==t.substring(0,9)){var r=e;return e===At.HIGH&&i!==At.HIGH&&(r=At.MEDIUM),"precision "+r+" float;\n"+t}return i!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var Qi={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function $i(t){return Qi[t]}var tr=null,er={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ir(t,e){if(!tr){var i=Object.keys(er);tr={};for(var r=0;r0&&(e+="\nelse "),ie.name?1:-1});for(var u=0;u>=1,i++;this.stateId=t.data}for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,r=0;rthis.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,i=!0)}if(i){for(var o=0,s=0;s=0;i--)this.unload(t.children[i])},e}(ci),kr=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},Xr=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ni}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var i=this.gl;e.mipmap&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST):i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR:i.NEAREST),i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode?i.LINEAR:i.NEAREST)},e}(ci),jr={FilterSystem:Li,BatchSystem:Ui,ContextSystem:ki,FramebufferSystem:Xi,GeometrySystem:Hi,MaskSystem:wr,StencilSystem:Sr,ProjectionSystem:Pr,RenderTextureSystem:Ar,ShaderSystem:Mr,StateSystem:Ur,TextureGCSystem:Br,TextureSystem:Xr},Gr=new ge,Hr=function(t){function e(e,i){t.call(this),(i=Object.assign({},m.RENDER_OPTIONS,i)).roundPixels&&(m.ROUND_PIXELS=i.roundPixels,ae("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=i,this.type=yt.UNKNOWN,this.screen=new Ae(0,0,i.width,i.height),this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution||m.RESOLUTION,this.transparent=i.transparent,this.autoDensity=i.autoDensity||i.autoResize||!1,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new Be,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},i.width.get=function(){return this.view.width},i.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,i,r){0===(r=r||t.getLocalBounds()).width&&(r.width=1),0===r.height&&(r.height=1);var n=xi.create(0|r.width,0|r.height,e,i);return Gr.tx=-r.x,Gr.ty=-r.y,this.render(t,n,!1,Gr,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},i.backgroundColor.get=function(){return this._backgroundColor},i.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Lt(t),Ft(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,i),e}(y),Yr=function(t){function e(i){void 0===i&&(i={}),t.call(this,"WebGL",i),i=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new Ge("destroy"),contextChange:new Ge("contextChange",1),reset:new Ge("reset"),update:new Ge("update"),postrender:new Ge("postrender"),prerender:new Ge("prerender"),resize:new Ge("resize",2)},this.globalUniforms=new Ri({projectionMatrix:new ge},!0),this.addSystem(wr,"mask").addSystem(ki,"context").addSystem(Ur,"state").addSystem(Mr,"shader").addSystem(Xr,"texture").addSystem(Hi,"geometry").addSystem(Xi,"framebuffer").addSystem(Sr,"stencil").addSystem(Pr,"projection").addSystem(Br,"textureGC").addSystem(Li,"filter").addSystem(Ar,"renderTexture").addSystem(Ui,"batch"),this.initPlugins(e.__plugins),i.context?this.context.initFromContext(i.context):this.context.initFromOptions({alpha:this.transparent,antialias:i.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=i,this.runners)this.runners[r].add(i);return this},e.prototype.render=function(t,e,i,r,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=r,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.run(e,i)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(Hr);function zr(t){return Yr.create(t)}var Vr="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",Wr="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,i){return new e(new ai(t,i))},e}(ni),Zr=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new Ei(null,e,!1),this._indexBuffer=new Ei(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oi),Kr=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Jr=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Jr.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var Qr="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",$r=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),tn={},en={};function rn(t,e){if(!en[e]){for(var i=new Int32Array(e),r=0;r0&&(e+="\nelse "),ithis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=Wt(Math.ceil(t/12)),i=Zt(e),r=12*e;this.iBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.iBuffers[i];return n||(this.iBuffers[i]=n=new Uint16Array(r)),n},e.prototype.getAttributeBuffer=function(t){var e=Wt(Math.ceil(t/8)),i=Zt(e),r=8*e;this.aBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.aBuffers[r];return n||(this.aBuffers[r]=n=new Jr(r*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,i=this.renderer.gl,r=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++ni._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,i,r,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(r=!1),s=!0)}}return n&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),i&&i(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=e.length,r=0;rthis.maxSegments&&(i=this.maxSegments),i}},_n=function(){this.reset()};_n.prototype.clone=function(){var t=new _n;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},_n.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=yi.WHITE,this.matrix=null,this.visible=!1},_n.prototype.destroy=function(){this.texture=null,this.matrix=null};var xn=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]};xn.prototype.clone=function(){return new xn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},xn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var bn={build:function(t){var e,i,r=t.shape,n=t.points,o=r.x,s=r.y;if(n.length=0,t.type===ve.CIRC?(e=r.radius,i=r.radius):(e=r.width,i=r.height),0!==e&&0!==i){var a=Math.floor(30*Math.sqrt(r.radius))||Math.floor(15*Math.sqrt(r.width+r.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=r[2*(d-2)],m=r[2*(d-2)+1],y=r[2*(d-1)],_=r[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(r=In.pop()||new Cn,this.batches.push(r)),r.style=d,r.start=f,r.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),En.triangulate(a,this)):h.triangulate(a,this);else{Tn(a,this);for(var m=0;m0&&(o=An.pop()||new Kr,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(r,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}ni._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,i=sr?s+h:r;else if(c===ve.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,i=s-(h=n.radius+d/2)r?s+h:r;else if(c===ve.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,i=s-(h=n.height+d/2)r?s+h:r;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,i=(b=(v+s)/2)-(_=(h/a*g+m)/2)r?b+_:r)}else t=0,e=0,i=0,r=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=i-E,this._bounds.maxY=r+E},e.prototype.transformPoints=function(t,e){for(var i=0;i>16)+(65280&e)+((255&e)<<16),i);r-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,i,r,n,o){for(var s=0,a=e.length,h=i.frame;sl*a}},Ln.arc=function(t,e,i,r,n,o,s,a,h){for(var u=s-o,l=yn._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/de)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+i,(p*-x+f*_)*n+r)}};var Nn=function(t){function e(e,i,r,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*r,u=de/h,l=[],c=0;c0&&r>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:i,width:t,alpha:r,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Re,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Re,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,i,r,n),this},e.prototype.bezierCurveTo=function(t,e,i,r,n,o){return this._initCurve(),Rn.curveTo(t,e,i,r,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var o=this.currentPath.points,s=Ln.curveTo(t,e,i,r,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,i,r,n,o){if(void 0===o&&(o=!1),r===n)return this;if(!o&&n<=r?n+=de:o&&r<=n&&(r+=de),0===n-r)return this;var s=t+Math.cos(r)*i,a=e+Math.sin(r)*i,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Ln.arc(s,a,t,e,i,r,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(yi.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,i,r){void 0===t&&(t=yi.WHITE),void 0===e&&(e=16777215),void 0===i&&(i=1),void 0===r&&(r=null),this.currentPath&&this.startPoly();var n=i>0;return n?(r&&(r=r.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:i,texture:t,matrix:r,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,r){return this.drawShape(new Ae(t,e,i,r))},e.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new Fe(t,e,i,r,n))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new Me(t,e,i))},e.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new De(t,e,i,r))},e.prototype.drawPolygon=function(t){var e=arguments,i=t,r=!0;if(i.points&&(r=i.closeStroke,i=i.points),!Array.isArray(i)){i=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,i=t.b,r=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=r&&Xn.x=n&&Xn.y>16)+(65280&t)+((255&t)<<16)},i.texture.get=function(){return this._texture},i.texture.set=function(t){this._texture!==t&&(this._texture=t||yi.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,i),e}(Be),Hn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},Yn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Hn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},zn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Vn=function(t){this.styleID=0,this.reset(),Kn(this,t,t)},Wn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function qn(t){return"number"==typeof t?Lt(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Zn(t){if(Array.isArray(t)){for(var e=0;e=0;i--){var r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&zn.indexOf(r)<0&&(r='"'+r+'"'),e[i]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Vn.prototype,Wn);var Jn=function(t,e,i,r,n,o,s,a,h){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Jn.measureText=function(t,e,i,r){void 0===r&&(r=Jn._canvas),i=null==i?e.wordWrap:i;var n=e.toFontString(),o=Jn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=r.getContext("2d");s.font=n;for(var a=(i?Jn.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Jn.addLine(o),o="",n=0),Jn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Jn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Jn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Jn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Jn.addLine(o),o="",n=0),(o.length>0||!Jn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Jn.addLine(o,!1)},Jn.addLine=function(t,e){return void 0===e&&(e=!0),t=Jn.trimRight(t),t=e?t+"\n":t},Jn.getFromCache=function(t,e,i,r){var n=i[t];if(void 0===n){var o=t.length*e;n=r.measureText(t).width+o,i[t]=n}return n},Jn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Jn.collapseNewlines=function(t){return"normal"===t},Jn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var i=t[e];if(!Jn.isBreakingSpace(i))break;t=t.slice(0,-1)}return t},Jn.isNewline=function(t){return"string"==typeof t&&Jn._newlines.indexOf(t.charCodeAt(0))>=0},Jn.isBreakingSpace=function(t){return"string"==typeof t&&Jn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Jn.tokenize=function(t){var e=[],i="";if("string"!=typeof t)return e;for(var r=0;rs;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new eo(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(ho),this.registerFindHook(uo),this.registerFindHook(ro),this.registerFindHook(no),this.registerFindHook(oo),this.registerUploadHook(so),this.registerUploadHook(ao)};function ro(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var r=0;r=0;r--)this.add(t.children[r]);return this},io.prototype.destroy=function(){this.ticking&&Ve.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var lo=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(fo),this.registerUploadHook(co),this.registerUploadHook(po)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function co(t,e){return e instanceof ni&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function po(t,e){return e instanceof kn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function fo(t,e){return t instanceof kn&&(e.push(t),!0)}var vo=function(t){this.maxMilliseconds=t,this.frameStart=0};vo.prototype.beginFrame=function(){this.frameStart=Date.now()},vo.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),wo=(i(Eo),Eo.Resource,r(function(t,e){e.__esModule=!0,e.Loader=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=i,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,i){return e._loadResource(t,i)},this._queue=s.queue(this._boundLoadResource,r),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Do(No);No.Resource;var Uo=Ro(function(t,e){e.__esModule=!0,e.encodeBinary=r;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(t){for(var e="",r=0;r>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(r=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=r,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(i),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t,Ft(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(o=i);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(Bt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=kt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;cr&&(p=r),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=r&&Qo.x=n&&Qo.y0&&r.x>h&&(Ht(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,r.x=0,r.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,r.x=0,r.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},i.align.get=function(){return this._font.align},i.align.set=function(t){this._font.align=t||"left",this.dirty=!0},i.anchor.get=function(){return this._anchor},i.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},i.font.get=function(){return this._font},i.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},i.text.get=function(){return this._text},i.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},i.maxWidth.get=function(){return this._maxWidth},i.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},i.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},i.textWidth.get=function(){return this.validate(),this._textWidth},i.letterSpacing.get=function(){return this._letterSpacing},i.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},i.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,i){var r={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=oe(s[0].getAttribute("file"),m.RESOLUTION),h={};r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,r.chars={},i instanceof yi&&(i=[i]);for(var u=0;u=r&&(e=t-s-1),o+=a=a.replace("%value%",i[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=r||4,this.blur=i||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,i,r);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",vs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,Wr,fs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),r=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[i+(1-i)*n,n*(1-i)-o*r,n*(1-i)+o*r,0,0,n*(1-i)+o*r,i+n*(1-i),n*(1-i)-o*r,0,0,n*(1-i)-o*r,n*(1-i)+o*r,i+n*(1-i),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,r=-.5*(i-1),n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,i,r,n){var o=((i=i||16770432)>>16&255)/255,s=(i>>8&255)/255,a=(255&i)/255,h=((r=r||3375104)>>16&255)/255,u=(r>>8&255)/255,l=(255&r)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},i.matrix.get=function(){return this.uniforms.m},i.matrix.set=function(t){this.uniforms.m=t},i.alpha.get=function(){return this.uniforms.uAlpha},i.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,i),e}(mr);vs.prototype.grayscale=vs.prototype.greyscale;var gs="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ms="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",ys=function(t){function e(e,i){var r=new ge;e.renderable=!1,t.call(this,gs,ms,{mapSampler:e._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=r,null==i&&(i=20),this.scale=new ue(i,i)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={map:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,i,r)},i.map.get=function(){return this.uniforms.mapSampler},i.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,i),e}(mr),_s="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",xs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',bs=function(t){function e(){t.call(this,_s,xs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(mr),Ts="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",Es=function(t){function e(e,i){void 0===e&&(e=.5),void 0===i&&(i=Math.random()),t.call(this,Wr,Ts,{uNoise:0,uSeed:0}),this.noise=e,this.seed=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={noise:{configurable:!0},seed:{configurable:!0}};return i.noise.get=function(){return this.uniforms.uNoise},i.noise.set=function(t){this.uniforms.uNoise=t},i.seed.get=function(){return this.uniforms.uSeed},i.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,i),e}(mr),ws=new ge;Ne.prototype._cacheAsBitmap=!1,Ne.prototype._cacheData=!1;var Ss=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ne.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ss),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ne.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ne.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds().clone();if(this.filters){var r=this.filters[0].padding;i.pad(r)}i.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=xi.create(i.width,i.height),s="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=s,ni.addToCache(o.baseTexture,s),yi.addToCache(o,s);var a=ws;a.tx=-i.x,a.ty=-i.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Gn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-i.x/i.width,h.anchor.y=-i.y/i.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ne.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ne.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),i=this.alpha;this.alpha=1;var r=t.context;e.ceil(m.RESOLUTION);var n=xi.create(e.width,e.height),o="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=o,ni.addToCache(n.baseTexture,o),yi.addToCache(n,o);var s=ws;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Gn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=i,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ne.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ne.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ne.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ni.removeFromCache(this._cacheData.textureCacheId),yi.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ne.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ne.prototype.name=null,Be.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},i.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;jt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,i),e}(pr),Fs=function(t){function e(e,i,r){t.call(this);var n=new Ei(e),o=new Ei(i,!0),s=new Ei(r,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertexDirtyId:{configurable:!0}};return i.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,i),e}(Oi),Ls=function(t){function e(e,i,r,n){void 0===e&&(e=100),void 0===i&&(i=100),void 0===r&&(r=10),void 0===n&&(n=10),t.call(this),this.segWidth=r,this.segHeight=n,this.width=e,this.height=i,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],r=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,i=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width},i.width.get=function(){return this._width},i.width.set=function(t){this._width=t,this._refresh()},i.height.get=function(){return this._height},i.height.set=function(t){this._height=t,this._refresh()},i.leftWidth.get=function(){return this._leftWidth},i.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},i.rightWidth.get=function(){return this._rightWidth},i.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},i.topHeight.get=function(){return this._topHeight},i.topHeight.set=function(t){this._topHeight=t,this._refresh()},i.bottomHeight.get=function(){return this._bottomHeight},i.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,i),e}(Bs),Gs=function(t){function e(e,i){t.call(this,e[0]instanceof yi?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==i,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&Ve.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&Ve.shared.add(this.update,this,Ye.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramei&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],r=0;r0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+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 s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==F(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,r,i)),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,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(F(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&F(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(F(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&L(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&R(or.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function L(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)}function F(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||F(t,e,r)>0!=F(t,e,i)>0&&F(r,i,t)>0!=F(r,i,e)>0}function B(t,e){return F(t.prev,t,t.next)<0?F(t,e,t.next)>=0&&F(t,t.prev,e)>=0:F(t,e,t.prev)<0||F(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function X(t,e,r,i){var n=new G(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Ot}function Lt(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function Ut(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Bt=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function kt(t,e){return Bt[e?1:0][t]}function Xt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function jt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Gt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Kt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Jt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Ie.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Ie.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Fe=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=gf?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Ne.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Yt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort(Be),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=Vt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Zt(this.realWidth)&&Zt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $t[this.cacheId],delete Qt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+Vt()),i=t._pixiId);var n=$t[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$t[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Ft(t),Lt(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Lr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i0&&(e+="\nelse "),rthis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=qt(Math.ceil(t/12)),r=Kt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=qt(Math.ceil(t/8)),r=Kt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;ithis.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,r=si?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,r=s-(h=n.radius+d/2)i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,r=s-(h=n.height+d/2)i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;sl*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Le,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Le,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Ln.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Fe(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Lo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Lt(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(kt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Xt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=i&&$o.x=n&&$o.y0&&i.x>h&&(Yt(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ys="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",bs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ue.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ue.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Gt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Fs=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(Bs),Gs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;iw?w:E,e.moveTo(_,x+E),e.lineTo(_,x+T-E),e.quadraticCurveTo(_,x+T,_+E,x+T),e.lineTo(_+b-E,x+T),e.quadraticCurveTo(_+b,x+T,_+b,x+T-E),e.lineTo(_+b,x+E),e.quadraticCurveTo(_+b,x,_+b-E,x),e.lineTo(_+E,x),e.quadraticCurveTo(_,x,_,x+E),e.closePath()}}}},zs.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},zs.prototype.destroy=function(){};var qs=function(t){function e(r,i,n){var o;t.call(this,"Canvas",r,i,n),this.type=yt.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new zs(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),Ws()?(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="multiply",o[_t.SCREEN]="screen",o[_t.OVERLAY]="overlay",o[_t.DARKEN]="darken",o[_t.LIGHTEN]="lighten",o[_t.COLOR_DODGE]="color-dodge",o[_t.COLOR_BURN]="color-burn",o[_t.HARD_LIGHT]="hard-light",o[_t.SOFT_LIGHT]="soft-light",o[_t.DIFFERENCE]="difference",o[_t.EXCLUSION]="exclusion",o[_t.HUE]="hue",o[_t.SATURATION]="saturate",o[_t.COLOR]="color",o[_t.LUMINOSITY]="luminosity"):(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="source-over",o[_t.SCREEN]="source-over",o[_t.OVERLAY]="source-over",o[_t.DARKEN]="source-over",o[_t.LIGHTEN]="source-over",o[_t.COLOR_DODGE]="source-over",o[_t.COLOR_BURN]="source-over",o[_t.HARD_LIGHT]="source-over",o[_t.SOFT_LIGHT]="source-over",o[_t.DIFFERENCE]="source-over",o[_t.EXCLUSION]="source-over",o[_t.HUE]="source-over",o[_t.SATURATION]="source-over",o[_t.COLOR]="source-over",o[_t.LUMINOSITY]="source-over"),o[_t.NORMAL_NPM]=o[_t.NORMAL],o[_t.ADD_NPM]=o[_t.ADD],o[_t.SCREEN_NPM]=o[_t.SCREEN],o[_t.SRC_IN]="source-in",o[_t.SRC_OUT]="source-out",o[_t.SRC_ATOP]="source-atop",o[_t.DST_OVER]="destination-over",o[_t.DST_IN]="destination-in",o[_t.DST_OUT]="destination-out",o[_t.DST_ATOP]="destination-atop",o[_t.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,Dt("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ee(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=_t.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[_t.NORMAL],(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===_t.SRC_IN||t===_t.SRC_OUT||t===_t.DST_IN||t===_t.DST_ATOP;!e&&r&&(t=_t.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===wt.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi),Zs={getTintedCanvas:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=Zs.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=Zs.canvas||document.createElement("canvas");if(Zs.tintMethod(r,e,n),n.tintId=r._updateID,Zs.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,Zs.canvas=null;return n},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=Lt(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=w/Math.abs(t.worldTransform.a),P=w/Math.abs(t.worldTransform.d),I=(y+_+x)/3,A=(b+T+E)/3,O=y-I,C=b-A,M=Math.sqrt(O*O+C*C);y=I+O/M*(M+S),b=A+C/M*(M+P),C=T-A,_=I+(O=_-I)/(M=Math.sqrt(O*O+C*C))*(M+S),T=A+C/M*(M+P),C=E-A,x=I+(O=x-I)/(M=Math.sqrt(O*O+C*C))*(M+S),E=A+C/M*(M+P)}n.save(),n.beginPath(),n.moveTo(y,b),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=d*g+v*f+p*m-g*f-v*p-d*m,R=y*g+v*x+_*m-g*x-v*_-y*m,L=d*_+y*f+p*x-_*f-y*p-d*x,F=d*g*x+v*_*f+y*p*m-y*g*f-v*p*x-d*_*m,N=b*g+v*E+T*m-g*E-v*T-b*m,U=d*T+b*f+p*E-T*f-b*p-d*E,B=d*g*E+v*T*f+b*p*m-b*g*f-v*p*E-d*T*m;n.transform(R/D,N/D,L/D,U/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Js.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0){g=0,y=f[0],_=f[1];for(var b=2;b+2=0;S-=2)r.lineTo(f[S],f[S+1])}v[T].shape.closeStroke&&r.closePath()}}l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RECT)l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===ge.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke());else if(h.type===ge.ELIP){var P=2*u.width,I=2*u.height,A=u.x-P/2,O=u.y-I/2;r.beginPath();var C=P/2*.5522848,M=I/2*.5522848,D=A+P,R=O+I,L=A+P/2,F=O+I/2;r.moveTo(A,F),r.bezierCurveTo(A,F-M,L-C,O,L,O),r.bezierCurveTo(L+C,O,D,F-M,D,F),r.bezierCurveTo(D,F+M,L+C,R,L,R),r.bezierCurveTo(L-C,R,A,F+M,A,F),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RREC){var N=u.x,U=u.y,B=u.width,k=u.height,X=u.radius,j=Math.min(B,k)/2|0;X=X>j?j:X,r.beginPath(),r.moveTo(N,U+X),r.lineTo(N,U+k-X),r.quadraticCurveTo(N,U+k,N+X,U+k),r.lineTo(N+B-X,U+k),r.quadraticCurveTo(N+B,U+k,N+B,U+k-X),r.lineTo(N+B,U+X),r.quadraticCurveTo(N+B,U,N+B-X,U),r.lineTo(N+X,U),r.quadraticCurveTo(N,U,N,U+X),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}}},$s.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},$s.prototype.destroy=function(){this.renderer=null};var ta=new me;Xn.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=br.create(r.width,r.height,t,e);Qs||(Qs=new qs),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(ta),ta.invert(),ta.tx-=r.x,ta.ty-=r.y,Qs.render(this,i,!0,ta);var n=_r.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},Xn.prototype.cachedGraphicsData=[],Xn.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var ea=new me,ra=function(t){this.renderer=t};ra.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===wt.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(ea),s=ea,Pe.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution|0,s.ty*r.resolution|0),a|=0,h|=0):r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution,s.ty*r.resolution);var c=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Zs.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution)):i.drawImage(u,e._frame.x*c,e._frame.y*c,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),d&&i.restore(),r.setBlendMode(_t.NORMAL)}},ra.prototype.destroy=function(){this.renderer=null},Hn.prototype._tintedCanvas=null,Hn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var ia=new Oe,na=function(t){this.renderer=t,t.extract=this};na.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},na.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},na.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=ia).width=this.renderer.width,i.height=this.renderer.height);var s=i.width*r,a=i.height*r,h=new ee(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},na.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=ia).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},na.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var oa={CanvasExtract:na},sa=16,aa=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=sa,this.canvas.height=sa,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ha)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(io);function ha(t,e){if(e instanceof or){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}var ua={CanvasPrepare:aa};ts.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ee(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Zs.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,u),r.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(h+c,u+d),r.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},zo.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+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 s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==F(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,r,i)),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,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(F(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&F(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(F(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&L(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&R(or.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function L(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)}function F(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||F(t,e,r)>0!=F(t,e,i)>0&&F(r,i,t)>0!=F(r,i,e)>0}function B(t,e){return F(t.prev,t,t.next)<0?F(t,e,t.next)>=0&&F(t,t.prev,e)>=0:F(t,e,t.prev)<0||F(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function X(t,e,r,i){var n=new G(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Ot}function Lt(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function Ut(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Bt=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function kt(t,e){return Bt[e?1:0][t]}function Xt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function jt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Gt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Kt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Jt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Ie.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Ie.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Fe=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=gf?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Ne.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Yt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort(Be),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=Vt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Zt(this.realWidth)&&Zt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $t[this.cacheId],delete Qt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+Vt()),i=t._pixiId);var n=$t[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$t[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Ft(t),Lt(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Lr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i0&&(e+="\nelse "),rthis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=qt(Math.ceil(t/12)),r=Kt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=qt(Math.ceil(t/8)),r=Kt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;ithis.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,r=si?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,r=s-(h=n.radius+d/2)i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,r=s-(h=n.height+d/2)i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;sl*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Le,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Le,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Ln.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Fe(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Lo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Lt(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(kt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Xt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=i&&$o.x=n&&$o.y0&&i.x>h&&(Yt(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ys="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",bs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ue.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ue.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Gt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Fs=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(Bs),Gs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;iw?w:E,e.moveTo(_,x+E),e.lineTo(_,x+T-E),e.quadraticCurveTo(_,x+T,_+E,x+T),e.lineTo(_+b-E,x+T),e.quadraticCurveTo(_+b,x+T,_+b,x+T-E),e.lineTo(_+b,x+E),e.quadraticCurveTo(_+b,x,_+b-E,x),e.lineTo(_+E,x),e.quadraticCurveTo(_,x,_,x+E),e.closePath()}}}},zs.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},zs.prototype.destroy=function(){};var qs=function(t){function e(r,i,n){var o;t.call(this,"Canvas",r,i,n),this.type=yt.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new zs(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),Ws()?(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="multiply",o[_t.SCREEN]="screen",o[_t.OVERLAY]="overlay",o[_t.DARKEN]="darken",o[_t.LIGHTEN]="lighten",o[_t.COLOR_DODGE]="color-dodge",o[_t.COLOR_BURN]="color-burn",o[_t.HARD_LIGHT]="hard-light",o[_t.SOFT_LIGHT]="soft-light",o[_t.DIFFERENCE]="difference",o[_t.EXCLUSION]="exclusion",o[_t.HUE]="hue",o[_t.SATURATION]="saturate",o[_t.COLOR]="color",o[_t.LUMINOSITY]="luminosity"):(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="source-over",o[_t.SCREEN]="source-over",o[_t.OVERLAY]="source-over",o[_t.DARKEN]="source-over",o[_t.LIGHTEN]="source-over",o[_t.COLOR_DODGE]="source-over",o[_t.COLOR_BURN]="source-over",o[_t.HARD_LIGHT]="source-over",o[_t.SOFT_LIGHT]="source-over",o[_t.DIFFERENCE]="source-over",o[_t.EXCLUSION]="source-over",o[_t.HUE]="source-over",o[_t.SATURATION]="source-over",o[_t.COLOR]="source-over",o[_t.LUMINOSITY]="source-over"),o[_t.NORMAL_NPM]=o[_t.NORMAL],o[_t.ADD_NPM]=o[_t.ADD],o[_t.SCREEN_NPM]=o[_t.SCREEN],o[_t.SRC_IN]="source-in",o[_t.SRC_OUT]="source-out",o[_t.SRC_ATOP]="source-atop",o[_t.DST_OVER]="destination-over",o[_t.DST_IN]="destination-in",o[_t.DST_OUT]="destination-out",o[_t.DST_ATOP]="destination-atop",o[_t.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,Dt("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ee(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=_t.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[_t.NORMAL],(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===_t.SRC_IN||t===_t.SRC_OUT||t===_t.DST_IN||t===_t.DST_ATOP;!e&&r&&(t=_t.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===wt.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi),Zs={getTintedCanvas:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=Zs.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=Zs.canvas||document.createElement("canvas");if(Zs.tintMethod(r,e,n),n.tintId=r._updateID,Zs.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,Zs.canvas=null;return n},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=Lt(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=w/Math.abs(t.worldTransform.a),P=w/Math.abs(t.worldTransform.d),I=(y+_+x)/3,A=(b+T+E)/3,O=y-I,C=b-A,M=Math.sqrt(O*O+C*C);y=I+O/M*(M+S),b=A+C/M*(M+P),C=T-A,_=I+(O=_-I)/(M=Math.sqrt(O*O+C*C))*(M+S),T=A+C/M*(M+P),C=E-A,x=I+(O=x-I)/(M=Math.sqrt(O*O+C*C))*(M+S),E=A+C/M*(M+P)}n.save(),n.beginPath(),n.moveTo(y,b),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=d*g+v*f+p*m-g*f-v*p-d*m,R=y*g+v*x+_*m-g*x-v*_-y*m,L=d*_+y*f+p*x-_*f-y*p-d*x,F=d*g*x+v*_*f+y*p*m-y*g*f-v*p*x-d*_*m,N=b*g+v*E+T*m-g*E-v*T-b*m,U=d*T+b*f+p*E-T*f-b*p-d*E,B=d*g*E+v*T*f+b*p*m-b*g*f-v*p*E-d*T*m;n.transform(R/D,N/D,L/D,U/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Js.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0){g=0,y=f[0],_=f[1];for(var b=2;b+2=0;S-=2)r.lineTo(f[S],f[S+1])}v[T].shape.closeStroke&&r.closePath()}}l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RECT)l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===ge.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke());else if(h.type===ge.ELIP){var P=2*u.width,I=2*u.height,A=u.x-P/2,O=u.y-I/2;r.beginPath();var C=P/2*.5522848,M=I/2*.5522848,D=A+P,R=O+I,L=A+P/2,F=O+I/2;r.moveTo(A,F),r.bezierCurveTo(A,F-M,L-C,O,L,O),r.bezierCurveTo(L+C,O,D,F-M,D,F),r.bezierCurveTo(D,F+M,L+C,R,L,R),r.bezierCurveTo(L-C,R,A,F+M,A,F),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RREC){var N=u.x,U=u.y,B=u.width,k=u.height,X=u.radius,j=Math.min(B,k)/2|0;X=X>j?j:X,r.beginPath(),r.moveTo(N,U+X),r.lineTo(N,U+k-X),r.quadraticCurveTo(N,U+k,N+X,U+k),r.lineTo(N+B-X,U+k),r.quadraticCurveTo(N+B,U+k,N+B,U+k-X),r.lineTo(N+B,U+X),r.quadraticCurveTo(N+B,U,N+B-X,U),r.lineTo(N+X,U),r.quadraticCurveTo(N,U,N,U+X),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}}},$s.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},$s.prototype.destroy=function(){this.renderer=null};var ta=new me;Xn.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=br.create(r.width,r.height,t,e);Qs||(Qs=new qs),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(ta),ta.invert(),ta.tx-=r.x,ta.ty-=r.y,Qs.render(this,i,!0,ta);var n=_r.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},Xn.prototype.cachedGraphicsData=[],Xn.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var ea=new me,ra=function(t){this.renderer=t};ra.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===wt.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(ea),s=ea,Pe.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution|0,s.ty*r.resolution|0),a|=0,h|=0):r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution,s.ty*r.resolution);var c=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Zs.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution)):i.drawImage(u,e._frame.x*c,e._frame.y*c,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),d&&i.restore(),r.setBlendMode(_t.NORMAL)}},ra.prototype.destroy=function(){this.renderer=null},Hn.prototype._tintedCanvas=null,Hn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var ia=new Oe,na=function(t){this.renderer=t,t.extract=this};na.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},na.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},na.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=ia).width=this.renderer.width,i.height=this.renderer.height);var s=i.width*r,a=i.height*r,h=new ee(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},na.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=ia).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},na.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var oa={CanvasExtract:na},sa=16,aa=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=sa,this.canvas.height=sa,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ha)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(io);function ha(t,e){if(e instanceof or){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}var ua={CanvasPrepare:aa};ts.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ee(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Zs.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,u),r.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(h+c,u+d),r.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},zo.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=r(function(t){!function(e){var i=/iPhone/i,r=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(i,e)&&!g(u,e),ipod:g(r,e),tablet:!g(i,e)&&g(n,e)&&!g(u,e),device:(g(i,e)||g(r,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var i=navigator.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)>=11&&(e=!0)}if(g.android.device){var r=navigator.userAgent.match(/Android\s([0-9.]*)/);r&&parseInt(r[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=r(function(t){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new n(r,o||t,s),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 s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,r,n=[];if(0===this._eventsCount)return n;for(r in t=this._events)e.call(t,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,s=new Array(o);n80*i){r=o=t[0],n=s=t[1];for(var f=i;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-r,s-n))?1/u:0}return w(d,p,i,r,n,u),p}function T(t,e,i,r,n){var o,s;if(n===H(t,e,i,r)>0)for(o=e;o=e;o-=r)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!N(r,r.next)&&0!==L(r.prev,r,r.next))r=r.next;else{if(j(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function w(t,e,i,r,n,o,s){if(t){!s&&o&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,i,r)),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,r,n,o,s,a,h,u=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,r=i,a=0,e=0;e0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(s>1)}(n)}(t,r,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,r,n,o):S(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,i),e,i,r,n,o,2):2===s&&A(t,e,i,r,n,o):w(E(t),e,i,r,n,o,1);break}}}function S(t){var e=t.prev,i=t,r=t.next;if(L(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&L(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,i,r){var n=t.prev,o=t,s=t.next;if(L(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,i,r),d=M(u,l,e,i,r),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!N(n,o)&&U(n,r,r.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),j(r),j(r.next),r=t=o),r=r.next}while(r!==t);return r}function A(t,e,i,r,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&F(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,i,r,n,o),void w(h,e,i,r,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var i,r=e,n=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>s){if(s=a,a===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x=r.x&&r.x>=l&&n!==r.x&&R(oi.x)&&B(r,t)&&(i=r,d=h),r=r.next;return i}(t,e)){var i=k(e,t);E(i,i.next)}}function M(t,e,i,r,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-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,i=t;do{(e.x=0&&(t-s)*(r-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(n-s)*(r-a)>=0}function F(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&&U(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)}function L(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,i,r){return!!(N(t,e)&&N(i,r)||N(t,r)&&N(i,e))||L(t,e,i)>0!=L(t,e,r)>0&&L(i,r,t)>0!=L(i,r,e)>0}function B(t,e){return L(t.prev,t,t.next)<0?L(t,e,t.next)>=0&&L(t,t.prev,e)>=0:L(t,e,t.prev)<0||L(t,t.next,e)<0}function k(t,e){var i=new G(t.i,t.x,t.y),r=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function X(t,e,i,r){var n=new G(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function j(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 G(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 H(t,e,i,r){for(var n=0,o=e,s=i-r;o0&&(r+=t[n-1].length,i.holes.push(r))}return i},_.default=x;var Y=r(function(t,i){!function(r){var n=i&&!i.nodeType&&i,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(r=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function I(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,i,r=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,i){var r=0;for(t=i?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;r+=l)t=E(t/T);return E(r+(T+1)*t/(t+p))}function D(t){var e,i,r,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((i=t.lastIndexOf(m))<0&&(i=0),r=0;r=128&&S("not-basic"),_.push(t.charCodeAt(r));for(n=i>0?i+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,i,r,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,i=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(r=n=P.length,n&&P.push(m);r<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-i)/(x=r+1))&&S("overflow"),i+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=i,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(i,x,r==n),i=0,++r}++i,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else r.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,i,r){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,i,r){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(r){var n=encodeURIComponent(q(r))+i;return Array.isArray(t[r])?t[r].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[r]))}).join(e):r?encodeURIComponent(q(r))+i+encodeURIComponent(q(t)):""},K=r(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof it))return it.prototype.format.call(t);return t.format()},et=it;function it(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var rt=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,i){if(t&&z.isObject(t)&&t instanceof it)return t;var r=new it;return r.parse(t,e,i),r}it.prototype.parse=function(t,e,i){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),n=-1!==r&&r127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift());return i.search=t.search,i.query=t.query,z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!_.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var b=_.slice(-1)[0],T=(i.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(i.hostname=i.host=P?"":_.length?_.shift():"",(S=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift()));return(m=m||i.host&&_.length)&&!P&&_.unshift(""),_.length?i.pathname=_.join("/"):(i.pathname=null,i.path=null),z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},it.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch(t){return!1}}()),Ot}function Ft(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Lt(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}var Ut=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}();function Bt(t,e){return Ut[e?1:0][t]}function kt(t,e,i,r){return i=i||new Float32Array(4),r||void 0===r?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function Xt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,r=t>>8&255,n=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(n=n*e+.5|0)}function jt(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(r||void 0===r)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function Gt(t){for(var e=6*t,i=new Uint16Array(e),r=0,n=0;r=n||0===i)){var o=n-(i=e+i>n?n-e:i);for(r=e;r>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function qt(t){return!(t&t-1||!t)}function Zt(t){var e=(t>65535)<<4,i=((t>>>=e)>255)<<3;return e|=i,e|=i=((t>>>=i)>15)<<2,(e|=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1}var Kt={},Jt=Object.create(null),Qt=Object.create(null);function $t(t){var e,i,r,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];Ee.push(e);for(var i=0;i<16;i++)for(var r=we(ye[t]*ye[i]+xe[t]*_e[i]),n=we(_e[t]*ye[i]+be[t]*_e[i]),o=we(ye[t]*xe[i]+xe[t]*be[i]),s=we(_e[t]*xe[i]+be[t]*be[i]),a=0;a<16;a++)if(ye[a]===r&&_e[a]===n&&xe[a]===o&&be[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new ge;u.set(ye[h],_e[h],xe[h],be[h],0,0),Te.push(u)}}();var Se={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return ye[t]},uY:function(t){return _e[t]},vX:function(t){return xe[t]},vY:function(t){return be[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return Ee[t][e]},sub:function(t,e){return Ee[t][Se.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Se.S:Se.N:2*Math.abs(e)<=Math.abs(t)?t>0?Se.E:Se.W:e>0?t>0?Se.SE:Se.SW:t>0?Se.NE:Se.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=Te[Se.inv(e)];n.tx=i,n.ty=r,t.append(n)}},Pe=function(){this.worldTransform=new ge,this.localTransform=new ge,this.position=new le(this.onChange,this,0,0),this.scale=new le(this.onChange,this,1,1),this.pivot=new le(this.onChange,this,0,0),this.skew=new le(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ie={rotation:{configurable:!0}};Pe.prototype.onChange=function(){this._localID++},Pe.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Pe.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Pe.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},Pe.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ie.rotation.get=function(){return this._rotation},Ie.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Pe.prototype,Ie),Pe.IDENTITY=new Pe;var Ae=function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=ve.RECT},Oe={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Ce={EMPTY:{configurable:!0}};Oe.left.get=function(){return this.x},Oe.right.get=function(){return this.x+this.width},Oe.top.get=function(){return this.y},Oe.bottom.get=function(){return this.y+this.height},Ce.EMPTY.get=function(){return new Ae(0,0,0,0)},Ae.prototype.clone=function(){return new Ae(this.x,this.y,this.width,this.height)},Ae.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Ae.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Ae.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(i=!i)}return i};var Fe=function(t,e,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=ve.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var i=t-(this.x+this.radius),r=e-(this.y+this.radius),n=this.radius*this.radius;if(i*i+r*r<=n)return!0;if((i=t-(this.x+this.width-this.radius))*i+r*r<=n)return!0;if(i*i+(r=e-(this.y+this.height-this.radius))*r<=n)return!0;if((i=t-(this.x+this.radius))*i+r*r<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Le=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Le.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Le.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Le.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ae.EMPTY:((t=t||new Ae(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Le.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Le.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,o=t[0],s=t[1];e=or?o:r,n=s>n?s:n,e=(o=t[2])r?o:r,n=s>n?s:n,e=(o=t[4])r?o:r,n=s>n?s:n,e=(o=t[6])r?o:r,n=s>n?s:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},Le.prototype.addFrame=function(t,e,i,r,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*i+l,m=a*e+u*i+c;d=gf?g:f,v=m>v?m:v,d=(g=s*r+h*i+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*r+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Le.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=r,this.minY=n,this.maxX=o,this.maxY=s},Le.prototype.addVertices=function(t,e,i,r){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=i;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Le.prototype.addBounds=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minXr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},Le.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Le.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ne=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Pe,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Le,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var i=Object.keys(t),r=0;r1)for(var r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);Ht(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,i=arguments.length;if(i>1)for(var r=0;r0&&o<=n){i=this.children.splice(r,o);for(var s=0;s1&&this.children.sort(Ue),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},Xe.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},Xe.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},Xe.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},Xe.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},Xe.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},Xe.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},Xe.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},Ve.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Ve.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},Ve.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},Ve.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},Ve.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),i=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/i}},qe.shared.get=function(){if(!Ve._shared){var t=Ve._shared=new Ve;t.autoStart=!0,t._protected=!0}return Ve._shared},qe.system.get=function(){if(!Ve._system){var t=Ve._system=new Ve;t.autoStart=!0,t._protected=!0}return Ve._system},Object.defineProperties(Ve.prototype,We),Object.defineProperties(Ve,qe);var Ze=function(){};Ze.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ye.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Ve.shared:new Ve,t.autoStart&&this.start()},Ze.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Ke=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Ge("setRealSize",2),this.onUpdate=new Ge("update")},Je={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Ke.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Ke.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Ke.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Je.valid.get=function(){return!!this._width&&!!this._height},Ke.prototype.update=function(){this.destroyed||this.onUpdate.run()},Ke.prototype.load=function(){return Promise.resolve()},Je.width.get=function(){return this._width},Je.height.get=function(){return this._height},Ke.prototype.upload=function(t,e,i){return!1},Ke.prototype.style=function(t,e,i){return!1},Ke.prototype.dispose=function(){},Ke.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Ke.prototype,Je);var Qe=function(t){function e(e){var i=e.naturalWidth||e.videoWidth||e.width,r=e.naturalHeight||e.videoHeight||e.height;t.call(this,i,r),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=ne(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,r){var n=t.gl,o=e.realWidth,s=e.realHeight;return r=r||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&i.width===o&&i.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,r):(i.width=o,i.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,r)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,i=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Ke),$e=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLImageElement)){var r=new Image;t.crossOrigin(r,e,i.crossorigin),r.src=e,e=r}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==i.createBitmap?i.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==i.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==i.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var i=e.source,r=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?r():i.onload=r}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,i,r){if(i.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,i,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,r,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in i._glTextures){var s=i._glTextures[o];if(s!==r&&s.dirtyId!==i.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}(Qe),ti=[];function ei(t,e){if(!t)return null;var i="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(i=r[1].toLowerCase())}for(var n=ti.length-1;n>=0;--n){var o=ti[n];if(o.test&&o.test(t,i))return new o(t,e)}return new $e(t,e)}var ii=function(t){function e(e,i){var r=i||{},n=r.width,o=r.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;if(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height)r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{i.width=e.width,i.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),r.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Ke),ri={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},ni=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null),t.call(this);var r=(i=i||{}).premultiplyAlpha,n=i.mipmap,o=i.scaleMode,s=i.width,a=i.height,h=i.wrapMode,u=i.format,l=i.type,c=i.target,d=i.resolution,p=i.resourceOptions;!e||e instanceof Ke||((e=ei(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==r,this.uid=zt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={realWidth:{configurable:!0},realHeight:{configurable:!0}};return i.realWidth.get=function(){return this.width*this.resolution},i.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=qt(this.realWidth)&&qt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Qt[this.cacheId],delete Jt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,i){var r=null;"string"==typeof t?r=t:(t._pixiId||(t._pixiId="pixiid_"+zt()),r=t._pixiId);var n=Qt[r];return n||((n=new e(t,i)).cacheId=r,e.addToCache(n,r)),n},e.fromBuffer=function(t,i,r,n){t=t||new Float32Array(i*r*4);var o=new ii(t,{width:i,height:r}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(ri,n||{width:i,height:r,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Qt[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),Qt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=Qt[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var ui=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(r,e[0].src||e[0],i.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&Ve.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},i.autoUpdate.get=function(){return this._autoUpdate},i.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0))},i.updateFPS.get=function(){return this._updateFPS},i.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,i){return t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},Object.defineProperties(e.prototype,i),e}(Qe);ui.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],ti.push($e,si,ui,hi,ii,ai,oi);var li={INSTALLED:ti,autoDetectResource:ei,ArrayResource:oi,BufferResource:ii,CanvasResource:si,CubeResource:ai,ImageResource:$e,SVGResource:hi,VideoResource:ui,Resource:Ke,BaseImageResource:Qe},ci=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};ci.prototype.contextChange=function(t){},ci.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,r.texImage2D(e.target,0,r.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ii),pi=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ge("disposeFramebuffer",2)},fi={colorTexture:{configurable:!0}};fi.colorTexture.get=function(){return this.colorTextures[0]},pi.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new ni(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.addDepthTexture=function(t){return this.depthTexture=t||new ni(new di(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&e.textureCacheIds.splice(i,1),delete Jt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;rthis.baseTexture.width,s=i+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,u="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},i.rotate.get=function(){return this._rotate},i.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},i.width.get=function(){return this.orig.width},i.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,i),e}(y);function _i(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}yi.EMPTY=new yi(new ni),_i(yi.EMPTY),_i(yi.EMPTY.baseTexture),yi.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new yi(new ni(new si(t)))}(),_i(yi.WHITE),_i(yi.WHITE.baseTexture);var xi=function(t){function e(e,i){var r=null;if(!(e instanceof vi)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),r=arguments[0],i=null,e=new vi({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,i),this.legacyRenderer=r,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,i){void 0===i&&(i=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,i&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new vi(t))},e}(yi),bi=function(t,e,i,r,n,o,s){void 0===i&&(i=!1),void 0===r&&(r=5126),this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=o,this.instance=s};bi.prototype.destroy=function(){this.buffer=null},bi.from=function(t,e,i,r,n){return new bi(t,e,i,r,n)};var Ti=0,Ei=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=Ti++,this.disposeRunner=new Ge("disposeBuffer",2)};function wi(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}Ei.prototype.update=function(t){this.data=t||this.data,this._updateID++},Ei.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Ei.prototype.destroy=function(){this.dispose(),this.data=null},Ei.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new Ei(t)};var Si={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Pi={5126:4,5123:2,5121:1},Ii=0,Ai={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Oi=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ii++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new Ge("disposeGeometry",2),this.refCount=0};Oi.prototype.addAttribute=function(t,e,i,r,n,o,s,a){if(void 0===r&&(r=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new Ei(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),i},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,i),e}(ci),Xi=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new pi(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ae,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var i=this.gl;if(t){var r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,r.framebuffer)),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):r.dirtySize!==t.dirtySize&&(r.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}i.stencil||!t.stencil&&!t.depth||(i.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.stencil&&r.deleteRenderbuffer(i.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=r.data.byteLength)e.bufferSubData(o,0,r.data);else{var s=r.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=r.data.byteLength,e.bufferData(o,r.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var i=t.attributes,r=e.attributeData;for(var n in r)if(!i[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var i=t.attributes,r=e.attributeData,n=["g",t.id];for(var o in i)r[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var i=this.gl,r=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Gi[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Gi[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Gi[f.type])}s=i.createVertexArray(),i.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Zi=t,t}return Zi}function Ji(t,e,i){if("precision"!==t.substring(0,9)){var r=e;return e===At.HIGH&&i!==At.HIGH&&(r=At.MEDIUM),"precision "+r+" float;\n"+t}return i!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var Qi={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function $i(t){return Qi[t]}var tr=null,er={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ir(t,e){if(!tr){var i=Object.keys(er);tr={};for(var r=0;r0&&(e+="\nelse "),ie.name?1:-1});for(var u=0;u>=1,i++;this.stateId=t.data}for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,r=0;rthis.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,i=!0)}if(i){for(var o=0,s=0;s=0;i--)this.unload(t.children[i])},e}(ci),kr=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},Xr=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ni}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var i=this.gl;e.mipmap&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST):i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR:i.NEAREST),i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode?i.LINEAR:i.NEAREST)},e}(ci),jr={FilterSystem:Li,BatchSystem:Ui,ContextSystem:ki,FramebufferSystem:Xi,GeometrySystem:Hi,MaskSystem:wr,StencilSystem:Sr,ProjectionSystem:Pr,RenderTextureSystem:Ar,ShaderSystem:Mr,StateSystem:Ur,TextureGCSystem:Br,TextureSystem:Xr},Gr=new ge,Hr=function(t){function e(e,i){t.call(this),(i=Object.assign({},m.RENDER_OPTIONS,i)).roundPixels&&(m.ROUND_PIXELS=i.roundPixels,ae("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=i,this.type=yt.UNKNOWN,this.screen=new Ae(0,0,i.width,i.height),this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution||m.RESOLUTION,this.transparent=i.transparent,this.autoDensity=i.autoDensity||i.autoResize||!1,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new Be,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},i.width.get=function(){return this.view.width},i.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,i,r){0===(r=r||t.getLocalBounds()).width&&(r.width=1),0===r.height&&(r.height=1);var n=xi.create(0|r.width,0|r.height,e,i);return Gr.tx=-r.x,Gr.ty=-r.y,this.render(t,n,!1,Gr,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},i.backgroundColor.get=function(){return this._backgroundColor},i.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Lt(t),Ft(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,i),e}(y),Yr=function(t){function e(i){void 0===i&&(i={}),t.call(this,"WebGL",i),i=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new Ge("destroy"),contextChange:new Ge("contextChange",1),reset:new Ge("reset"),update:new Ge("update"),postrender:new Ge("postrender"),prerender:new Ge("prerender"),resize:new Ge("resize",2)},this.globalUniforms=new Ri({projectionMatrix:new ge},!0),this.addSystem(wr,"mask").addSystem(ki,"context").addSystem(Ur,"state").addSystem(Mr,"shader").addSystem(Xr,"texture").addSystem(Hi,"geometry").addSystem(Xi,"framebuffer").addSystem(Sr,"stencil").addSystem(Pr,"projection").addSystem(Br,"textureGC").addSystem(Li,"filter").addSystem(Ar,"renderTexture").addSystem(Ui,"batch"),this.initPlugins(e.__plugins),i.context?this.context.initFromContext(i.context):this.context.initFromOptions({alpha:this.transparent,antialias:i.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=i,this.runners)this.runners[r].add(i);return this},e.prototype.render=function(t,e,i,r,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=r,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.run(e,i)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(Hr);function zr(t){return Yr.create(t)}var Vr="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",Wr="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,i){return new e(new ai(t,i))},e}(ni),Zr=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new Ei(null,e,!1),this._indexBuffer=new Ei(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oi),Kr=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Jr=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Jr.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var Qr="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",$r=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),tn={},en={};function rn(t,e){if(!en[e]){for(var i=new Int32Array(e),r=0;r0&&(e+="\nelse "),ithis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=Wt(Math.ceil(t/12)),i=Zt(e),r=12*e;this.iBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.iBuffers[i];return n||(this.iBuffers[i]=n=new Uint16Array(r)),n},e.prototype.getAttributeBuffer=function(t){var e=Wt(Math.ceil(t/8)),i=Zt(e),r=8*e;this.aBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.aBuffers[r];return n||(this.aBuffers[r]=n=new Jr(r*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,i=this.renderer.gl,r=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++ni._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,i,r,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(r=!1),s=!0)}}return n&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),i&&i(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=e.length,r=0;rthis.maxSegments&&(i=this.maxSegments),i}},_n=function(){this.reset()};_n.prototype.clone=function(){var t=new _n;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},_n.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=yi.WHITE,this.matrix=null,this.visible=!1},_n.prototype.destroy=function(){this.texture=null,this.matrix=null};var xn=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]};xn.prototype.clone=function(){return new xn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},xn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var bn={build:function(t){var e,i,r=t.shape,n=t.points,o=r.x,s=r.y;if(n.length=0,t.type===ve.CIRC?(e=r.radius,i=r.radius):(e=r.width,i=r.height),0!==e&&0!==i){var a=Math.floor(30*Math.sqrt(r.radius))||Math.floor(15*Math.sqrt(r.width+r.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=r[2*(d-2)],m=r[2*(d-2)+1],y=r[2*(d-1)],_=r[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(r=In.pop()||new Cn,this.batches.push(r)),r.style=d,r.start=f,r.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),En.triangulate(a,this)):h.triangulate(a,this);else{Tn(a,this);for(var m=0;m0&&(o=An.pop()||new Kr,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(r,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}ni._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,i=sr?s+h:r;else if(c===ve.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,i=s-(h=n.radius+d/2)r?s+h:r;else if(c===ve.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,i=s-(h=n.height+d/2)r?s+h:r;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,i=(b=(v+s)/2)-(_=(h/a*g+m)/2)r?b+_:r)}else t=0,e=0,i=0,r=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=i-E,this._bounds.maxY=r+E},e.prototype.transformPoints=function(t,e){for(var i=0;i>16)+(65280&e)+((255&e)<<16),i);r-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,i,r,n,o){for(var s=0,a=e.length,h=i.frame;sl*a}},Ln.arc=function(t,e,i,r,n,o,s,a,h){for(var u=s-o,l=yn._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/de)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+i,(p*-x+f*_)*n+r)}};var Nn=function(t){function e(e,i,r,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*r,u=de/h,l=[],c=0;c0&&r>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:i,width:t,alpha:r,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Re,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Re,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,i,r,n),this},e.prototype.bezierCurveTo=function(t,e,i,r,n,o){return this._initCurve(),Rn.curveTo(t,e,i,r,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var o=this.currentPath.points,s=Ln.curveTo(t,e,i,r,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,i,r,n,o){if(void 0===o&&(o=!1),r===n)return this;if(!o&&n<=r?n+=de:o&&r<=n&&(r+=de),0===n-r)return this;var s=t+Math.cos(r)*i,a=e+Math.sin(r)*i,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Ln.arc(s,a,t,e,i,r,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(yi.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,i,r){void 0===t&&(t=yi.WHITE),void 0===e&&(e=16777215),void 0===i&&(i=1),void 0===r&&(r=null),this.currentPath&&this.startPoly();var n=i>0;return n?(r&&(r=r.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:i,texture:t,matrix:r,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,r){return this.drawShape(new Ae(t,e,i,r))},e.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new Fe(t,e,i,r,n))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new Me(t,e,i))},e.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new De(t,e,i,r))},e.prototype.drawPolygon=function(t){var e=arguments,i=t,r=!0;if(i.points&&(r=i.closeStroke,i=i.points),!Array.isArray(i)){i=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,i=t.b,r=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=r&&Xn.x=n&&Xn.y>16)+(65280&t)+((255&t)<<16)},i.texture.get=function(){return this._texture},i.texture.set=function(t){this._texture!==t&&(this._texture=t||yi.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,i),e}(Be),Hn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},Yn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Hn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},zn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Vn=function(t){this.styleID=0,this.reset(),Kn(this,t,t)},Wn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function qn(t){return"number"==typeof t?Lt(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Zn(t){if(Array.isArray(t)){for(var e=0;e=0;i--){var r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&zn.indexOf(r)<0&&(r='"'+r+'"'),e[i]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Vn.prototype,Wn);var Jn=function(t,e,i,r,n,o,s,a,h){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Jn.measureText=function(t,e,i,r){void 0===r&&(r=Jn._canvas),i=null==i?e.wordWrap:i;var n=e.toFontString(),o=Jn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=r.getContext("2d");s.font=n;for(var a=(i?Jn.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Jn.addLine(o),o="",n=0),Jn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Jn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Jn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Jn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Jn.addLine(o),o="",n=0),(o.length>0||!Jn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Jn.addLine(o,!1)},Jn.addLine=function(t,e){return void 0===e&&(e=!0),t=Jn.trimRight(t),t=e?t+"\n":t},Jn.getFromCache=function(t,e,i,r){var n=i[t];if(void 0===n){var o=t.length*e;n=r.measureText(t).width+o,i[t]=n}return n},Jn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Jn.collapseNewlines=function(t){return"normal"===t},Jn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var i=t[e];if(!Jn.isBreakingSpace(i))break;t=t.slice(0,-1)}return t},Jn.isNewline=function(t){return"string"==typeof t&&Jn._newlines.indexOf(t.charCodeAt(0))>=0},Jn.isBreakingSpace=function(t){return"string"==typeof t&&Jn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Jn.tokenize=function(t){var e=[],i="";if("string"!=typeof t)return e;for(var r=0;rs;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new eo(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(ho),this.registerFindHook(uo),this.registerFindHook(ro),this.registerFindHook(no),this.registerFindHook(oo),this.registerUploadHook(so),this.registerUploadHook(ao)};function ro(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var r=0;r=0;r--)this.add(t.children[r]);return this},io.prototype.destroy=function(){this.ticking&&Ve.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var lo=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(fo),this.registerUploadHook(co),this.registerUploadHook(po)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function co(t,e){return e instanceof ni&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function po(t,e){return e instanceof kn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function fo(t,e){return t instanceof kn&&(e.push(t),!0)}var vo=function(t){this.maxMilliseconds=t,this.frameStart=0};vo.prototype.beginFrame=function(){this.frameStart=Date.now()},vo.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),wo=(i(Eo),Eo.Resource,r(function(t,e){e.__esModule=!0,e.Loader=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=i,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,i){return e._loadResource(t,i)},this._queue=s.queue(this._boundLoadResource,r),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Do(No);No.Resource;var Uo=Ro(function(t,e){e.__esModule=!0,e.encodeBinary=r;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(t){for(var e="",r=0;r>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(r=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=r,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(i),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t,Ft(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(o=i);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(Bt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=kt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;cr&&(p=r),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=r&&Qo.x=n&&Qo.y0&&r.x>h&&(Ht(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,r.x=0,r.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,r.x=0,r.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},i.align.get=function(){return this._font.align},i.align.set=function(t){this._font.align=t||"left",this.dirty=!0},i.anchor.get=function(){return this._anchor},i.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},i.font.get=function(){return this._font},i.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},i.text.get=function(){return this._text},i.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},i.maxWidth.get=function(){return this._maxWidth},i.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},i.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},i.textWidth.get=function(){return this.validate(),this._textWidth},i.letterSpacing.get=function(){return this._letterSpacing},i.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},i.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,i){var r={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=oe(s[0].getAttribute("file"),m.RESOLUTION),h={};r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,r.chars={},i instanceof yi&&(i=[i]);for(var u=0;u=r&&(e=t-s-1),o+=a=a.replace("%value%",i[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=r||4,this.blur=i||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,i,r);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",vs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,Wr,fs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),r=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[i+(1-i)*n,n*(1-i)-o*r,n*(1-i)+o*r,0,0,n*(1-i)+o*r,i+n*(1-i),n*(1-i)-o*r,0,0,n*(1-i)-o*r,n*(1-i)+o*r,i+n*(1-i),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,r=-.5*(i-1),n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,i,r,n){var o=((i=i||16770432)>>16&255)/255,s=(i>>8&255)/255,a=(255&i)/255,h=((r=r||3375104)>>16&255)/255,u=(r>>8&255)/255,l=(255&r)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},i.matrix.get=function(){return this.uniforms.m},i.matrix.set=function(t){this.uniforms.m=t},i.alpha.get=function(){return this.uniforms.uAlpha},i.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,i),e}(mr);vs.prototype.grayscale=vs.prototype.greyscale;var gs="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ms="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",ys=function(t){function e(e,i){var r=new ge;e.renderable=!1,t.call(this,gs,ms,{mapSampler:e._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=r,null==i&&(i=20),this.scale=new ue(i,i)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={map:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,i,r)},i.map.get=function(){return this.uniforms.mapSampler},i.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,i),e}(mr),_s="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",xs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',bs=function(t){function e(){t.call(this,_s,xs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(mr),Ts="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",Es=function(t){function e(e,i){void 0===e&&(e=.5),void 0===i&&(i=Math.random()),t.call(this,Wr,Ts,{uNoise:0,uSeed:0}),this.noise=e,this.seed=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={noise:{configurable:!0},seed:{configurable:!0}};return i.noise.get=function(){return this.uniforms.uNoise},i.noise.set=function(t){this.uniforms.uNoise=t},i.seed.get=function(){return this.uniforms.uSeed},i.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,i),e}(mr),ws=new ge;Ne.prototype._cacheAsBitmap=!1,Ne.prototype._cacheData=!1;var Ss=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ne.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ss),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ne.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ne.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds().clone();if(this.filters){var r=this.filters[0].padding;i.pad(r)}i.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=xi.create(i.width,i.height),s="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=s,ni.addToCache(o.baseTexture,s),yi.addToCache(o,s);var a=ws;a.tx=-i.x,a.ty=-i.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Gn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-i.x/i.width,h.anchor.y=-i.y/i.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ne.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ne.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),i=this.alpha;this.alpha=1;var r=t.context;e.ceil(m.RESOLUTION);var n=xi.create(e.width,e.height),o="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=o,ni.addToCache(n.baseTexture,o),yi.addToCache(n,o);var s=ws;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Gn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=i,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ne.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ne.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ne.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ni.removeFromCache(this._cacheData.textureCacheId),yi.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ne.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ne.prototype.name=null,Be.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},i.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;jt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,i),e}(pr),Fs=function(t){function e(e,i,r){t.call(this);var n=new Ei(e),o=new Ei(i,!0),s=new Ei(r,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertexDirtyId:{configurable:!0}};return i.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,i),e}(Oi),Ls=function(t){function e(e,i,r,n){void 0===e&&(e=100),void 0===i&&(i=100),void 0===r&&(r=10),void 0===n&&(n=10),t.call(this),this.segWidth=r,this.segHeight=n,this.width=e,this.height=i,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],r=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,i=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width},i.width.get=function(){return this._width},i.width.set=function(t){this._width=t,this._refresh()},i.height.get=function(){return this._height},i.height.set=function(t){this._height=t,this._refresh()},i.leftWidth.get=function(){return this._leftWidth},i.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},i.rightWidth.get=function(){return this._rightWidth},i.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},i.topHeight.get=function(){return this._topHeight},i.topHeight.set=function(t){this._topHeight=t,this._refresh()},i.bottomHeight.get=function(){return this._bottomHeight},i.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,i),e}(Bs),Gs=function(t){function e(e,i){t.call(this,e[0]instanceof yi?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==i,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&Ve.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&Ve.shared.add(this.update,this,Ye.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramei&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],r=0;r0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=r(function(t){!function(e){var i=/iPhone/i,r=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(i,e)&&!g(u,e),ipod:g(r,e),tablet:!g(i,e)&&g(n,e)&&!g(u,e),device:(g(i,e)||g(r,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var i=navigator.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)>=11&&(e=!0)}if(g.android.device){var r=navigator.userAgent.match(/Android\s([0-9.]*)/);r&&parseInt(r[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=r(function(t){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new n(r,o||t,s),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 s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,r,n=[];if(0===this._eventsCount)return n;for(r in t=this._events)e.call(t,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,s=new Array(o);n80*i){r=o=t[0],n=s=t[1];for(var f=i;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-r,s-n))?1/u:0}return w(d,p,i,r,n,u),p}function T(t,e,i,r,n){var o,s;if(n===H(t,e,i,r)>0)for(o=e;o=e;o-=r)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!N(r,r.next)&&0!==L(r.prev,r,r.next))r=r.next;else{if(j(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function w(t,e,i,r,n,o,s){if(t){!s&&o&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,i,r)),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,r,n,o,s,a,h,u=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,r=i,a=0,e=0;e0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(s>1)}(n)}(t,r,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,r,n,o):S(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,i),e,i,r,n,o,2):2===s&&A(t,e,i,r,n,o):w(E(t),e,i,r,n,o,1);break}}}function S(t){var e=t.prev,i=t,r=t.next;if(L(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&L(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,i,r){var n=t.prev,o=t,s=t.next;if(L(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,i,r),d=M(u,l,e,i,r),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!N(n,o)&&U(n,r,r.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),j(r),j(r.next),r=t=o),r=r.next}while(r!==t);return r}function A(t,e,i,r,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&F(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,i,r,n,o),void w(h,e,i,r,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var i,r=e,n=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>s){if(s=a,a===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x=r.x&&r.x>=l&&n!==r.x&&R(oi.x)&&B(r,t)&&(i=r,d=h),r=r.next;return i}(t,e)){var i=k(e,t);E(i,i.next)}}function M(t,e,i,r,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-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,i=t;do{(e.x=0&&(t-s)*(r-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(n-s)*(r-a)>=0}function F(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&&U(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)}function L(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,i,r){return!!(N(t,e)&&N(i,r)||N(t,r)&&N(i,e))||L(t,e,i)>0!=L(t,e,r)>0&&L(i,r,t)>0!=L(i,r,e)>0}function B(t,e){return L(t.prev,t,t.next)<0?L(t,e,t.next)>=0&&L(t,t.prev,e)>=0:L(t,e,t.prev)<0||L(t,t.next,e)<0}function k(t,e){var i=new G(t.i,t.x,t.y),r=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function X(t,e,i,r){var n=new G(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function j(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 G(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 H(t,e,i,r){for(var n=0,o=e,s=i-r;o0&&(r+=t[n-1].length,i.holes.push(r))}return i},_.default=x;var Y=r(function(t,i){!function(r){var n=i&&!i.nodeType&&i,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(r=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function I(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,i,r=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,i){var r=0;for(t=i?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;r+=l)t=E(t/T);return E(r+(T+1)*t/(t+p))}function D(t){var e,i,r,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((i=t.lastIndexOf(m))<0&&(i=0),r=0;r=128&&S("not-basic"),_.push(t.charCodeAt(r));for(n=i>0?i+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,i,r,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,i=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(r=n=P.length,n&&P.push(m);r<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-i)/(x=r+1))&&S("overflow"),i+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=i,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(i,x,r==n),i=0,++r}++i,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else r.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,i,r){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,i,r){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(r){var n=encodeURIComponent(q(r))+i;return Array.isArray(t[r])?t[r].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[r]))}).join(e):r?encodeURIComponent(q(r))+i+encodeURIComponent(q(t)):""},K=r(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof it))return it.prototype.format.call(t);return t.format()},et=it;function it(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var rt=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,i){if(t&&z.isObject(t)&&t instanceof it)return t;var r=new it;return r.parse(t,e,i),r}it.prototype.parse=function(t,e,i){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),n=-1!==r&&r127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift());return i.search=t.search,i.query=t.query,z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!_.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var b=_.slice(-1)[0],T=(i.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(i.hostname=i.host=P?"":_.length?_.shift():"",(S=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift()));return(m=m||i.host&&_.length)&&!P&&_.unshift(""),_.length?i.pathname=_.join("/"):(i.pathname=null,i.path=null),z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},it.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch(t){return!1}}()),Ot}function Ft(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Lt(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}var Ut=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}();function Bt(t,e){return Ut[e?1:0][t]}function kt(t,e,i,r){return i=i||new Float32Array(4),r||void 0===r?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function Xt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,r=t>>8&255,n=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(n=n*e+.5|0)}function jt(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(r||void 0===r)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function Gt(t){for(var e=6*t,i=new Uint16Array(e),r=0,n=0;r=n||0===i)){var o=n-(i=e+i>n?n-e:i);for(r=e;r>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function qt(t){return!(t&t-1||!t)}function Zt(t){var e=(t>65535)<<4,i=((t>>>=e)>255)<<3;return e|=i,e|=i=((t>>>=i)>15)<<2,(e|=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1}var Kt={},Jt=Object.create(null),Qt=Object.create(null);function $t(t){var e,i,r,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];Ee.push(e);for(var i=0;i<16;i++)for(var r=we(ye[t]*ye[i]+xe[t]*_e[i]),n=we(_e[t]*ye[i]+be[t]*_e[i]),o=we(ye[t]*xe[i]+xe[t]*be[i]),s=we(_e[t]*xe[i]+be[t]*be[i]),a=0;a<16;a++)if(ye[a]===r&&_e[a]===n&&xe[a]===o&&be[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new ge;u.set(ye[h],_e[h],xe[h],be[h],0,0),Te.push(u)}}();var Se={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return ye[t]},uY:function(t){return _e[t]},vX:function(t){return xe[t]},vY:function(t){return be[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return Ee[t][e]},sub:function(t,e){return Ee[t][Se.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Se.S:Se.N:2*Math.abs(e)<=Math.abs(t)?t>0?Se.E:Se.W:e>0?t>0?Se.SE:Se.SW:t>0?Se.NE:Se.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=Te[Se.inv(e)];n.tx=i,n.ty=r,t.append(n)}},Pe=function(){this.worldTransform=new ge,this.localTransform=new ge,this.position=new le(this.onChange,this,0,0),this.scale=new le(this.onChange,this,1,1),this.pivot=new le(this.onChange,this,0,0),this.skew=new le(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ie={rotation:{configurable:!0}};Pe.prototype.onChange=function(){this._localID++},Pe.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Pe.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Pe.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},Pe.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ie.rotation.get=function(){return this._rotation},Ie.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Pe.prototype,Ie),Pe.IDENTITY=new Pe;var Ae=function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=ve.RECT},Oe={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Ce={EMPTY:{configurable:!0}};Oe.left.get=function(){return this.x},Oe.right.get=function(){return this.x+this.width},Oe.top.get=function(){return this.y},Oe.bottom.get=function(){return this.y+this.height},Ce.EMPTY.get=function(){return new Ae(0,0,0,0)},Ae.prototype.clone=function(){return new Ae(this.x,this.y,this.width,this.height)},Ae.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Ae.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Ae.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(i=!i)}return i};var Fe=function(t,e,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=ve.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var i=t-(this.x+this.radius),r=e-(this.y+this.radius),n=this.radius*this.radius;if(i*i+r*r<=n)return!0;if((i=t-(this.x+this.width-this.radius))*i+r*r<=n)return!0;if(i*i+(r=e-(this.y+this.height-this.radius))*r<=n)return!0;if((i=t-(this.x+this.radius))*i+r*r<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Le=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Le.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Le.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Le.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ae.EMPTY:((t=t||new Ae(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Le.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Le.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,o=t[0],s=t[1];e=or?o:r,n=s>n?s:n,e=(o=t[2])r?o:r,n=s>n?s:n,e=(o=t[4])r?o:r,n=s>n?s:n,e=(o=t[6])r?o:r,n=s>n?s:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},Le.prototype.addFrame=function(t,e,i,r,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*i+l,m=a*e+u*i+c;d=gf?g:f,v=m>v?m:v,d=(g=s*r+h*i+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*r+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Le.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=r,this.minY=n,this.maxX=o,this.maxY=s},Le.prototype.addVertices=function(t,e,i,r){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=i;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Le.prototype.addBounds=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minXr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},Le.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Le.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ne=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Pe,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Le,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var i=Object.keys(t),r=0;r1)for(var r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);Ht(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,i=arguments.length;if(i>1)for(var r=0;r0&&o<=n){i=this.children.splice(r,o);for(var s=0;s1&&this.children.sort(Ue),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},Xe.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},Xe.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},Xe.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},Xe.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},Xe.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},Xe.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},Xe.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},Ve.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Ve.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},Ve.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},Ve.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},Ve.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),i=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/i}},qe.shared.get=function(){if(!Ve._shared){var t=Ve._shared=new Ve;t.autoStart=!0,t._protected=!0}return Ve._shared},qe.system.get=function(){if(!Ve._system){var t=Ve._system=new Ve;t.autoStart=!0,t._protected=!0}return Ve._system},Object.defineProperties(Ve.prototype,We),Object.defineProperties(Ve,qe);var Ze=function(){};Ze.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ye.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Ve.shared:new Ve,t.autoStart&&this.start()},Ze.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Ke=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Ge("setRealSize",2),this.onUpdate=new Ge("update")},Je={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Ke.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Ke.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Ke.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Je.valid.get=function(){return!!this._width&&!!this._height},Ke.prototype.update=function(){this.destroyed||this.onUpdate.run()},Ke.prototype.load=function(){return Promise.resolve()},Je.width.get=function(){return this._width},Je.height.get=function(){return this._height},Ke.prototype.upload=function(t,e,i){return!1},Ke.prototype.style=function(t,e,i){return!1},Ke.prototype.dispose=function(){},Ke.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Ke.prototype,Je);var Qe=function(t){function e(e){var i=e.naturalWidth||e.videoWidth||e.width,r=e.naturalHeight||e.videoHeight||e.height;t.call(this,i,r),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=ne(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,r){var n=t.gl,o=e.realWidth,s=e.realHeight;return r=r||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&i.width===o&&i.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,r):(i.width=o,i.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,r)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,i=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Ke),$e=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLImageElement)){var r=new Image;t.crossOrigin(r,e,i.crossorigin),r.src=e,e=r}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==i.createBitmap?i.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==i.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==i.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var i=e.source,r=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?r():i.onload=r}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,i,r){if(i.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,i,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,r,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in i._glTextures){var s=i._glTextures[o];if(s!==r&&s.dirtyId!==i.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}(Qe),ti=[];function ei(t,e){if(!t)return null;var i="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(i=r[1].toLowerCase())}for(var n=ti.length-1;n>=0;--n){var o=ti[n];if(o.test&&o.test(t,i))return new o(t,e)}return new $e(t,e)}var ii=function(t){function e(e,i){var r=i||{},n=r.width,o=r.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;if(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height)r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{i.width=e.width,i.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),r.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Ke),ri={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},ni=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null),t.call(this);var r=(i=i||{}).premultiplyAlpha,n=i.mipmap,o=i.scaleMode,s=i.width,a=i.height,h=i.wrapMode,u=i.format,l=i.type,c=i.target,d=i.resolution,p=i.resourceOptions;!e||e instanceof Ke||((e=ei(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==r,this.uid=zt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={realWidth:{configurable:!0},realHeight:{configurable:!0}};return i.realWidth.get=function(){return this.width*this.resolution},i.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=qt(this.realWidth)&&qt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Qt[this.cacheId],delete Jt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,i){var r=null;"string"==typeof t?r=t:(t._pixiId||(t._pixiId="pixiid_"+zt()),r=t._pixiId);var n=Qt[r];return n||((n=new e(t,i)).cacheId=r,e.addToCache(n,r)),n},e.fromBuffer=function(t,i,r,n){t=t||new Float32Array(i*r*4);var o=new ii(t,{width:i,height:r}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(ri,n||{width:i,height:r,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Qt[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),Qt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=Qt[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var ui=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(r,e[0].src||e[0],i.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&Ve.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},i.autoUpdate.get=function(){return this._autoUpdate},i.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0))},i.updateFPS.get=function(){return this._updateFPS},i.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,i){return t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},Object.defineProperties(e.prototype,i),e}(Qe);ui.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],ti.push($e,si,ui,hi,ii,ai,oi);var li={INSTALLED:ti,autoDetectResource:ei,ArrayResource:oi,BufferResource:ii,CanvasResource:si,CubeResource:ai,ImageResource:$e,SVGResource:hi,VideoResource:ui,Resource:Ke,BaseImageResource:Qe},ci=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};ci.prototype.contextChange=function(t){},ci.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,r.texImage2D(e.target,0,r.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ii),pi=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ge("disposeFramebuffer",2)},fi={colorTexture:{configurable:!0}};fi.colorTexture.get=function(){return this.colorTextures[0]},pi.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new ni(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.addDepthTexture=function(t){return this.depthTexture=t||new ni(new di(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&e.textureCacheIds.splice(i,1),delete Jt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;rthis.baseTexture.width,s=i+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,u="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},i.rotate.get=function(){return this._rotate},i.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},i.width.get=function(){return this.orig.width},i.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,i),e}(y);function _i(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}yi.EMPTY=new yi(new ni),_i(yi.EMPTY),_i(yi.EMPTY.baseTexture),yi.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new yi(new ni(new si(t)))}(),_i(yi.WHITE),_i(yi.WHITE.baseTexture);var xi=function(t){function e(e,i){var r=null;if(!(e instanceof vi)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),r=arguments[0],i=null,e=new vi({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,i),this.legacyRenderer=r,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,i){void 0===i&&(i=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,i&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new vi(t))},e}(yi),bi=function(t,e,i,r,n,o,s){void 0===i&&(i=!1),void 0===r&&(r=5126),this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=o,this.instance=s};bi.prototype.destroy=function(){this.buffer=null},bi.from=function(t,e,i,r,n){return new bi(t,e,i,r,n)};var Ti=0,Ei=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=Ti++,this.disposeRunner=new Ge("disposeBuffer",2)};function wi(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}Ei.prototype.update=function(t){this.data=t||this.data,this._updateID++},Ei.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Ei.prototype.destroy=function(){this.dispose(),this.data=null},Ei.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new Ei(t)};var Si={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Pi={5126:4,5123:2,5121:1},Ii=0,Ai={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Oi=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ii++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new Ge("disposeGeometry",2),this.refCount=0};Oi.prototype.addAttribute=function(t,e,i,r,n,o,s,a){if(void 0===r&&(r=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new Ei(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),i},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,i),e}(ci),Xi=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new pi(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ae,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var i=this.gl;if(t){var r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,r.framebuffer)),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):r.dirtySize!==t.dirtySize&&(r.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}i.stencil||!t.stencil&&!t.depth||(i.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.stencil&&r.deleteRenderbuffer(i.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=r.data.byteLength)e.bufferSubData(o,0,r.data);else{var s=r.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=r.data.byteLength,e.bufferData(o,r.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var i=t.attributes,r=e.attributeData;for(var n in r)if(!i[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var i=t.attributes,r=e.attributeData,n=["g",t.id];for(var o in i)r[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var i=this.gl,r=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Gi[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Gi[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Gi[f.type])}s=i.createVertexArray(),i.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Zi=t,t}return Zi}function Ji(t,e,i){if("precision"!==t.substring(0,9)){var r=e;return e===At.HIGH&&i!==At.HIGH&&(r=At.MEDIUM),"precision "+r+" float;\n"+t}return i!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var Qi={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function $i(t){return Qi[t]}var tr=null,er={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ir(t,e){if(!tr){var i=Object.keys(er);tr={};for(var r=0;r0&&(e+="\nelse "),ie.name?1:-1});for(var u=0;u>=1,i++;this.stateId=t.data}for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,r=0;rthis.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,i=!0)}if(i){for(var o=0,s=0;s=0;i--)this.unload(t.children[i])},e}(ci),kr=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},Xr=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ni}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var i=this.gl;e.mipmap&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST):i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR:i.NEAREST),i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode?i.LINEAR:i.NEAREST)},e}(ci),jr={FilterSystem:Li,BatchSystem:Ui,ContextSystem:ki,FramebufferSystem:Xi,GeometrySystem:Hi,MaskSystem:wr,StencilSystem:Sr,ProjectionSystem:Pr,RenderTextureSystem:Ar,ShaderSystem:Mr,StateSystem:Ur,TextureGCSystem:Br,TextureSystem:Xr},Gr=new ge,Hr=function(t){function e(e,i){t.call(this),(i=Object.assign({},m.RENDER_OPTIONS,i)).roundPixels&&(m.ROUND_PIXELS=i.roundPixels,ae("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=i,this.type=yt.UNKNOWN,this.screen=new Ae(0,0,i.width,i.height),this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution||m.RESOLUTION,this.transparent=i.transparent,this.autoDensity=i.autoDensity||i.autoResize||!1,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new Be,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},i.width.get=function(){return this.view.width},i.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,i,r){0===(r=r||t.getLocalBounds()).width&&(r.width=1),0===r.height&&(r.height=1);var n=xi.create(0|r.width,0|r.height,e,i);return Gr.tx=-r.x,Gr.ty=-r.y,this.render(t,n,!1,Gr,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},i.backgroundColor.get=function(){return this._backgroundColor},i.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Lt(t),Ft(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,i),e}(y),Yr=function(t){function e(i){void 0===i&&(i={}),t.call(this,"WebGL",i),i=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new Ge("destroy"),contextChange:new Ge("contextChange",1),reset:new Ge("reset"),update:new Ge("update"),postrender:new Ge("postrender"),prerender:new Ge("prerender"),resize:new Ge("resize",2)},this.globalUniforms=new Ri({projectionMatrix:new ge},!0),this.addSystem(wr,"mask").addSystem(ki,"context").addSystem(Ur,"state").addSystem(Mr,"shader").addSystem(Xr,"texture").addSystem(Hi,"geometry").addSystem(Xi,"framebuffer").addSystem(Sr,"stencil").addSystem(Pr,"projection").addSystem(Br,"textureGC").addSystem(Li,"filter").addSystem(Ar,"renderTexture").addSystem(Ui,"batch"),this.initPlugins(e.__plugins),i.context?this.context.initFromContext(i.context):this.context.initFromOptions({alpha:this.transparent,antialias:i.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=i,this.runners)this.runners[r].add(i);return this},e.prototype.render=function(t,e,i,r,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=r,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.run(e,i)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(Hr);function zr(t){return Yr.create(t)}var Vr="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",Wr="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,i){return new e(new ai(t,i))},e}(ni),Zr=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new Ei(null,e,!1),this._indexBuffer=new Ei(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oi),Kr=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Jr=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Jr.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var Qr="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",$r=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),tn={},en={};function rn(t,e){if(!en[e]){for(var i=new Int32Array(e),r=0;r0&&(e+="\nelse "),ithis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=Wt(Math.ceil(t/12)),i=Zt(e),r=12*e;this.iBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.iBuffers[i];return n||(this.iBuffers[i]=n=new Uint16Array(r)),n},e.prototype.getAttributeBuffer=function(t){var e=Wt(Math.ceil(t/8)),i=Zt(e),r=8*e;this.aBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.aBuffers[r];return n||(this.aBuffers[r]=n=new Jr(r*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,i=this.renderer.gl,r=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++ni._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,i,r,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(r=!1),s=!0)}}return n&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),i&&i(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=e.length,r=0;rthis.maxSegments&&(i=this.maxSegments),i}},_n=function(){this.reset()};_n.prototype.clone=function(){var t=new _n;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},_n.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=yi.WHITE,this.matrix=null,this.visible=!1},_n.prototype.destroy=function(){this.texture=null,this.matrix=null};var xn=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]};xn.prototype.clone=function(){return new xn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},xn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var bn={build:function(t){var e,i,r=t.shape,n=t.points,o=r.x,s=r.y;if(n.length=0,t.type===ve.CIRC?(e=r.radius,i=r.radius):(e=r.width,i=r.height),0!==e&&0!==i){var a=Math.floor(30*Math.sqrt(r.radius))||Math.floor(15*Math.sqrt(r.width+r.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=r[2*(d-2)],m=r[2*(d-2)+1],y=r[2*(d-1)],_=r[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(r=In.pop()||new Cn,this.batches.push(r)),r.style=d,r.start=f,r.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),En.triangulate(a,this)):h.triangulate(a,this);else{Tn(a,this);for(var m=0;m0&&(o=An.pop()||new Kr,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(r,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}ni._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,i=sr?s+h:r;else if(c===ve.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,i=s-(h=n.radius+d/2)r?s+h:r;else if(c===ve.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,i=s-(h=n.height+d/2)r?s+h:r;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,i=(b=(v+s)/2)-(_=(h/a*g+m)/2)r?b+_:r)}else t=0,e=0,i=0,r=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=i-E,this._bounds.maxY=r+E},e.prototype.transformPoints=function(t,e){for(var i=0;i>16)+(65280&e)+((255&e)<<16),i);r-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,i,r,n,o){for(var s=0,a=e.length,h=i.frame;sl*a}},Ln.arc=function(t,e,i,r,n,o,s,a,h){for(var u=s-o,l=yn._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/de)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+i,(p*-x+f*_)*n+r)}};var Nn=function(t){function e(e,i,r,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*r,u=de/h,l=[],c=0;c0&&r>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:i,width:t,alpha:r,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Re,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Re,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,i,r,n),this},e.prototype.bezierCurveTo=function(t,e,i,r,n,o){return this._initCurve(),Rn.curveTo(t,e,i,r,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var o=this.currentPath.points,s=Ln.curveTo(t,e,i,r,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,i,r,n,o){if(void 0===o&&(o=!1),r===n)return this;if(!o&&n<=r?n+=de:o&&r<=n&&(r+=de),0===n-r)return this;var s=t+Math.cos(r)*i,a=e+Math.sin(r)*i,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Ln.arc(s,a,t,e,i,r,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(yi.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,i,r){void 0===t&&(t=yi.WHITE),void 0===e&&(e=16777215),void 0===i&&(i=1),void 0===r&&(r=null),this.currentPath&&this.startPoly();var n=i>0;return n?(r&&(r=r.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:i,texture:t,matrix:r,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,r){return this.drawShape(new Ae(t,e,i,r))},e.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new Fe(t,e,i,r,n))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new Me(t,e,i))},e.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new De(t,e,i,r))},e.prototype.drawPolygon=function(t){var e=arguments,i=t,r=!0;if(i.points&&(r=i.closeStroke,i=i.points),!Array.isArray(i)){i=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,i=t.b,r=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=r&&Xn.x=n&&Xn.y>16)+(65280&t)+((255&t)<<16)},i.texture.get=function(){return this._texture},i.texture.set=function(t){this._texture!==t&&(this._texture=t||yi.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,i),e}(Be),Hn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},Yn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Hn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},zn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Vn=function(t){this.styleID=0,this.reset(),Kn(this,t,t)},Wn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function qn(t){return"number"==typeof t?Lt(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Zn(t){if(Array.isArray(t)){for(var e=0;e=0;i--){var r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&zn.indexOf(r)<0&&(r='"'+r+'"'),e[i]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Vn.prototype,Wn);var Jn=function(t,e,i,r,n,o,s,a,h){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Jn.measureText=function(t,e,i,r){void 0===r&&(r=Jn._canvas),i=null==i?e.wordWrap:i;var n=e.toFontString(),o=Jn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=r.getContext("2d");s.font=n;for(var a=(i?Jn.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Jn.addLine(o),o="",n=0),Jn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Jn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Jn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Jn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Jn.addLine(o),o="",n=0),(o.length>0||!Jn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Jn.addLine(o,!1)},Jn.addLine=function(t,e){return void 0===e&&(e=!0),t=Jn.trimRight(t),t=e?t+"\n":t},Jn.getFromCache=function(t,e,i,r){var n=i[t];if(void 0===n){var o=t.length*e;n=r.measureText(t).width+o,i[t]=n}return n},Jn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Jn.collapseNewlines=function(t){return"normal"===t},Jn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var i=t[e];if(!Jn.isBreakingSpace(i))break;t=t.slice(0,-1)}return t},Jn.isNewline=function(t){return"string"==typeof t&&Jn._newlines.indexOf(t.charCodeAt(0))>=0},Jn.isBreakingSpace=function(t){return"string"==typeof t&&Jn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Jn.tokenize=function(t){var e=[],i="";if("string"!=typeof t)return e;for(var r=0;rs;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new eo(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(ho),this.registerFindHook(uo),this.registerFindHook(ro),this.registerFindHook(no),this.registerFindHook(oo),this.registerUploadHook(so),this.registerUploadHook(ao)};function ro(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var r=0;r=0;r--)this.add(t.children[r]);return this},io.prototype.destroy=function(){this.ticking&&Ve.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var lo=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(fo),this.registerUploadHook(co),this.registerUploadHook(po)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function co(t,e){return e instanceof ni&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function po(t,e){return e instanceof kn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function fo(t,e){return t instanceof kn&&(e.push(t),!0)}var vo=function(t){this.maxMilliseconds=t,this.frameStart=0};vo.prototype.beginFrame=function(){this.frameStart=Date.now()},vo.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),wo=(i(Eo),Eo.Resource,r(function(t,e){e.__esModule=!0,e.Loader=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=i,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,i){return e._loadResource(t,i)},this._queue=s.queue(this._boundLoadResource,r),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Do(No);No.Resource;var Uo=Ro(function(t,e){e.__esModule=!0,e.encodeBinary=r;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(t){for(var e="",r=0;r>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(r=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=r,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(i),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t,Ft(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(o=i);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(Bt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=kt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;cr&&(p=r),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=r&&Qo.x=n&&Qo.y0&&r.x>h&&(Ht(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,r.x=0,r.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,r.x=0,r.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},i.align.get=function(){return this._font.align},i.align.set=function(t){this._font.align=t||"left",this.dirty=!0},i.anchor.get=function(){return this._anchor},i.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},i.font.get=function(){return this._font},i.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},i.text.get=function(){return this._text},i.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},i.maxWidth.get=function(){return this._maxWidth},i.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},i.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},i.textWidth.get=function(){return this.validate(),this._textWidth},i.letterSpacing.get=function(){return this._letterSpacing},i.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},i.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,i){var r={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=oe(s[0].getAttribute("file"),m.RESOLUTION),h={};r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,r.chars={},i instanceof yi&&(i=[i]);for(var u=0;u=r&&(e=t-s-1),o+=a=a.replace("%value%",i[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=r||4,this.blur=i||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,i,r);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",vs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,Wr,fs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),r=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[i+(1-i)*n,n*(1-i)-o*r,n*(1-i)+o*r,0,0,n*(1-i)+o*r,i+n*(1-i),n*(1-i)-o*r,0,0,n*(1-i)-o*r,n*(1-i)+o*r,i+n*(1-i),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,r=-.5*(i-1),n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,i,r,n){var o=((i=i||16770432)>>16&255)/255,s=(i>>8&255)/255,a=(255&i)/255,h=((r=r||3375104)>>16&255)/255,u=(r>>8&255)/255,l=(255&r)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},i.matrix.get=function(){return this.uniforms.m},i.matrix.set=function(t){this.uniforms.m=t},i.alpha.get=function(){return this.uniforms.uAlpha},i.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,i),e}(mr);vs.prototype.grayscale=vs.prototype.greyscale;var gs="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ms="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",ys=function(t){function e(e,i){var r=new ge;e.renderable=!1,t.call(this,gs,ms,{mapSampler:e._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=r,null==i&&(i=20),this.scale=new ue(i,i)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={map:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,i,r)},i.map.get=function(){return this.uniforms.mapSampler},i.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,i),e}(mr),_s="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",xs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',bs=function(t){function e(){t.call(this,_s,xs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(mr),Ts="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",Es=function(t){function e(e,i){void 0===e&&(e=.5),void 0===i&&(i=Math.random()),t.call(this,Wr,Ts,{uNoise:0,uSeed:0}),this.noise=e,this.seed=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={noise:{configurable:!0},seed:{configurable:!0}};return i.noise.get=function(){return this.uniforms.uNoise},i.noise.set=function(t){this.uniforms.uNoise=t},i.seed.get=function(){return this.uniforms.uSeed},i.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,i),e}(mr),ws=new ge;Ne.prototype._cacheAsBitmap=!1,Ne.prototype._cacheData=!1;var Ss=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ne.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ss),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ne.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ne.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds().clone();if(this.filters){var r=this.filters[0].padding;i.pad(r)}i.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=xi.create(i.width,i.height),s="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=s,ni.addToCache(o.baseTexture,s),yi.addToCache(o,s);var a=ws;a.tx=-i.x,a.ty=-i.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Gn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-i.x/i.width,h.anchor.y=-i.y/i.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ne.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ne.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),i=this.alpha;this.alpha=1;var r=t.context;e.ceil(m.RESOLUTION);var n=xi.create(e.width,e.height),o="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=o,ni.addToCache(n.baseTexture,o),yi.addToCache(n,o);var s=ws;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Gn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=i,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ne.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ne.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ne.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ni.removeFromCache(this._cacheData.textureCacheId),yi.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ne.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ne.prototype.name=null,Be.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},i.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;jt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,i),e}(pr),Fs=function(t){function e(e,i,r){t.call(this);var n=new Ei(e),o=new Ei(i,!0),s=new Ei(r,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertexDirtyId:{configurable:!0}};return i.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,i),e}(Oi),Ls=function(t){function e(e,i,r,n){void 0===e&&(e=100),void 0===i&&(i=100),void 0===r&&(r=10),void 0===n&&(n=10),t.call(this),this.segWidth=r,this.segHeight=n,this.width=e,this.height=i,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],r=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,i=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width},i.width.get=function(){return this._width},i.width.set=function(t){this._width=t,this._refresh()},i.height.get=function(){return this._height},i.height.set=function(t){this._height=t,this._refresh()},i.leftWidth.get=function(){return this._leftWidth},i.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},i.rightWidth.get=function(){return this._rightWidth},i.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},i.topHeight.get=function(){return this._topHeight},i.topHeight.set=function(t){this._topHeight=t,this._refresh()},i.bottomHeight.get=function(){return this._bottomHeight},i.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,i),e}(Bs),Gs=function(t){function e(e,i){t.call(this,e[0]instanceof yi?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==i,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&Ve.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&Ve.shared.add(this.update,this,Ye.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramei&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],r=0;r0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+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 s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==F(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,r,i)),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,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(F(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&F(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(F(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&L(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&R(or.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function L(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)}function F(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||F(t,e,r)>0!=F(t,e,i)>0&&F(r,i,t)>0!=F(r,i,e)>0}function B(t,e){return F(t.prev,t,t.next)<0?F(t,e,t.next)>=0&&F(t,t.prev,e)>=0:F(t,e,t.prev)<0||F(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function X(t,e,r,i){var n=new G(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Ot}function Lt(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function Ut(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Bt=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function kt(t,e){return Bt[e?1:0][t]}function Xt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function jt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Gt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Kt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Jt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Ie.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Ie.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Fe=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=gf?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Ne.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Yt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort(Be),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=Vt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Zt(this.realWidth)&&Zt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $t[this.cacheId],delete Qt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+Vt()),i=t._pixiId);var n=$t[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$t[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Ft(t),Lt(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Lr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i0&&(e+="\nelse "),rthis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=qt(Math.ceil(t/12)),r=Kt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=qt(Math.ceil(t/8)),r=Kt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;ithis.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,r=si?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,r=s-(h=n.radius+d/2)i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,r=s-(h=n.height+d/2)i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;sl*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Le,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Le,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Ln.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Fe(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Lo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Lt(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(kt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Xt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=i&&$o.x=n&&$o.y0&&i.x>h&&(Yt(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ys="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",bs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ue.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ue.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Gt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Fs=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(Bs),Gs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;iw?w:E,e.moveTo(_,x+E),e.lineTo(_,x+T-E),e.quadraticCurveTo(_,x+T,_+E,x+T),e.lineTo(_+b-E,x+T),e.quadraticCurveTo(_+b,x+T,_+b,x+T-E),e.lineTo(_+b,x+E),e.quadraticCurveTo(_+b,x,_+b-E,x),e.lineTo(_+E,x),e.quadraticCurveTo(_,x,_,x+E),e.closePath()}}}},zs.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},zs.prototype.destroy=function(){};var qs=function(t){function e(r,i,n){var o;t.call(this,"Canvas",r,i,n),this.type=yt.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new zs(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),Ws()?(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="multiply",o[_t.SCREEN]="screen",o[_t.OVERLAY]="overlay",o[_t.DARKEN]="darken",o[_t.LIGHTEN]="lighten",o[_t.COLOR_DODGE]="color-dodge",o[_t.COLOR_BURN]="color-burn",o[_t.HARD_LIGHT]="hard-light",o[_t.SOFT_LIGHT]="soft-light",o[_t.DIFFERENCE]="difference",o[_t.EXCLUSION]="exclusion",o[_t.HUE]="hue",o[_t.SATURATION]="saturate",o[_t.COLOR]="color",o[_t.LUMINOSITY]="luminosity"):(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="source-over",o[_t.SCREEN]="source-over",o[_t.OVERLAY]="source-over",o[_t.DARKEN]="source-over",o[_t.LIGHTEN]="source-over",o[_t.COLOR_DODGE]="source-over",o[_t.COLOR_BURN]="source-over",o[_t.HARD_LIGHT]="source-over",o[_t.SOFT_LIGHT]="source-over",o[_t.DIFFERENCE]="source-over",o[_t.EXCLUSION]="source-over",o[_t.HUE]="source-over",o[_t.SATURATION]="source-over",o[_t.COLOR]="source-over",o[_t.LUMINOSITY]="source-over"),o[_t.NORMAL_NPM]=o[_t.NORMAL],o[_t.ADD_NPM]=o[_t.ADD],o[_t.SCREEN_NPM]=o[_t.SCREEN],o[_t.SRC_IN]="source-in",o[_t.SRC_OUT]="source-out",o[_t.SRC_ATOP]="source-atop",o[_t.DST_OVER]="destination-over",o[_t.DST_IN]="destination-in",o[_t.DST_OUT]="destination-out",o[_t.DST_ATOP]="destination-atop",o[_t.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,Dt("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ee(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=_t.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[_t.NORMAL],(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===_t.SRC_IN||t===_t.SRC_OUT||t===_t.DST_IN||t===_t.DST_ATOP;!e&&r&&(t=_t.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===wt.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi),Zs={getTintedCanvas:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=Zs.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=Zs.canvas||document.createElement("canvas");if(Zs.tintMethod(r,e,n),n.tintId=r._updateID,Zs.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,Zs.canvas=null;return n},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=Lt(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=w/Math.abs(t.worldTransform.a),P=w/Math.abs(t.worldTransform.d),I=(y+_+x)/3,A=(b+T+E)/3,O=y-I,C=b-A,M=Math.sqrt(O*O+C*C);y=I+O/M*(M+S),b=A+C/M*(M+P),C=T-A,_=I+(O=_-I)/(M=Math.sqrt(O*O+C*C))*(M+S),T=A+C/M*(M+P),C=E-A,x=I+(O=x-I)/(M=Math.sqrt(O*O+C*C))*(M+S),E=A+C/M*(M+P)}n.save(),n.beginPath(),n.moveTo(y,b),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=d*g+v*f+p*m-g*f-v*p-d*m,R=y*g+v*x+_*m-g*x-v*_-y*m,L=d*_+y*f+p*x-_*f-y*p-d*x,F=d*g*x+v*_*f+y*p*m-y*g*f-v*p*x-d*_*m,N=b*g+v*E+T*m-g*E-v*T-b*m,U=d*T+b*f+p*E-T*f-b*p-d*E,B=d*g*E+v*T*f+b*p*m-b*g*f-v*p*E-d*T*m;n.transform(R/D,N/D,L/D,U/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Js.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0){g=0,y=f[0],_=f[1];for(var b=2;b+2=0;S-=2)r.lineTo(f[S],f[S+1])}v[T].shape.closeStroke&&r.closePath()}}l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RECT)l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===ge.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke());else if(h.type===ge.ELIP){var P=2*u.width,I=2*u.height,A=u.x-P/2,O=u.y-I/2;r.beginPath();var C=P/2*.5522848,M=I/2*.5522848,D=A+P,R=O+I,L=A+P/2,F=O+I/2;r.moveTo(A,F),r.bezierCurveTo(A,F-M,L-C,O,L,O),r.bezierCurveTo(L+C,O,D,F-M,D,F),r.bezierCurveTo(D,F+M,L+C,R,L,R),r.bezierCurveTo(L-C,R,A,F+M,A,F),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RREC){var N=u.x,U=u.y,B=u.width,k=u.height,X=u.radius,j=Math.min(B,k)/2|0;X=X>j?j:X,r.beginPath(),r.moveTo(N,U+X),r.lineTo(N,U+k-X),r.quadraticCurveTo(N,U+k,N+X,U+k),r.lineTo(N+B-X,U+k),r.quadraticCurveTo(N+B,U+k,N+B,U+k-X),r.lineTo(N+B,U+X),r.quadraticCurveTo(N+B,U,N+B-X,U),r.lineTo(N+X,U),r.quadraticCurveTo(N,U,N,U+X),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}}},$s.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},$s.prototype.destroy=function(){this.renderer=null};var ta=new me;Xn.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=br.create(r.width,r.height,t,e);Qs||(Qs=new qs),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(ta),ta.invert(),ta.tx-=r.x,ta.ty-=r.y,Qs.render(this,i,!0,ta);var n=_r.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},Xn.prototype.cachedGraphicsData=[],Xn.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var ea=new me,ra=function(t){this.renderer=t};ra.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===wt.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(ea),s=ea,Pe.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution|0,s.ty*r.resolution|0),a|=0,h|=0):r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution,s.ty*r.resolution);var c=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Zs.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution)):i.drawImage(u,e._frame.x*c,e._frame.y*c,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),d&&i.restore(),r.setBlendMode(_t.NORMAL)}},ra.prototype.destroy=function(){this.renderer=null},Hn.prototype._tintedCanvas=null,Hn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var ia=new Oe,na=function(t){this.renderer=t,t.extract=this};na.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},na.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},na.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=ia).width=this.renderer.width,i.height=this.renderer.height);var s=i.width*r,a=i.height*r,h=new ee(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},na.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=ia).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},na.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var oa={CanvasExtract:na},sa=16,aa=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=sa,this.canvas.height=sa,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ha)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(io);function ha(t,e){if(e instanceof or){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}var ua={CanvasPrepare:aa};ts.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ee(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Zs.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,u),r.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(h+c,u+d),r.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},zo.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+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 s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==F(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,r,i)),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,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(F(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&F(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(F(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&L(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&R(or.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function L(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)}function F(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||F(t,e,r)>0!=F(t,e,i)>0&&F(r,i,t)>0!=F(r,i,e)>0}function B(t,e){return F(t.prev,t,t.next)<0?F(t,e,t.next)>=0&&F(t,t.prev,e)>=0:F(t,e,t.prev)<0||F(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function X(t,e,r,i){var n=new G(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Ot}function Lt(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function Ut(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Bt=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function kt(t,e){return Bt[e?1:0][t]}function Xt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function jt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Gt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Kt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Jt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Ie.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Ie.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Fe=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=gf?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Ne.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Yt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort(Be),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=Vt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Zt(this.realWidth)&&Zt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $t[this.cacheId],delete Qt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+Vt()),i=t._pixiId);var n=$t[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$t[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Ft(t),Lt(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Lr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i0&&(e+="\nelse "),rthis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=qt(Math.ceil(t/12)),r=Kt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=qt(Math.ceil(t/8)),r=Kt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;ithis.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,r=si?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,r=s-(h=n.radius+d/2)i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,r=s-(h=n.height+d/2)i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;sl*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Le,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Le,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Ln.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Fe(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Lo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Lt(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(kt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Xt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=i&&$o.x=n&&$o.y0&&i.x>h&&(Yt(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ys="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",bs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ue.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ue.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Gt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Fs=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(Bs),Gs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;iw?w:E,e.moveTo(_,x+E),e.lineTo(_,x+T-E),e.quadraticCurveTo(_,x+T,_+E,x+T),e.lineTo(_+b-E,x+T),e.quadraticCurveTo(_+b,x+T,_+b,x+T-E),e.lineTo(_+b,x+E),e.quadraticCurveTo(_+b,x,_+b-E,x),e.lineTo(_+E,x),e.quadraticCurveTo(_,x,_,x+E),e.closePath()}}}},zs.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},zs.prototype.destroy=function(){};var qs=function(t){function e(r,i,n){var o;t.call(this,"Canvas",r,i,n),this.type=yt.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new zs(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),Ws()?(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="multiply",o[_t.SCREEN]="screen",o[_t.OVERLAY]="overlay",o[_t.DARKEN]="darken",o[_t.LIGHTEN]="lighten",o[_t.COLOR_DODGE]="color-dodge",o[_t.COLOR_BURN]="color-burn",o[_t.HARD_LIGHT]="hard-light",o[_t.SOFT_LIGHT]="soft-light",o[_t.DIFFERENCE]="difference",o[_t.EXCLUSION]="exclusion",o[_t.HUE]="hue",o[_t.SATURATION]="saturate",o[_t.COLOR]="color",o[_t.LUMINOSITY]="luminosity"):(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="source-over",o[_t.SCREEN]="source-over",o[_t.OVERLAY]="source-over",o[_t.DARKEN]="source-over",o[_t.LIGHTEN]="source-over",o[_t.COLOR_DODGE]="source-over",o[_t.COLOR_BURN]="source-over",o[_t.HARD_LIGHT]="source-over",o[_t.SOFT_LIGHT]="source-over",o[_t.DIFFERENCE]="source-over",o[_t.EXCLUSION]="source-over",o[_t.HUE]="source-over",o[_t.SATURATION]="source-over",o[_t.COLOR]="source-over",o[_t.LUMINOSITY]="source-over"),o[_t.NORMAL_NPM]=o[_t.NORMAL],o[_t.ADD_NPM]=o[_t.ADD],o[_t.SCREEN_NPM]=o[_t.SCREEN],o[_t.SRC_IN]="source-in",o[_t.SRC_OUT]="source-out",o[_t.SRC_ATOP]="source-atop",o[_t.DST_OVER]="destination-over",o[_t.DST_IN]="destination-in",o[_t.DST_OUT]="destination-out",o[_t.DST_ATOP]="destination-atop",o[_t.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,Dt("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ee(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=_t.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[_t.NORMAL],(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===_t.SRC_IN||t===_t.SRC_OUT||t===_t.DST_IN||t===_t.DST_ATOP;!e&&r&&(t=_t.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===wt.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi),Zs={getTintedCanvas:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=Zs.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=Zs.canvas||document.createElement("canvas");if(Zs.tintMethod(r,e,n),n.tintId=r._updateID,Zs.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,Zs.canvas=null;return n},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=Lt(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=w/Math.abs(t.worldTransform.a),P=w/Math.abs(t.worldTransform.d),I=(y+_+x)/3,A=(b+T+E)/3,O=y-I,C=b-A,M=Math.sqrt(O*O+C*C);y=I+O/M*(M+S),b=A+C/M*(M+P),C=T-A,_=I+(O=_-I)/(M=Math.sqrt(O*O+C*C))*(M+S),T=A+C/M*(M+P),C=E-A,x=I+(O=x-I)/(M=Math.sqrt(O*O+C*C))*(M+S),E=A+C/M*(M+P)}n.save(),n.beginPath(),n.moveTo(y,b),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=d*g+v*f+p*m-g*f-v*p-d*m,R=y*g+v*x+_*m-g*x-v*_-y*m,L=d*_+y*f+p*x-_*f-y*p-d*x,F=d*g*x+v*_*f+y*p*m-y*g*f-v*p*x-d*_*m,N=b*g+v*E+T*m-g*E-v*T-b*m,U=d*T+b*f+p*E-T*f-b*p-d*E,B=d*g*E+v*T*f+b*p*m-b*g*f-v*p*E-d*T*m;n.transform(R/D,N/D,L/D,U/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Js.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0){g=0,y=f[0],_=f[1];for(var b=2;b+2=0;S-=2)r.lineTo(f[S],f[S+1])}v[T].shape.closeStroke&&r.closePath()}}l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RECT)l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===ge.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke());else if(h.type===ge.ELIP){var P=2*u.width,I=2*u.height,A=u.x-P/2,O=u.y-I/2;r.beginPath();var C=P/2*.5522848,M=I/2*.5522848,D=A+P,R=O+I,L=A+P/2,F=O+I/2;r.moveTo(A,F),r.bezierCurveTo(A,F-M,L-C,O,L,O),r.bezierCurveTo(L+C,O,D,F-M,D,F),r.bezierCurveTo(D,F+M,L+C,R,L,R),r.bezierCurveTo(L-C,R,A,F+M,A,F),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RREC){var N=u.x,U=u.y,B=u.width,k=u.height,X=u.radius,j=Math.min(B,k)/2|0;X=X>j?j:X,r.beginPath(),r.moveTo(N,U+X),r.lineTo(N,U+k-X),r.quadraticCurveTo(N,U+k,N+X,U+k),r.lineTo(N+B-X,U+k),r.quadraticCurveTo(N+B,U+k,N+B,U+k-X),r.lineTo(N+B,U+X),r.quadraticCurveTo(N+B,U,N+B-X,U),r.lineTo(N+X,U),r.quadraticCurveTo(N,U,N,U+X),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}}},$s.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},$s.prototype.destroy=function(){this.renderer=null};var ta=new me;Xn.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=br.create(r.width,r.height,t,e);Qs||(Qs=new qs),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(ta),ta.invert(),ta.tx-=r.x,ta.ty-=r.y,Qs.render(this,i,!0,ta);var n=_r.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},Xn.prototype.cachedGraphicsData=[],Xn.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var ea=new me,ra=function(t){this.renderer=t};ra.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===wt.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(ea),s=ea,Pe.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution|0,s.ty*r.resolution|0),a|=0,h|=0):r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution,s.ty*r.resolution);var c=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Zs.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution)):i.drawImage(u,e._frame.x*c,e._frame.y*c,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),d&&i.restore(),r.setBlendMode(_t.NORMAL)}},ra.prototype.destroy=function(){this.renderer=null},Hn.prototype._tintedCanvas=null,Hn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var ia=new Oe,na=function(t){this.renderer=t,t.extract=this};na.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},na.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},na.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=ia).width=this.renderer.width,i.height=this.renderer.height);var s=i.width*r,a=i.height*r,h=new ee(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},na.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=ia).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},na.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var oa={CanvasExtract:na},sa=16,aa=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=sa,this.canvas.height=sa,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ha)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(io);function ha(t,e){if(e instanceof or){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}var ua={CanvasPrepare:aa};ts.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ee(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Zs.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,u),r.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(h+c,u+d),r.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},zo.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=r(function(t){!function(e){var i=/iPhone/i,r=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(i,e)&&!g(u,e),ipod:g(r,e),tablet:!g(i,e)&&g(n,e)&&!g(u,e),device:(g(i,e)||g(r,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var i=navigator.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)>=11&&(e=!0)}if(g.android.device){var r=navigator.userAgent.match(/Android\s([0-9.]*)/);r&&parseInt(r[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=r(function(t){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new n(r,o||t,s),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 s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,r,n=[];if(0===this._eventsCount)return n;for(r in t=this._events)e.call(t,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,s=new Array(o);n80*i){r=o=t[0],n=s=t[1];for(var f=i;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-r,s-n))?1/u:0}return w(d,p,i,r,n,u),p}function T(t,e,i,r,n){var o,s;if(n===H(t,e,i,r)>0)for(o=e;o=e;o-=r)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!N(r,r.next)&&0!==L(r.prev,r,r.next))r=r.next;else{if(j(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function w(t,e,i,r,n,o,s){if(t){!s&&o&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,i,r)),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,r,n,o,s,a,h,u=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,r=i,a=0,e=0;e0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(s>1)}(n)}(t,r,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,r,n,o):S(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,i),e,i,r,n,o,2):2===s&&A(t,e,i,r,n,o):w(E(t),e,i,r,n,o,1);break}}}function S(t){var e=t.prev,i=t,r=t.next;if(L(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&L(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,i,r){var n=t.prev,o=t,s=t.next;if(L(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,i,r),d=M(u,l,e,i,r),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!N(n,o)&&U(n,r,r.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),j(r),j(r.next),r=t=o),r=r.next}while(r!==t);return r}function A(t,e,i,r,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&F(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,i,r,n,o),void w(h,e,i,r,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var i,r=e,n=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>s){if(s=a,a===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x=r.x&&r.x>=l&&n!==r.x&&R(oi.x)&&B(r,t)&&(i=r,d=h),r=r.next;return i}(t,e)){var i=k(e,t);E(i,i.next)}}function M(t,e,i,r,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-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,i=t;do{(e.x=0&&(t-s)*(r-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(n-s)*(r-a)>=0}function F(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&&U(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)}function L(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,i,r){return!!(N(t,e)&&N(i,r)||N(t,r)&&N(i,e))||L(t,e,i)>0!=L(t,e,r)>0&&L(i,r,t)>0!=L(i,r,e)>0}function B(t,e){return L(t.prev,t,t.next)<0?L(t,e,t.next)>=0&&L(t,t.prev,e)>=0:L(t,e,t.prev)<0||L(t,t.next,e)<0}function k(t,e){var i=new G(t.i,t.x,t.y),r=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function X(t,e,i,r){var n=new G(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function j(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 G(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 H(t,e,i,r){for(var n=0,o=e,s=i-r;o0&&(r+=t[n-1].length,i.holes.push(r))}return i},_.default=x;var Y=r(function(t,i){!function(r){var n=i&&!i.nodeType&&i,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(r=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function I(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,i,r=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,i){var r=0;for(t=i?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;r+=l)t=E(t/T);return E(r+(T+1)*t/(t+p))}function D(t){var e,i,r,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((i=t.lastIndexOf(m))<0&&(i=0),r=0;r=128&&S("not-basic"),_.push(t.charCodeAt(r));for(n=i>0?i+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,i,r,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,i=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(r=n=P.length,n&&P.push(m);r<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-i)/(x=r+1))&&S("overflow"),i+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=i,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(i,x,r==n),i=0,++r}++i,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else r.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,i,r){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,i,r){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(r){var n=encodeURIComponent(q(r))+i;return Array.isArray(t[r])?t[r].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[r]))}).join(e):r?encodeURIComponent(q(r))+i+encodeURIComponent(q(t)):""},K=r(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof it))return it.prototype.format.call(t);return t.format()},et=it;function it(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var rt=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,i){if(t&&z.isObject(t)&&t instanceof it)return t;var r=new it;return r.parse(t,e,i),r}it.prototype.parse=function(t,e,i){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),n=-1!==r&&r127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift());return i.search=t.search,i.query=t.query,z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!_.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var b=_.slice(-1)[0],T=(i.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(i.hostname=i.host=P?"":_.length?_.shift():"",(S=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift()));return(m=m||i.host&&_.length)&&!P&&_.unshift(""),_.length?i.pathname=_.join("/"):(i.pathname=null,i.path=null),z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},it.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch(t){return!1}}()),Ot}function Ft(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Lt(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}var Ut=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}();function Bt(t,e){return Ut[e?1:0][t]}function kt(t,e,i,r){return i=i||new Float32Array(4),r||void 0===r?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function Xt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,r=t>>8&255,n=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(n=n*e+.5|0)}function jt(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(r||void 0===r)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function Gt(t){for(var e=6*t,i=new Uint16Array(e),r=0,n=0;r=n||0===i)){var o=n-(i=e+i>n?n-e:i);for(r=e;r>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function qt(t){return!(t&t-1||!t)}function Zt(t){var e=(t>65535)<<4,i=((t>>>=e)>255)<<3;return e|=i,e|=i=((t>>>=i)>15)<<2,(e|=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1}var Kt={},Jt=Object.create(null),Qt=Object.create(null);function $t(t){var e,i,r,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];Ee.push(e);for(var i=0;i<16;i++)for(var r=we(ye[t]*ye[i]+xe[t]*_e[i]),n=we(_e[t]*ye[i]+be[t]*_e[i]),o=we(ye[t]*xe[i]+xe[t]*be[i]),s=we(_e[t]*xe[i]+be[t]*be[i]),a=0;a<16;a++)if(ye[a]===r&&_e[a]===n&&xe[a]===o&&be[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new ge;u.set(ye[h],_e[h],xe[h],be[h],0,0),Te.push(u)}}();var Se={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return ye[t]},uY:function(t){return _e[t]},vX:function(t){return xe[t]},vY:function(t){return be[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return Ee[t][e]},sub:function(t,e){return Ee[t][Se.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Se.S:Se.N:2*Math.abs(e)<=Math.abs(t)?t>0?Se.E:Se.W:e>0?t>0?Se.SE:Se.SW:t>0?Se.NE:Se.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=Te[Se.inv(e)];n.tx=i,n.ty=r,t.append(n)}},Pe=function(){this.worldTransform=new ge,this.localTransform=new ge,this.position=new le(this.onChange,this,0,0),this.scale=new le(this.onChange,this,1,1),this.pivot=new le(this.onChange,this,0,0),this.skew=new le(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ie={rotation:{configurable:!0}};Pe.prototype.onChange=function(){this._localID++},Pe.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Pe.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Pe.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},Pe.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ie.rotation.get=function(){return this._rotation},Ie.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Pe.prototype,Ie),Pe.IDENTITY=new Pe;var Ae=function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=ve.RECT},Oe={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Ce={EMPTY:{configurable:!0}};Oe.left.get=function(){return this.x},Oe.right.get=function(){return this.x+this.width},Oe.top.get=function(){return this.y},Oe.bottom.get=function(){return this.y+this.height},Ce.EMPTY.get=function(){return new Ae(0,0,0,0)},Ae.prototype.clone=function(){return new Ae(this.x,this.y,this.width,this.height)},Ae.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Ae.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Ae.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(i=!i)}return i};var Fe=function(t,e,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=ve.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var i=t-(this.x+this.radius),r=e-(this.y+this.radius),n=this.radius*this.radius;if(i*i+r*r<=n)return!0;if((i=t-(this.x+this.width-this.radius))*i+r*r<=n)return!0;if(i*i+(r=e-(this.y+this.height-this.radius))*r<=n)return!0;if((i=t-(this.x+this.radius))*i+r*r<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Le=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Le.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Le.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Le.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ae.EMPTY:((t=t||new Ae(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Le.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Le.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,o=t[0],s=t[1];e=or?o:r,n=s>n?s:n,e=(o=t[2])r?o:r,n=s>n?s:n,e=(o=t[4])r?o:r,n=s>n?s:n,e=(o=t[6])r?o:r,n=s>n?s:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},Le.prototype.addFrame=function(t,e,i,r,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*i+l,m=a*e+u*i+c;d=gf?g:f,v=m>v?m:v,d=(g=s*r+h*i+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*r+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Le.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=r,this.minY=n,this.maxX=o,this.maxY=s},Le.prototype.addVertices=function(t,e,i,r){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=i;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Le.prototype.addBounds=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minXr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},Le.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Le.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ne=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Pe,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Le,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var i=Object.keys(t),r=0;r1)for(var r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);Ht(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,i=arguments.length;if(i>1)for(var r=0;r0&&o<=n){i=this.children.splice(r,o);for(var s=0;s1&&this.children.sort(Ue),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},Xe.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},Xe.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},Xe.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},Xe.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},Xe.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},Xe.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},Xe.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},Ve.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Ve.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},Ve.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},Ve.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},Ve.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),i=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/i}},qe.shared.get=function(){if(!Ve._shared){var t=Ve._shared=new Ve;t.autoStart=!0,t._protected=!0}return Ve._shared},qe.system.get=function(){if(!Ve._system){var t=Ve._system=new Ve;t.autoStart=!0,t._protected=!0}return Ve._system},Object.defineProperties(Ve.prototype,We),Object.defineProperties(Ve,qe);var Ze=function(){};Ze.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ye.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Ve.shared:new Ve,t.autoStart&&this.start()},Ze.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Ke=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Ge("setRealSize",2),this.onUpdate=new Ge("update")},Je={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Ke.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Ke.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Ke.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Je.valid.get=function(){return!!this._width&&!!this._height},Ke.prototype.update=function(){this.destroyed||this.onUpdate.run()},Ke.prototype.load=function(){return Promise.resolve()},Je.width.get=function(){return this._width},Je.height.get=function(){return this._height},Ke.prototype.upload=function(t,e,i){return!1},Ke.prototype.style=function(t,e,i){return!1},Ke.prototype.dispose=function(){},Ke.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Ke.prototype,Je);var Qe=function(t){function e(e){var i=e.naturalWidth||e.videoWidth||e.width,r=e.naturalHeight||e.videoHeight||e.height;t.call(this,i,r),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=ne(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,r){var n=t.gl,o=e.realWidth,s=e.realHeight;return r=r||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&i.width===o&&i.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,r):(i.width=o,i.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,r)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,i=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Ke),$e=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLImageElement)){var r=new Image;t.crossOrigin(r,e,i.crossorigin),r.src=e,e=r}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==i.createBitmap?i.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==i.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==i.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var i=e.source,r=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?r():i.onload=r}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,i,r){if(i.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,i,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,r,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in i._glTextures){var s=i._glTextures[o];if(s!==r&&s.dirtyId!==i.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}(Qe),ti=[];function ei(t,e){if(!t)return null;var i="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(i=r[1].toLowerCase())}for(var n=ti.length-1;n>=0;--n){var o=ti[n];if(o.test&&o.test(t,i))return new o(t,e)}return new $e(t,e)}var ii=function(t){function e(e,i){var r=i||{},n=r.width,o=r.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;if(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height)r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{i.width=e.width,i.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),r.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Ke),ri={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},ni=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null),t.call(this);var r=(i=i||{}).premultiplyAlpha,n=i.mipmap,o=i.scaleMode,s=i.width,a=i.height,h=i.wrapMode,u=i.format,l=i.type,c=i.target,d=i.resolution,p=i.resourceOptions;!e||e instanceof Ke||((e=ei(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==r,this.uid=zt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={realWidth:{configurable:!0},realHeight:{configurable:!0}};return i.realWidth.get=function(){return this.width*this.resolution},i.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=qt(this.realWidth)&&qt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Qt[this.cacheId],delete Jt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,i){var r=null;"string"==typeof t?r=t:(t._pixiId||(t._pixiId="pixiid_"+zt()),r=t._pixiId);var n=Qt[r];return n||((n=new e(t,i)).cacheId=r,e.addToCache(n,r)),n},e.fromBuffer=function(t,i,r,n){t=t||new Float32Array(i*r*4);var o=new ii(t,{width:i,height:r}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(ri,n||{width:i,height:r,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Qt[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),Qt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=Qt[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var ui=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(r,e[0].src||e[0],i.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&Ve.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},i.autoUpdate.get=function(){return this._autoUpdate},i.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0))},i.updateFPS.get=function(){return this._updateFPS},i.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,i){return t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},Object.defineProperties(e.prototype,i),e}(Qe);ui.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],ti.push($e,si,ui,hi,ii,ai,oi);var li={INSTALLED:ti,autoDetectResource:ei,ArrayResource:oi,BufferResource:ii,CanvasResource:si,CubeResource:ai,ImageResource:$e,SVGResource:hi,VideoResource:ui,Resource:Ke,BaseImageResource:Qe},ci=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};ci.prototype.contextChange=function(t){},ci.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,r.texImage2D(e.target,0,r.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ii),pi=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ge("disposeFramebuffer",2)},fi={colorTexture:{configurable:!0}};fi.colorTexture.get=function(){return this.colorTextures[0]},pi.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new ni(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.addDepthTexture=function(t){return this.depthTexture=t||new ni(new di(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&e.textureCacheIds.splice(i,1),delete Jt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;rthis.baseTexture.width,s=i+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,u="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},i.rotate.get=function(){return this._rotate},i.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},i.width.get=function(){return this.orig.width},i.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,i),e}(y);function _i(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}yi.EMPTY=new yi(new ni),_i(yi.EMPTY),_i(yi.EMPTY.baseTexture),yi.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new yi(new ni(new si(t)))}(),_i(yi.WHITE),_i(yi.WHITE.baseTexture);var xi=function(t){function e(e,i){var r=null;if(!(e instanceof vi)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),r=arguments[0],i=null,e=new vi({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,i),this.legacyRenderer=r,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,i){void 0===i&&(i=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,i&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new vi(t))},e}(yi),bi=function(t,e,i,r,n,o,s){void 0===i&&(i=!1),void 0===r&&(r=5126),this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=o,this.instance=s};bi.prototype.destroy=function(){this.buffer=null},bi.from=function(t,e,i,r,n){return new bi(t,e,i,r,n)};var Ti=0,Ei=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=Ti++,this.disposeRunner=new Ge("disposeBuffer",2)};function wi(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}Ei.prototype.update=function(t){this.data=t||this.data,this._updateID++},Ei.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Ei.prototype.destroy=function(){this.dispose(),this.data=null},Ei.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new Ei(t)};var Si={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Pi={5126:4,5123:2,5121:1},Ii=0,Ai={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Oi=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ii++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new Ge("disposeGeometry",2),this.refCount=0};Oi.prototype.addAttribute=function(t,e,i,r,n,o,s,a){if(void 0===r&&(r=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new Ei(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),i},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,i),e}(ci),Xi=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new pi(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ae,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var i=this.gl;if(t){var r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,r.framebuffer)),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):r.dirtySize!==t.dirtySize&&(r.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}i.stencil||!t.stencil&&!t.depth||(i.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.stencil&&r.deleteRenderbuffer(i.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=r.data.byteLength)e.bufferSubData(o,0,r.data);else{var s=r.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=r.data.byteLength,e.bufferData(o,r.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var i=t.attributes,r=e.attributeData;for(var n in r)if(!i[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var i=t.attributes,r=e.attributeData,n=["g",t.id];for(var o in i)r[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var i=this.gl,r=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Gi[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Gi[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Gi[f.type])}s=i.createVertexArray(),i.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Zi=t,t}return Zi}function Ji(t,e,i){if("precision"!==t.substring(0,9)){var r=e;return e===At.HIGH&&i!==At.HIGH&&(r=At.MEDIUM),"precision "+r+" float;\n"+t}return i!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var Qi={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function $i(t){return Qi[t]}var tr=null,er={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ir(t,e){if(!tr){var i=Object.keys(er);tr={};for(var r=0;r0&&(e+="\nelse "),ie.name?1:-1});for(var u=0;u>=1,i++;this.stateId=t.data}for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,r=0;rthis.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,i=!0)}if(i){for(var o=0,s=0;s=0;i--)this.unload(t.children[i])},e}(ci),kr=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},Xr=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ni}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var i=this.gl;e.mipmap&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST):i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR:i.NEAREST),i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode?i.LINEAR:i.NEAREST)},e}(ci),jr={FilterSystem:Li,BatchSystem:Ui,ContextSystem:ki,FramebufferSystem:Xi,GeometrySystem:Hi,MaskSystem:wr,StencilSystem:Sr,ProjectionSystem:Pr,RenderTextureSystem:Ar,ShaderSystem:Mr,StateSystem:Ur,TextureGCSystem:Br,TextureSystem:Xr},Gr=new ge,Hr=function(t){function e(e,i){t.call(this),(i=Object.assign({},m.RENDER_OPTIONS,i)).roundPixels&&(m.ROUND_PIXELS=i.roundPixels,ae("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=i,this.type=yt.UNKNOWN,this.screen=new Ae(0,0,i.width,i.height),this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution||m.RESOLUTION,this.transparent=i.transparent,this.autoDensity=i.autoDensity||i.autoResize||!1,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new Be,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},i.width.get=function(){return this.view.width},i.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,i,r){0===(r=r||t.getLocalBounds()).width&&(r.width=1),0===r.height&&(r.height=1);var n=xi.create(0|r.width,0|r.height,e,i);return Gr.tx=-r.x,Gr.ty=-r.y,this.render(t,n,!1,Gr,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},i.backgroundColor.get=function(){return this._backgroundColor},i.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Lt(t),Ft(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,i),e}(y),Yr=function(t){function e(i){void 0===i&&(i={}),t.call(this,"WebGL",i),i=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new Ge("destroy"),contextChange:new Ge("contextChange",1),reset:new Ge("reset"),update:new Ge("update"),postrender:new Ge("postrender"),prerender:new Ge("prerender"),resize:new Ge("resize",2)},this.globalUniforms=new Ri({projectionMatrix:new ge},!0),this.addSystem(wr,"mask").addSystem(ki,"context").addSystem(Ur,"state").addSystem(Mr,"shader").addSystem(Xr,"texture").addSystem(Hi,"geometry").addSystem(Xi,"framebuffer").addSystem(Sr,"stencil").addSystem(Pr,"projection").addSystem(Br,"textureGC").addSystem(Li,"filter").addSystem(Ar,"renderTexture").addSystem(Ui,"batch"),this.initPlugins(e.__plugins),i.context?this.context.initFromContext(i.context):this.context.initFromOptions({alpha:this.transparent,antialias:i.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=i,this.runners)this.runners[r].add(i);return this},e.prototype.render=function(t,e,i,r,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=r,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.run(e,i)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(Hr);function zr(t){return Yr.create(t)}var Vr="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",Wr="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,i){return new e(new ai(t,i))},e}(ni),Zr=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new Ei(null,e,!1),this._indexBuffer=new Ei(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oi),Kr=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Jr=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Jr.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var Qr="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",$r=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),tn={},en={};function rn(t,e){if(!en[e]){for(var i=new Int32Array(e),r=0;r0&&(e+="\nelse "),ithis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=Wt(Math.ceil(t/12)),i=Zt(e),r=12*e;this.iBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.iBuffers[i];return n||(this.iBuffers[i]=n=new Uint16Array(r)),n},e.prototype.getAttributeBuffer=function(t){var e=Wt(Math.ceil(t/8)),i=Zt(e),r=8*e;this.aBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.aBuffers[r];return n||(this.aBuffers[r]=n=new Jr(r*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,i=this.renderer.gl,r=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++ni._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,i,r,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(r=!1),s=!0)}}return n&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),i&&i(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=e.length,r=0;rthis.maxSegments&&(i=this.maxSegments),i}},_n=function(){this.reset()};_n.prototype.clone=function(){var t=new _n;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},_n.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=yi.WHITE,this.matrix=null,this.visible=!1},_n.prototype.destroy=function(){this.texture=null,this.matrix=null};var xn=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]};xn.prototype.clone=function(){return new xn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},xn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var bn={build:function(t){var e,i,r=t.shape,n=t.points,o=r.x,s=r.y;if(n.length=0,t.type===ve.CIRC?(e=r.radius,i=r.radius):(e=r.width,i=r.height),0!==e&&0!==i){var a=Math.floor(30*Math.sqrt(r.radius))||Math.floor(15*Math.sqrt(r.width+r.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=r[2*(d-2)],m=r[2*(d-2)+1],y=r[2*(d-1)],_=r[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(r=In.pop()||new Cn,this.batches.push(r)),r.style=d,r.start=f,r.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),En.triangulate(a,this)):h.triangulate(a,this);else{Tn(a,this);for(var m=0;m0&&(o=An.pop()||new Kr,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(r,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}ni._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,i=sr?s+h:r;else if(c===ve.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,i=s-(h=n.radius+d/2)r?s+h:r;else if(c===ve.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,i=s-(h=n.height+d/2)r?s+h:r;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,i=(b=(v+s)/2)-(_=(h/a*g+m)/2)r?b+_:r)}else t=0,e=0,i=0,r=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=i-E,this._bounds.maxY=r+E},e.prototype.transformPoints=function(t,e){for(var i=0;i>16)+(65280&e)+((255&e)<<16),i);r-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,i,r,n,o){for(var s=0,a=e.length,h=i.frame;sl*a}},Ln.arc=function(t,e,i,r,n,o,s,a,h){for(var u=s-o,l=yn._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/de)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+i,(p*-x+f*_)*n+r)}};var Nn=function(t){function e(e,i,r,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*r,u=de/h,l=[],c=0;c0&&r>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:i,width:t,alpha:r,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Re,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Re,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,i,r,n),this},e.prototype.bezierCurveTo=function(t,e,i,r,n,o){return this._initCurve(),Rn.curveTo(t,e,i,r,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var o=this.currentPath.points,s=Ln.curveTo(t,e,i,r,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,i,r,n,o){if(void 0===o&&(o=!1),r===n)return this;if(!o&&n<=r?n+=de:o&&r<=n&&(r+=de),0===n-r)return this;var s=t+Math.cos(r)*i,a=e+Math.sin(r)*i,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Ln.arc(s,a,t,e,i,r,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(yi.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,i,r){void 0===t&&(t=yi.WHITE),void 0===e&&(e=16777215),void 0===i&&(i=1),void 0===r&&(r=null),this.currentPath&&this.startPoly();var n=i>0;return n?(r&&(r=r.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:i,texture:t,matrix:r,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,r){return this.drawShape(new Ae(t,e,i,r))},e.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new Fe(t,e,i,r,n))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new Me(t,e,i))},e.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new De(t,e,i,r))},e.prototype.drawPolygon=function(t){var e=arguments,i=t,r=!0;if(i.points&&(r=i.closeStroke,i=i.points),!Array.isArray(i)){i=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,i=t.b,r=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=r&&Xn.x=n&&Xn.y>16)+(65280&t)+((255&t)<<16)},i.texture.get=function(){return this._texture},i.texture.set=function(t){this._texture!==t&&(this._texture=t||yi.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,i),e}(Be),Hn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},Yn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Hn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},zn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Vn=function(t){this.styleID=0,this.reset(),Kn(this,t,t)},Wn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function qn(t){return"number"==typeof t?Lt(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Zn(t){if(Array.isArray(t)){for(var e=0;e=0;i--){var r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&zn.indexOf(r)<0&&(r='"'+r+'"'),e[i]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Vn.prototype,Wn);var Jn=function(t,e,i,r,n,o,s,a,h){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Jn.measureText=function(t,e,i,r){void 0===r&&(r=Jn._canvas),i=null==i?e.wordWrap:i;var n=e.toFontString(),o=Jn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=r.getContext("2d");s.font=n;for(var a=(i?Jn.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Jn.addLine(o),o="",n=0),Jn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Jn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Jn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Jn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Jn.addLine(o),o="",n=0),(o.length>0||!Jn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Jn.addLine(o,!1)},Jn.addLine=function(t,e){return void 0===e&&(e=!0),t=Jn.trimRight(t),t=e?t+"\n":t},Jn.getFromCache=function(t,e,i,r){var n=i[t];if(void 0===n){var o=t.length*e;n=r.measureText(t).width+o,i[t]=n}return n},Jn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Jn.collapseNewlines=function(t){return"normal"===t},Jn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var i=t[e];if(!Jn.isBreakingSpace(i))break;t=t.slice(0,-1)}return t},Jn.isNewline=function(t){return"string"==typeof t&&Jn._newlines.indexOf(t.charCodeAt(0))>=0},Jn.isBreakingSpace=function(t){return"string"==typeof t&&Jn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Jn.tokenize=function(t){var e=[],i="";if("string"!=typeof t)return e;for(var r=0;rs;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new eo(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(ho),this.registerFindHook(uo),this.registerFindHook(ro),this.registerFindHook(no),this.registerFindHook(oo),this.registerUploadHook(so),this.registerUploadHook(ao)};function ro(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var r=0;r=0;r--)this.add(t.children[r]);return this},io.prototype.destroy=function(){this.ticking&&Ve.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var lo=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(fo),this.registerUploadHook(co),this.registerUploadHook(po)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function co(t,e){return e instanceof ni&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function po(t,e){return e instanceof kn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function fo(t,e){return t instanceof kn&&(e.push(t),!0)}var vo=function(t){this.maxMilliseconds=t,this.frameStart=0};vo.prototype.beginFrame=function(){this.frameStart=Date.now()},vo.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),wo=(i(Eo),Eo.Resource,r(function(t,e){e.__esModule=!0,e.Loader=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=i,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,i){return e._loadResource(t,i)},this._queue=s.queue(this._boundLoadResource,r),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Do(No);No.Resource;var Uo=Ro(function(t,e){e.__esModule=!0,e.encodeBinary=r;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(t){for(var e="",r=0;r>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(r=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=r,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(i),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t,Ft(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(o=i);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(Bt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=kt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;cr&&(p=r),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=r&&Qo.x=n&&Qo.y0&&r.x>h&&(Ht(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,r.x=0,r.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,r.x=0,r.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},i.align.get=function(){return this._font.align},i.align.set=function(t){this._font.align=t||"left",this.dirty=!0},i.anchor.get=function(){return this._anchor},i.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},i.font.get=function(){return this._font},i.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},i.text.get=function(){return this._text},i.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},i.maxWidth.get=function(){return this._maxWidth},i.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},i.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},i.textWidth.get=function(){return this.validate(),this._textWidth},i.letterSpacing.get=function(){return this._letterSpacing},i.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},i.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,i){var r={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=oe(s[0].getAttribute("file"),m.RESOLUTION),h={};r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,r.chars={},i instanceof yi&&(i=[i]);for(var u=0;u=r&&(e=t-s-1),o+=a=a.replace("%value%",i[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=r||4,this.blur=i||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,i,r);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",vs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,Wr,fs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),r=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[i+(1-i)*n,n*(1-i)-o*r,n*(1-i)+o*r,0,0,n*(1-i)+o*r,i+n*(1-i),n*(1-i)-o*r,0,0,n*(1-i)-o*r,n*(1-i)+o*r,i+n*(1-i),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,r=-.5*(i-1),n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,i,r,n){var o=((i=i||16770432)>>16&255)/255,s=(i>>8&255)/255,a=(255&i)/255,h=((r=r||3375104)>>16&255)/255,u=(r>>8&255)/255,l=(255&r)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},i.matrix.get=function(){return this.uniforms.m},i.matrix.set=function(t){this.uniforms.m=t},i.alpha.get=function(){return this.uniforms.uAlpha},i.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,i),e}(mr);vs.prototype.grayscale=vs.prototype.greyscale;var gs="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ms="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",ys=function(t){function e(e,i){var r=new ge;e.renderable=!1,t.call(this,gs,ms,{mapSampler:e._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=r,null==i&&(i=20),this.scale=new ue(i,i)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={map:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,i,r)},i.map.get=function(){return this.uniforms.mapSampler},i.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,i),e}(mr),_s="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",xs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',bs=function(t){function e(){t.call(this,_s,xs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(mr),Ts="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",Es=function(t){function e(e,i){void 0===e&&(e=.5),void 0===i&&(i=Math.random()),t.call(this,Wr,Ts,{uNoise:0,uSeed:0}),this.noise=e,this.seed=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={noise:{configurable:!0},seed:{configurable:!0}};return i.noise.get=function(){return this.uniforms.uNoise},i.noise.set=function(t){this.uniforms.uNoise=t},i.seed.get=function(){return this.uniforms.uSeed},i.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,i),e}(mr),ws=new ge;Ne.prototype._cacheAsBitmap=!1,Ne.prototype._cacheData=!1;var Ss=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ne.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ss),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ne.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ne.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds().clone();if(this.filters){var r=this.filters[0].padding;i.pad(r)}i.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=xi.create(i.width,i.height),s="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=s,ni.addToCache(o.baseTexture,s),yi.addToCache(o,s);var a=ws;a.tx=-i.x,a.ty=-i.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Gn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-i.x/i.width,h.anchor.y=-i.y/i.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ne.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ne.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),i=this.alpha;this.alpha=1;var r=t.context;e.ceil(m.RESOLUTION);var n=xi.create(e.width,e.height),o="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=o,ni.addToCache(n.baseTexture,o),yi.addToCache(n,o);var s=ws;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Gn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=i,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ne.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ne.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ne.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ni.removeFromCache(this._cacheData.textureCacheId),yi.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ne.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ne.prototype.name=null,Be.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},i.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;jt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,i),e}(pr),Fs=function(t){function e(e,i,r){t.call(this);var n=new Ei(e),o=new Ei(i,!0),s=new Ei(r,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertexDirtyId:{configurable:!0}};return i.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,i),e}(Oi),Ls=function(t){function e(e,i,r,n){void 0===e&&(e=100),void 0===i&&(i=100),void 0===r&&(r=10),void 0===n&&(n=10),t.call(this),this.segWidth=r,this.segHeight=n,this.width=e,this.height=i,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],r=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,i=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width},i.width.get=function(){return this._width},i.width.set=function(t){this._width=t,this._refresh()},i.height.get=function(){return this._height},i.height.set=function(t){this._height=t,this._refresh()},i.leftWidth.get=function(){return this._leftWidth},i.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},i.rightWidth.get=function(){return this._rightWidth},i.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},i.topHeight.get=function(){return this._topHeight},i.topHeight.set=function(t){this._topHeight=t,this._refresh()},i.bottomHeight.get=function(){return this._bottomHeight},i.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,i),e}(Bs),Gs=function(t){function e(e,i){t.call(this,e[0]instanceof yi?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==i,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&Ve.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&Ve.shared.add(this.update,this,Ye.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramei&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],r=0;r0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=r(function(t){!function(e){var i=/iPhone/i,r=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(i,e)&&!g(u,e),ipod:g(r,e),tablet:!g(i,e)&&g(n,e)&&!g(u,e),device:(g(i,e)||g(r,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var i=navigator.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)>=11&&(e=!0)}if(g.android.device){var r=navigator.userAgent.match(/Android\s([0-9.]*)/);r&&parseInt(r[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=r(function(t){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new n(r,o||t,s),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 s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,r,n=[];if(0===this._eventsCount)return n;for(r in t=this._events)e.call(t,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,s=new Array(o);n80*i){r=o=t[0],n=s=t[1];for(var f=i;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-r,s-n))?1/u:0}return w(d,p,i,r,n,u),p}function T(t,e,i,r,n){var o,s;if(n===H(t,e,i,r)>0)for(o=e;o=e;o-=r)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!N(r,r.next)&&0!==L(r.prev,r,r.next))r=r.next;else{if(j(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function w(t,e,i,r,n,o,s){if(t){!s&&o&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,i,r)),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,r,n,o,s,a,h,u=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,r=i,a=0,e=0;e0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(s>1)}(n)}(t,r,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,r,n,o):S(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,i),e,i,r,n,o,2):2===s&&A(t,e,i,r,n,o):w(E(t),e,i,r,n,o,1);break}}}function S(t){var e=t.prev,i=t,r=t.next;if(L(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&L(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,i,r){var n=t.prev,o=t,s=t.next;if(L(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,i,r),d=M(u,l,e,i,r),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!N(n,o)&&U(n,r,r.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),j(r),j(r.next),r=t=o),r=r.next}while(r!==t);return r}function A(t,e,i,r,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&F(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,i,r,n,o),void w(h,e,i,r,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var i,r=e,n=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>s){if(s=a,a===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x=r.x&&r.x>=l&&n!==r.x&&R(oi.x)&&B(r,t)&&(i=r,d=h),r=r.next;return i}(t,e)){var i=k(e,t);E(i,i.next)}}function M(t,e,i,r,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-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,i=t;do{(e.x=0&&(t-s)*(r-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(n-s)*(r-a)>=0}function F(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&&U(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)}function L(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,i,r){return!!(N(t,e)&&N(i,r)||N(t,r)&&N(i,e))||L(t,e,i)>0!=L(t,e,r)>0&&L(i,r,t)>0!=L(i,r,e)>0}function B(t,e){return L(t.prev,t,t.next)<0?L(t,e,t.next)>=0&&L(t,t.prev,e)>=0:L(t,e,t.prev)<0||L(t,t.next,e)<0}function k(t,e){var i=new G(t.i,t.x,t.y),r=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function X(t,e,i,r){var n=new G(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function j(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 G(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 H(t,e,i,r){for(var n=0,o=e,s=i-r;o0&&(r+=t[n-1].length,i.holes.push(r))}return i},_.default=x;var Y=r(function(t,i){!function(r){var n=i&&!i.nodeType&&i,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(r=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function I(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,i,r=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,i){var r=0;for(t=i?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;r+=l)t=E(t/T);return E(r+(T+1)*t/(t+p))}function D(t){var e,i,r,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((i=t.lastIndexOf(m))<0&&(i=0),r=0;r=128&&S("not-basic"),_.push(t.charCodeAt(r));for(n=i>0?i+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,i,r,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,i=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(r=n=P.length,n&&P.push(m);r<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-i)/(x=r+1))&&S("overflow"),i+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=i,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(i,x,r==n),i=0,++r}++i,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else r.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,i,r){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,i,r){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(r){var n=encodeURIComponent(q(r))+i;return Array.isArray(t[r])?t[r].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[r]))}).join(e):r?encodeURIComponent(q(r))+i+encodeURIComponent(q(t)):""},K=r(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof it))return it.prototype.format.call(t);return t.format()},et=it;function it(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var rt=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,i){if(t&&z.isObject(t)&&t instanceof it)return t;var r=new it;return r.parse(t,e,i),r}it.prototype.parse=function(t,e,i){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),n=-1!==r&&r127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift());return i.search=t.search,i.query=t.query,z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!_.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var b=_.slice(-1)[0],T=(i.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(i.hostname=i.host=P?"":_.length?_.shift():"",(S=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift()));return(m=m||i.host&&_.length)&&!P&&_.unshift(""),_.length?i.pathname=_.join("/"):(i.pathname=null,i.path=null),z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},it.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch(t){return!1}}()),Ot}function Ft(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Lt(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}var Ut=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}();function Bt(t,e){return Ut[e?1:0][t]}function kt(t,e,i,r){return i=i||new Float32Array(4),r||void 0===r?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function Xt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,r=t>>8&255,n=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(n=n*e+.5|0)}function jt(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(r||void 0===r)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function Gt(t){for(var e=6*t,i=new Uint16Array(e),r=0,n=0;r=n||0===i)){var o=n-(i=e+i>n?n-e:i);for(r=e;r>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function qt(t){return!(t&t-1||!t)}function Zt(t){var e=(t>65535)<<4,i=((t>>>=e)>255)<<3;return e|=i,e|=i=((t>>>=i)>15)<<2,(e|=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1}var Kt={},Jt=Object.create(null),Qt=Object.create(null);function $t(t){var e,i,r,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];Ee.push(e);for(var i=0;i<16;i++)for(var r=we(ye[t]*ye[i]+xe[t]*_e[i]),n=we(_e[t]*ye[i]+be[t]*_e[i]),o=we(ye[t]*xe[i]+xe[t]*be[i]),s=we(_e[t]*xe[i]+be[t]*be[i]),a=0;a<16;a++)if(ye[a]===r&&_e[a]===n&&xe[a]===o&&be[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new ge;u.set(ye[h],_e[h],xe[h],be[h],0,0),Te.push(u)}}();var Se={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return ye[t]},uY:function(t){return _e[t]},vX:function(t){return xe[t]},vY:function(t){return be[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return Ee[t][e]},sub:function(t,e){return Ee[t][Se.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Se.S:Se.N:2*Math.abs(e)<=Math.abs(t)?t>0?Se.E:Se.W:e>0?t>0?Se.SE:Se.SW:t>0?Se.NE:Se.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=Te[Se.inv(e)];n.tx=i,n.ty=r,t.append(n)}},Pe=function(){this.worldTransform=new ge,this.localTransform=new ge,this.position=new le(this.onChange,this,0,0),this.scale=new le(this.onChange,this,1,1),this.pivot=new le(this.onChange,this,0,0),this.skew=new le(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ie={rotation:{configurable:!0}};Pe.prototype.onChange=function(){this._localID++},Pe.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Pe.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Pe.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},Pe.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ie.rotation.get=function(){return this._rotation},Ie.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Pe.prototype,Ie),Pe.IDENTITY=new Pe;var Ae=function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=ve.RECT},Oe={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Ce={EMPTY:{configurable:!0}};Oe.left.get=function(){return this.x},Oe.right.get=function(){return this.x+this.width},Oe.top.get=function(){return this.y},Oe.bottom.get=function(){return this.y+this.height},Ce.EMPTY.get=function(){return new Ae(0,0,0,0)},Ae.prototype.clone=function(){return new Ae(this.x,this.y,this.width,this.height)},Ae.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Ae.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Ae.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(i=!i)}return i};var Fe=function(t,e,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=ve.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var i=t-(this.x+this.radius),r=e-(this.y+this.radius),n=this.radius*this.radius;if(i*i+r*r<=n)return!0;if((i=t-(this.x+this.width-this.radius))*i+r*r<=n)return!0;if(i*i+(r=e-(this.y+this.height-this.radius))*r<=n)return!0;if((i=t-(this.x+this.radius))*i+r*r<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Le=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Le.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Le.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Le.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ae.EMPTY:((t=t||new Ae(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Le.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Le.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,o=t[0],s=t[1];e=or?o:r,n=s>n?s:n,e=(o=t[2])r?o:r,n=s>n?s:n,e=(o=t[4])r?o:r,n=s>n?s:n,e=(o=t[6])r?o:r,n=s>n?s:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},Le.prototype.addFrame=function(t,e,i,r,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*i+l,m=a*e+u*i+c;d=gf?g:f,v=m>v?m:v,d=(g=s*r+h*i+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*r+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Le.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=r,this.minY=n,this.maxX=o,this.maxY=s},Le.prototype.addVertices=function(t,e,i,r){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=i;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Le.prototype.addBounds=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minXr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},Le.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Le.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ne=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Pe,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Le,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var i=Object.keys(t),r=0;r1)for(var r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);Ht(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,i=arguments.length;if(i>1)for(var r=0;r0&&o<=n){i=this.children.splice(r,o);for(var s=0;s1&&this.children.sort(Ue),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},Xe.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},Xe.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},Xe.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},Xe.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},Xe.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},Xe.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},Xe.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},Ve.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Ve.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},Ve.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},Ve.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},Ve.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),i=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/i}},qe.shared.get=function(){if(!Ve._shared){var t=Ve._shared=new Ve;t.autoStart=!0,t._protected=!0}return Ve._shared},qe.system.get=function(){if(!Ve._system){var t=Ve._system=new Ve;t.autoStart=!0,t._protected=!0}return Ve._system},Object.defineProperties(Ve.prototype,We),Object.defineProperties(Ve,qe);var Ze=function(){};Ze.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ye.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Ve.shared:new Ve,t.autoStart&&this.start()},Ze.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Ke=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Ge("setRealSize",2),this.onUpdate=new Ge("update")},Je={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Ke.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Ke.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Ke.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Je.valid.get=function(){return!!this._width&&!!this._height},Ke.prototype.update=function(){this.destroyed||this.onUpdate.run()},Ke.prototype.load=function(){return Promise.resolve()},Je.width.get=function(){return this._width},Je.height.get=function(){return this._height},Ke.prototype.upload=function(t,e,i){return!1},Ke.prototype.style=function(t,e,i){return!1},Ke.prototype.dispose=function(){},Ke.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Ke.prototype,Je);var Qe=function(t){function e(e){var i=e.naturalWidth||e.videoWidth||e.width,r=e.naturalHeight||e.videoHeight||e.height;t.call(this,i,r),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=ne(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,r){var n=t.gl,o=e.realWidth,s=e.realHeight;return r=r||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&i.width===o&&i.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,r):(i.width=o,i.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,r)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,i=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Ke),$e=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLImageElement)){var r=new Image;t.crossOrigin(r,e,i.crossorigin),r.src=e,e=r}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==i.createBitmap?i.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==i.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==i.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var i=e.source,r=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?r():i.onload=r}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,i,r){if(i.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,i,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,r,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in i._glTextures){var s=i._glTextures[o];if(s!==r&&s.dirtyId!==i.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}(Qe),ti=[];function ei(t,e){if(!t)return null;var i="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(i=r[1].toLowerCase())}for(var n=ti.length-1;n>=0;--n){var o=ti[n];if(o.test&&o.test(t,i))return new o(t,e)}return new $e(t,e)}var ii=function(t){function e(e,i){var r=i||{},n=r.width,o=r.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;if(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height)r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{i.width=e.width,i.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),r.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Ke),ri={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},ni=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null),t.call(this);var r=(i=i||{}).premultiplyAlpha,n=i.mipmap,o=i.scaleMode,s=i.width,a=i.height,h=i.wrapMode,u=i.format,l=i.type,c=i.target,d=i.resolution,p=i.resourceOptions;!e||e instanceof Ke||((e=ei(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==r,this.uid=zt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={realWidth:{configurable:!0},realHeight:{configurable:!0}};return i.realWidth.get=function(){return this.width*this.resolution},i.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=qt(this.realWidth)&&qt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Qt[this.cacheId],delete Jt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,i){var r=null;"string"==typeof t?r=t:(t._pixiId||(t._pixiId="pixiid_"+zt()),r=t._pixiId);var n=Qt[r];return n||((n=new e(t,i)).cacheId=r,e.addToCache(n,r)),n},e.fromBuffer=function(t,i,r,n){t=t||new Float32Array(i*r*4);var o=new ii(t,{width:i,height:r}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(ri,n||{width:i,height:r,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Qt[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),Qt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=Qt[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var ui=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(r,e[0].src||e[0],i.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&Ve.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},i.autoUpdate.get=function(){return this._autoUpdate},i.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0))},i.updateFPS.get=function(){return this._updateFPS},i.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,i){return t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},Object.defineProperties(e.prototype,i),e}(Qe);ui.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],ti.push($e,si,ui,hi,ii,ai,oi);var li={INSTALLED:ti,autoDetectResource:ei,ArrayResource:oi,BufferResource:ii,CanvasResource:si,CubeResource:ai,ImageResource:$e,SVGResource:hi,VideoResource:ui,Resource:Ke,BaseImageResource:Qe},ci=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};ci.prototype.contextChange=function(t){},ci.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,r.texImage2D(e.target,0,r.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ii),pi=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ge("disposeFramebuffer",2)},fi={colorTexture:{configurable:!0}};fi.colorTexture.get=function(){return this.colorTextures[0]},pi.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new ni(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.addDepthTexture=function(t){return this.depthTexture=t||new ni(new di(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&e.textureCacheIds.splice(i,1),delete Jt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;rthis.baseTexture.width,s=i+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,u="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},i.rotate.get=function(){return this._rotate},i.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},i.width.get=function(){return this.orig.width},i.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,i),e}(y);function _i(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}yi.EMPTY=new yi(new ni),_i(yi.EMPTY),_i(yi.EMPTY.baseTexture),yi.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new yi(new ni(new si(t)))}(),_i(yi.WHITE),_i(yi.WHITE.baseTexture);var xi=function(t){function e(e,i){var r=null;if(!(e instanceof vi)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),r=arguments[0],i=null,e=new vi({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,i),this.legacyRenderer=r,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,i){void 0===i&&(i=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,i&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new vi(t))},e}(yi),bi=function(t,e,i,r,n,o,s){void 0===i&&(i=!1),void 0===r&&(r=5126),this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=o,this.instance=s};bi.prototype.destroy=function(){this.buffer=null},bi.from=function(t,e,i,r,n){return new bi(t,e,i,r,n)};var Ti=0,Ei=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=Ti++,this.disposeRunner=new Ge("disposeBuffer",2)};function wi(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}Ei.prototype.update=function(t){this.data=t||this.data,this._updateID++},Ei.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Ei.prototype.destroy=function(){this.dispose(),this.data=null},Ei.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new Ei(t)};var Si={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Pi={5126:4,5123:2,5121:1},Ii=0,Ai={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Oi=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ii++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new Ge("disposeGeometry",2),this.refCount=0};Oi.prototype.addAttribute=function(t,e,i,r,n,o,s,a){if(void 0===r&&(r=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new Ei(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),i},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,i),e}(ci),Xi=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new pi(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ae,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var i=this.gl;if(t){var r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,r.framebuffer)),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):r.dirtySize!==t.dirtySize&&(r.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}i.stencil||!t.stencil&&!t.depth||(i.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.stencil&&r.deleteRenderbuffer(i.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=r.data.byteLength)e.bufferSubData(o,0,r.data);else{var s=r.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=r.data.byteLength,e.bufferData(o,r.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var i=t.attributes,r=e.attributeData;for(var n in r)if(!i[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var i=t.attributes,r=e.attributeData,n=["g",t.id];for(var o in i)r[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var i=this.gl,r=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Gi[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Gi[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Gi[f.type])}s=i.createVertexArray(),i.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Zi=t,t}return Zi}function Ji(t,e,i){if("precision"!==t.substring(0,9)){var r=e;return e===At.HIGH&&i!==At.HIGH&&(r=At.MEDIUM),"precision "+r+" float;\n"+t}return i!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var Qi={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function $i(t){return Qi[t]}var tr=null,er={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ir(t,e){if(!tr){var i=Object.keys(er);tr={};for(var r=0;r0&&(e+="\nelse "),ie.name?1:-1});for(var u=0;u>=1,i++;this.stateId=t.data}for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,r=0;rthis.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,i=!0)}if(i){for(var o=0,s=0;s=0;i--)this.unload(t.children[i])},e}(ci),kr=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},Xr=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ni}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var i=this.gl;e.mipmap&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST):i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR:i.NEAREST),i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode?i.LINEAR:i.NEAREST)},e}(ci),jr={FilterSystem:Li,BatchSystem:Ui,ContextSystem:ki,FramebufferSystem:Xi,GeometrySystem:Hi,MaskSystem:wr,StencilSystem:Sr,ProjectionSystem:Pr,RenderTextureSystem:Ar,ShaderSystem:Mr,StateSystem:Ur,TextureGCSystem:Br,TextureSystem:Xr},Gr=new ge,Hr=function(t){function e(e,i){t.call(this),(i=Object.assign({},m.RENDER_OPTIONS,i)).roundPixels&&(m.ROUND_PIXELS=i.roundPixels,ae("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=i,this.type=yt.UNKNOWN,this.screen=new Ae(0,0,i.width,i.height),this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution||m.RESOLUTION,this.transparent=i.transparent,this.autoDensity=i.autoDensity||i.autoResize||!1,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new Be,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},i.width.get=function(){return this.view.width},i.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,i,r){0===(r=r||t.getLocalBounds()).width&&(r.width=1),0===r.height&&(r.height=1);var n=xi.create(0|r.width,0|r.height,e,i);return Gr.tx=-r.x,Gr.ty=-r.y,this.render(t,n,!1,Gr,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},i.backgroundColor.get=function(){return this._backgroundColor},i.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Lt(t),Ft(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,i),e}(y),Yr=function(t){function e(i){void 0===i&&(i={}),t.call(this,"WebGL",i),i=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new Ge("destroy"),contextChange:new Ge("contextChange",1),reset:new Ge("reset"),update:new Ge("update"),postrender:new Ge("postrender"),prerender:new Ge("prerender"),resize:new Ge("resize",2)},this.globalUniforms=new Ri({projectionMatrix:new ge},!0),this.addSystem(wr,"mask").addSystem(ki,"context").addSystem(Ur,"state").addSystem(Mr,"shader").addSystem(Xr,"texture").addSystem(Hi,"geometry").addSystem(Xi,"framebuffer").addSystem(Sr,"stencil").addSystem(Pr,"projection").addSystem(Br,"textureGC").addSystem(Li,"filter").addSystem(Ar,"renderTexture").addSystem(Ui,"batch"),this.initPlugins(e.__plugins),i.context?this.context.initFromContext(i.context):this.context.initFromOptions({alpha:this.transparent,antialias:i.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=i,this.runners)this.runners[r].add(i);return this},e.prototype.render=function(t,e,i,r,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=r,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.run(e,i)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(Hr);function zr(t){return Yr.create(t)}var Vr="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",Wr="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,i){return new e(new ai(t,i))},e}(ni),Zr=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new Ei(null,e,!1),this._indexBuffer=new Ei(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oi),Kr=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Jr=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Jr.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var Qr="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",$r=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),tn={},en={};function rn(t,e){if(!en[e]){for(var i=new Int32Array(e),r=0;r0&&(e+="\nelse "),ithis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=Wt(Math.ceil(t/12)),i=Zt(e),r=12*e;this.iBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.iBuffers[i];return n||(this.iBuffers[i]=n=new Uint16Array(r)),n},e.prototype.getAttributeBuffer=function(t){var e=Wt(Math.ceil(t/8)),i=Zt(e),r=8*e;this.aBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.aBuffers[r];return n||(this.aBuffers[r]=n=new Jr(r*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,i=this.renderer.gl,r=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++ni._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,i,r,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(r=!1),s=!0)}}return n&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),i&&i(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=e.length,r=0;rthis.maxSegments&&(i=this.maxSegments),i}},_n=function(){this.reset()};_n.prototype.clone=function(){var t=new _n;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},_n.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=yi.WHITE,this.matrix=null,this.visible=!1},_n.prototype.destroy=function(){this.texture=null,this.matrix=null};var xn=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]};xn.prototype.clone=function(){return new xn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},xn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var bn={build:function(t){var e,i,r=t.shape,n=t.points,o=r.x,s=r.y;if(n.length=0,t.type===ve.CIRC?(e=r.radius,i=r.radius):(e=r.width,i=r.height),0!==e&&0!==i){var a=Math.floor(30*Math.sqrt(r.radius))||Math.floor(15*Math.sqrt(r.width+r.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=r[2*(d-2)],m=r[2*(d-2)+1],y=r[2*(d-1)],_=r[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(r=In.pop()||new Cn,this.batches.push(r)),r.style=d,r.start=f,r.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),En.triangulate(a,this)):h.triangulate(a,this);else{Tn(a,this);for(var m=0;m0&&(o=An.pop()||new Kr,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(r,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}ni._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,i=sr?s+h:r;else if(c===ve.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,i=s-(h=n.radius+d/2)r?s+h:r;else if(c===ve.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,i=s-(h=n.height+d/2)r?s+h:r;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,i=(b=(v+s)/2)-(_=(h/a*g+m)/2)r?b+_:r)}else t=0,e=0,i=0,r=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=i-E,this._bounds.maxY=r+E},e.prototype.transformPoints=function(t,e){for(var i=0;i>16)+(65280&e)+((255&e)<<16),i);r-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,i,r,n,o){for(var s=0,a=e.length,h=i.frame;sl*a}},Ln.arc=function(t,e,i,r,n,o,s,a,h){for(var u=s-o,l=yn._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/de)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+i,(p*-x+f*_)*n+r)}};var Nn=function(t){function e(e,i,r,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*r,u=de/h,l=[],c=0;c0&&r>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:i,width:t,alpha:r,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Re,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Re,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,i,r,n),this},e.prototype.bezierCurveTo=function(t,e,i,r,n,o){return this._initCurve(),Rn.curveTo(t,e,i,r,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var o=this.currentPath.points,s=Ln.curveTo(t,e,i,r,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,i,r,n,o){if(void 0===o&&(o=!1),r===n)return this;if(!o&&n<=r?n+=de:o&&r<=n&&(r+=de),0===n-r)return this;var s=t+Math.cos(r)*i,a=e+Math.sin(r)*i,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Ln.arc(s,a,t,e,i,r,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(yi.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,i,r){void 0===t&&(t=yi.WHITE),void 0===e&&(e=16777215),void 0===i&&(i=1),void 0===r&&(r=null),this.currentPath&&this.startPoly();var n=i>0;return n?(r&&(r=r.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:i,texture:t,matrix:r,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,r){return this.drawShape(new Ae(t,e,i,r))},e.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new Fe(t,e,i,r,n))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new Me(t,e,i))},e.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new De(t,e,i,r))},e.prototype.drawPolygon=function(t){var e=arguments,i=t,r=!0;if(i.points&&(r=i.closeStroke,i=i.points),!Array.isArray(i)){i=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,i=t.b,r=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=r&&Xn.x=n&&Xn.y>16)+(65280&t)+((255&t)<<16)},i.texture.get=function(){return this._texture},i.texture.set=function(t){this._texture!==t&&(this._texture=t||yi.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,i),e}(Be),Hn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},Yn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Hn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},zn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Vn=function(t){this.styleID=0,this.reset(),Kn(this,t,t)},Wn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function qn(t){return"number"==typeof t?Lt(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Zn(t){if(Array.isArray(t)){for(var e=0;e=0;i--){var r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&zn.indexOf(r)<0&&(r='"'+r+'"'),e[i]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Vn.prototype,Wn);var Jn=function(t,e,i,r,n,o,s,a,h){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Jn.measureText=function(t,e,i,r){void 0===r&&(r=Jn._canvas),i=null==i?e.wordWrap:i;var n=e.toFontString(),o=Jn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=r.getContext("2d");s.font=n;for(var a=(i?Jn.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Jn.addLine(o),o="",n=0),Jn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Jn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Jn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Jn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Jn.addLine(o),o="",n=0),(o.length>0||!Jn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Jn.addLine(o,!1)},Jn.addLine=function(t,e){return void 0===e&&(e=!0),t=Jn.trimRight(t),t=e?t+"\n":t},Jn.getFromCache=function(t,e,i,r){var n=i[t];if(void 0===n){var o=t.length*e;n=r.measureText(t).width+o,i[t]=n}return n},Jn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Jn.collapseNewlines=function(t){return"normal"===t},Jn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var i=t[e];if(!Jn.isBreakingSpace(i))break;t=t.slice(0,-1)}return t},Jn.isNewline=function(t){return"string"==typeof t&&Jn._newlines.indexOf(t.charCodeAt(0))>=0},Jn.isBreakingSpace=function(t){return"string"==typeof t&&Jn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Jn.tokenize=function(t){var e=[],i="";if("string"!=typeof t)return e;for(var r=0;rs;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new eo(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(ho),this.registerFindHook(uo),this.registerFindHook(ro),this.registerFindHook(no),this.registerFindHook(oo),this.registerUploadHook(so),this.registerUploadHook(ao)};function ro(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var r=0;r=0;r--)this.add(t.children[r]);return this},io.prototype.destroy=function(){this.ticking&&Ve.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var lo=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(fo),this.registerUploadHook(co),this.registerUploadHook(po)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function co(t,e){return e instanceof ni&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function po(t,e){return e instanceof kn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function fo(t,e){return t instanceof kn&&(e.push(t),!0)}var vo=function(t){this.maxMilliseconds=t,this.frameStart=0};vo.prototype.beginFrame=function(){this.frameStart=Date.now()},vo.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),wo=(i(Eo),Eo.Resource,r(function(t,e){e.__esModule=!0,e.Loader=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=i,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,i){return e._loadResource(t,i)},this._queue=s.queue(this._boundLoadResource,r),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Do(No);No.Resource;var Uo=Ro(function(t,e){e.__esModule=!0,e.encodeBinary=r;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(t){for(var e="",r=0;r>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(r=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=r,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(i),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t,Ft(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(o=i);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(Bt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=kt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;cr&&(p=r),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=r&&Qo.x=n&&Qo.y0&&r.x>h&&(Ht(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,r.x=0,r.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,r.x=0,r.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},i.align.get=function(){return this._font.align},i.align.set=function(t){this._font.align=t||"left",this.dirty=!0},i.anchor.get=function(){return this._anchor},i.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},i.font.get=function(){return this._font},i.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},i.text.get=function(){return this._text},i.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},i.maxWidth.get=function(){return this._maxWidth},i.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},i.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},i.textWidth.get=function(){return this.validate(),this._textWidth},i.letterSpacing.get=function(){return this._letterSpacing},i.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},i.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,i){var r={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=oe(s[0].getAttribute("file"),m.RESOLUTION),h={};r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,r.chars={},i instanceof yi&&(i=[i]);for(var u=0;u=r&&(e=t-s-1),o+=a=a.replace("%value%",i[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=r||4,this.blur=i||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,i,r);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",vs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,Wr,fs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),r=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[i+(1-i)*n,n*(1-i)-o*r,n*(1-i)+o*r,0,0,n*(1-i)+o*r,i+n*(1-i),n*(1-i)-o*r,0,0,n*(1-i)-o*r,n*(1-i)+o*r,i+n*(1-i),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,r=-.5*(i-1),n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,i,r,n){var o=((i=i||16770432)>>16&255)/255,s=(i>>8&255)/255,a=(255&i)/255,h=((r=r||3375104)>>16&255)/255,u=(r>>8&255)/255,l=(255&r)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},i.matrix.get=function(){return this.uniforms.m},i.matrix.set=function(t){this.uniforms.m=t},i.alpha.get=function(){return this.uniforms.uAlpha},i.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,i),e}(mr);vs.prototype.grayscale=vs.prototype.greyscale;var gs="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ms="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",ys=function(t){function e(e,i){var r=new ge;e.renderable=!1,t.call(this,gs,ms,{mapSampler:e._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=r,null==i&&(i=20),this.scale=new ue(i,i)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={map:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,i,r)},i.map.get=function(){return this.uniforms.mapSampler},i.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,i),e}(mr),_s="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",xs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',bs=function(t){function e(){t.call(this,_s,xs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(mr),Ts="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",Es=function(t){function e(e,i){void 0===e&&(e=.5),void 0===i&&(i=Math.random()),t.call(this,Wr,Ts,{uNoise:0,uSeed:0}),this.noise=e,this.seed=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={noise:{configurable:!0},seed:{configurable:!0}};return i.noise.get=function(){return this.uniforms.uNoise},i.noise.set=function(t){this.uniforms.uNoise=t},i.seed.get=function(){return this.uniforms.uSeed},i.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,i),e}(mr),ws=new ge;Ne.prototype._cacheAsBitmap=!1,Ne.prototype._cacheData=!1;var Ss=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ne.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ss),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ne.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ne.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds().clone();if(this.filters){var r=this.filters[0].padding;i.pad(r)}i.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=xi.create(i.width,i.height),s="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=s,ni.addToCache(o.baseTexture,s),yi.addToCache(o,s);var a=ws;a.tx=-i.x,a.ty=-i.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Gn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-i.x/i.width,h.anchor.y=-i.y/i.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ne.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ne.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),i=this.alpha;this.alpha=1;var r=t.context;e.ceil(m.RESOLUTION);var n=xi.create(e.width,e.height),o="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=o,ni.addToCache(n.baseTexture,o),yi.addToCache(n,o);var s=ws;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Gn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=i,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ne.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ne.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ne.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ni.removeFromCache(this._cacheData.textureCacheId),yi.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ne.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ne.prototype.name=null,Be.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},i.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;jt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,i),e}(pr),Fs=function(t){function e(e,i,r){t.call(this);var n=new Ei(e),o=new Ei(i,!0),s=new Ei(r,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertexDirtyId:{configurable:!0}};return i.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,i),e}(Oi),Ls=function(t){function e(e,i,r,n){void 0===e&&(e=100),void 0===i&&(i=100),void 0===r&&(r=10),void 0===n&&(n=10),t.call(this),this.segWidth=r,this.segHeight=n,this.width=e,this.height=i,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],r=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,i=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width},i.width.get=function(){return this._width},i.width.set=function(t){this._width=t,this._refresh()},i.height.get=function(){return this._height},i.height.set=function(t){this._height=t,this._refresh()},i.leftWidth.get=function(){return this._leftWidth},i.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},i.rightWidth.get=function(){return this._rightWidth},i.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},i.topHeight.get=function(){return this._topHeight},i.topHeight.set=function(t){this._topHeight=t,this._refresh()},i.bottomHeight.get=function(){return this._bottomHeight},i.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,i),e}(Bs),Gs=function(t){function e(e,i){t.call(this,e[0]instanceof yi?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==i,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&Ve.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&Ve.shared.add(this.update,this,Ye.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramei&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],r=0;r0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+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 s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==F(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,r,i)),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,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(F(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&F(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(F(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&L(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&R(or.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function L(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)}function F(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||F(t,e,r)>0!=F(t,e,i)>0&&F(r,i,t)>0!=F(r,i,e)>0}function B(t,e){return F(t.prev,t,t.next)<0?F(t,e,t.next)>=0&&F(t,t.prev,e)>=0:F(t,e,t.prev)<0||F(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function X(t,e,r,i){var n=new G(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Ot}function Lt(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function Ut(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Bt=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function kt(t,e){return Bt[e?1:0][t]}function Xt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function jt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Gt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Kt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Jt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Ie.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Ie.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Fe=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=gf?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Ne.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Yt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort(Be),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=Vt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Zt(this.realWidth)&&Zt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $t[this.cacheId],delete Qt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+Vt()),i=t._pixiId);var n=$t[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$t[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Ft(t),Lt(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Lr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i0&&(e+="\nelse "),rthis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=qt(Math.ceil(t/12)),r=Kt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=qt(Math.ceil(t/8)),r=Kt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;ithis.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,r=si?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,r=s-(h=n.radius+d/2)i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,r=s-(h=n.height+d/2)i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;sl*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Le,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Le,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Ln.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Fe(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Lo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Lt(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(kt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Xt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=i&&$o.x=n&&$o.y0&&i.x>h&&(Yt(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ys="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",bs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ue.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ue.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Gt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Fs=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(Bs),Gs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;iw?w:E,e.moveTo(_,x+E),e.lineTo(_,x+T-E),e.quadraticCurveTo(_,x+T,_+E,x+T),e.lineTo(_+b-E,x+T),e.quadraticCurveTo(_+b,x+T,_+b,x+T-E),e.lineTo(_+b,x+E),e.quadraticCurveTo(_+b,x,_+b-E,x),e.lineTo(_+E,x),e.quadraticCurveTo(_,x,_,x+E),e.closePath()}}}},zs.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},zs.prototype.destroy=function(){};var qs=function(t){function e(r,i,n){var o;t.call(this,"Canvas",r,i,n),this.type=yt.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new zs(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),Ws()?(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="multiply",o[_t.SCREEN]="screen",o[_t.OVERLAY]="overlay",o[_t.DARKEN]="darken",o[_t.LIGHTEN]="lighten",o[_t.COLOR_DODGE]="color-dodge",o[_t.COLOR_BURN]="color-burn",o[_t.HARD_LIGHT]="hard-light",o[_t.SOFT_LIGHT]="soft-light",o[_t.DIFFERENCE]="difference",o[_t.EXCLUSION]="exclusion",o[_t.HUE]="hue",o[_t.SATURATION]="saturate",o[_t.COLOR]="color",o[_t.LUMINOSITY]="luminosity"):(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="source-over",o[_t.SCREEN]="source-over",o[_t.OVERLAY]="source-over",o[_t.DARKEN]="source-over",o[_t.LIGHTEN]="source-over",o[_t.COLOR_DODGE]="source-over",o[_t.COLOR_BURN]="source-over",o[_t.HARD_LIGHT]="source-over",o[_t.SOFT_LIGHT]="source-over",o[_t.DIFFERENCE]="source-over",o[_t.EXCLUSION]="source-over",o[_t.HUE]="source-over",o[_t.SATURATION]="source-over",o[_t.COLOR]="source-over",o[_t.LUMINOSITY]="source-over"),o[_t.NORMAL_NPM]=o[_t.NORMAL],o[_t.ADD_NPM]=o[_t.ADD],o[_t.SCREEN_NPM]=o[_t.SCREEN],o[_t.SRC_IN]="source-in",o[_t.SRC_OUT]="source-out",o[_t.SRC_ATOP]="source-atop",o[_t.DST_OVER]="destination-over",o[_t.DST_IN]="destination-in",o[_t.DST_OUT]="destination-out",o[_t.DST_ATOP]="destination-atop",o[_t.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,Dt("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ee(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=_t.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[_t.NORMAL],(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===_t.SRC_IN||t===_t.SRC_OUT||t===_t.DST_IN||t===_t.DST_ATOP;!e&&r&&(t=_t.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===wt.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi),Zs={getTintedCanvas:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=Zs.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=Zs.canvas||document.createElement("canvas");if(Zs.tintMethod(r,e,n),n.tintId=r._updateID,Zs.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,Zs.canvas=null;return n},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=Lt(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=w/Math.abs(t.worldTransform.a),P=w/Math.abs(t.worldTransform.d),I=(y+_+x)/3,A=(b+T+E)/3,O=y-I,C=b-A,M=Math.sqrt(O*O+C*C);y=I+O/M*(M+S),b=A+C/M*(M+P),C=T-A,_=I+(O=_-I)/(M=Math.sqrt(O*O+C*C))*(M+S),T=A+C/M*(M+P),C=E-A,x=I+(O=x-I)/(M=Math.sqrt(O*O+C*C))*(M+S),E=A+C/M*(M+P)}n.save(),n.beginPath(),n.moveTo(y,b),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=d*g+v*f+p*m-g*f-v*p-d*m,R=y*g+v*x+_*m-g*x-v*_-y*m,L=d*_+y*f+p*x-_*f-y*p-d*x,F=d*g*x+v*_*f+y*p*m-y*g*f-v*p*x-d*_*m,N=b*g+v*E+T*m-g*E-v*T-b*m,U=d*T+b*f+p*E-T*f-b*p-d*E,B=d*g*E+v*T*f+b*p*m-b*g*f-v*p*E-d*T*m;n.transform(R/D,N/D,L/D,U/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Js.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0){g=0,y=f[0],_=f[1];for(var b=2;b+2=0;S-=2)r.lineTo(f[S],f[S+1])}v[T].shape.closeStroke&&r.closePath()}}l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RECT)l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===ge.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke());else if(h.type===ge.ELIP){var P=2*u.width,I=2*u.height,A=u.x-P/2,O=u.y-I/2;r.beginPath();var C=P/2*.5522848,M=I/2*.5522848,D=A+P,R=O+I,L=A+P/2,F=O+I/2;r.moveTo(A,F),r.bezierCurveTo(A,F-M,L-C,O,L,O),r.bezierCurveTo(L+C,O,D,F-M,D,F),r.bezierCurveTo(D,F+M,L+C,R,L,R),r.bezierCurveTo(L-C,R,A,F+M,A,F),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RREC){var N=u.x,U=u.y,B=u.width,k=u.height,X=u.radius,j=Math.min(B,k)/2|0;X=X>j?j:X,r.beginPath(),r.moveTo(N,U+X),r.lineTo(N,U+k-X),r.quadraticCurveTo(N,U+k,N+X,U+k),r.lineTo(N+B-X,U+k),r.quadraticCurveTo(N+B,U+k,N+B,U+k-X),r.lineTo(N+B,U+X),r.quadraticCurveTo(N+B,U,N+B-X,U),r.lineTo(N+X,U),r.quadraticCurveTo(N,U,N,U+X),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}}},$s.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},$s.prototype.destroy=function(){this.renderer=null};var ta=new me;Xn.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=br.create(r.width,r.height,t,e);Qs||(Qs=new qs),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(ta),ta.invert(),ta.tx-=r.x,ta.ty-=r.y,Qs.render(this,i,!0,ta);var n=_r.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},Xn.prototype.cachedGraphicsData=[],Xn.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var ea=new me,ra=function(t){this.renderer=t};ra.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===wt.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(ea),s=ea,Pe.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution|0,s.ty*r.resolution|0),a|=0,h|=0):r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution,s.ty*r.resolution);var c=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Zs.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution)):i.drawImage(u,e._frame.x*c,e._frame.y*c,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),d&&i.restore(),r.setBlendMode(_t.NORMAL)}},ra.prototype.destroy=function(){this.renderer=null},Hn.prototype._tintedCanvas=null,Hn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var ia=new Oe,na=function(t){this.renderer=t,t.extract=this};na.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},na.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},na.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=ia).width=this.renderer.width,i.height=this.renderer.height);var s=i.width*r,a=i.height*r,h=new ee(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},na.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=ia).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},na.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var oa={CanvasExtract:na},sa=16,aa=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=sa,this.canvas.height=sa,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ha)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(io);function ha(t,e){if(e instanceof or){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}var ua={CanvasPrepare:aa};ts.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ee(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Zs.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,u),r.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(h+c,u+d),r.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},zo.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+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 s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==F(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,r,i)),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,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(F(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&F(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(F(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&F(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&F(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&L(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&R(or.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function L(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)}function F(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||F(t,e,r)>0!=F(t,e,i)>0&&F(r,i,t)>0!=F(r,i,e)>0}function B(t,e){return F(t.prev,t,t.next)<0?F(t,e,t.next)>=0&&F(t,t.prev,e)>=0:F(t,e,t.prev)<0||F(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function X(t,e,r,i){var n=new G(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Ot}function Lt(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Ft(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function Ut(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Bt=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function kt(t,e){return Bt[e?1:0][t]}function Xt(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function jt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function Gt(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ht(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function Zt(t){return!(t&t-1||!t)}function Kt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Jt={},Qt=Object.create(null),$t=Object.create(null);function te(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Ie.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Ie.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Fe=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=gf?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Ne.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Yt(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort(Be),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},We.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},We.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=Vt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Zt(this.realWidth)&&Zt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $t[this.cacheId],delete Qt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+Vt()),i=t._pixiId);var n=$t[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$t[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Ft(t),Lt(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Lr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",qi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i0&&(e+="\nelse "),rthis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=qt(Math.ceil(t/12)),r=Kt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=qt(Math.ceil(t/8)),r=Kt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;ithis.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,r=si?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,r=s-(h=n.radius+d/2)i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,r=s-(h=n.height+d/2)i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;sl*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Le,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Le,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Ln.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Fe(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=i&&jn.x=n&&jn.y>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Ft(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Lo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Lt(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(kt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Xt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=i&&$o.x=n&&$o.y0&&i.x>h&&(Yt(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ys="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",bs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ue.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ue.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+Vt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Gt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Fs=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(Bs),Gs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;iw?w:E,e.moveTo(_,x+E),e.lineTo(_,x+T-E),e.quadraticCurveTo(_,x+T,_+E,x+T),e.lineTo(_+b-E,x+T),e.quadraticCurveTo(_+b,x+T,_+b,x+T-E),e.lineTo(_+b,x+E),e.quadraticCurveTo(_+b,x,_+b-E,x),e.lineTo(_+E,x),e.quadraticCurveTo(_,x,_,x+E),e.closePath()}}}},zs.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},zs.prototype.destroy=function(){};var qs=function(t){function e(r,i,n){var o;t.call(this,"Canvas",r,i,n),this.type=yt.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new zs(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),Ws()?(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="multiply",o[_t.SCREEN]="screen",o[_t.OVERLAY]="overlay",o[_t.DARKEN]="darken",o[_t.LIGHTEN]="lighten",o[_t.COLOR_DODGE]="color-dodge",o[_t.COLOR_BURN]="color-burn",o[_t.HARD_LIGHT]="hard-light",o[_t.SOFT_LIGHT]="soft-light",o[_t.DIFFERENCE]="difference",o[_t.EXCLUSION]="exclusion",o[_t.HUE]="hue",o[_t.SATURATION]="saturate",o[_t.COLOR]="color",o[_t.LUMINOSITY]="luminosity"):(o[_t.NORMAL]="source-over",o[_t.ADD]="lighter",o[_t.MULTIPLY]="source-over",o[_t.SCREEN]="source-over",o[_t.OVERLAY]="source-over",o[_t.DARKEN]="source-over",o[_t.LIGHTEN]="source-over",o[_t.COLOR_DODGE]="source-over",o[_t.COLOR_BURN]="source-over",o[_t.HARD_LIGHT]="source-over",o[_t.SOFT_LIGHT]="source-over",o[_t.DIFFERENCE]="source-over",o[_t.EXCLUSION]="source-over",o[_t.HUE]="source-over",o[_t.SATURATION]="source-over",o[_t.COLOR]="source-over",o[_t.LUMINOSITY]="source-over"),o[_t.NORMAL_NPM]=o[_t.NORMAL],o[_t.ADD_NPM]=o[_t.ADD],o[_t.SCREEN_NPM]=o[_t.SCREEN],o[_t.SRC_IN]="source-in",o[_t.SRC_OUT]="source-out",o[_t.SRC_ATOP]="source-atop",o[_t.DST_OVER]="destination-over",o[_t.DST_IN]="destination-in",o[_t.DST_OUT]="destination-out",o[_t.DST_ATOP]="destination-atop",o[_t.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,Dt("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ee(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=_t.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[_t.NORMAL],(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===_t.SRC_IN||t===_t.SRC_OUT||t===_t.DST_IN||t===_t.DST_ATOP;!e&&r&&(t=_t.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===wt.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi),Zs={getTintedCanvas:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=Zs.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=Zs.canvas||document.createElement("canvas");if(Zs.tintMethod(r,e,n),n.tintId=r._updateID,Zs.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,Zs.canvas=null;return n},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=Lt(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=w/Math.abs(t.worldTransform.a),P=w/Math.abs(t.worldTransform.d),I=(y+_+x)/3,A=(b+T+E)/3,O=y-I,C=b-A,M=Math.sqrt(O*O+C*C);y=I+O/M*(M+S),b=A+C/M*(M+P),C=T-A,_=I+(O=_-I)/(M=Math.sqrt(O*O+C*C))*(M+S),T=A+C/M*(M+P),C=E-A,x=I+(O=x-I)/(M=Math.sqrt(O*O+C*C))*(M+S),E=A+C/M*(M+P)}n.save(),n.beginPath(),n.moveTo(y,b),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=d*g+v*f+p*m-g*f-v*p-d*m,R=y*g+v*x+_*m-g*x-v*_-y*m,L=d*_+y*f+p*x-_*f-y*p-d*x,F=d*g*x+v*_*f+y*p*m-y*g*f-v*p*x-d*_*m,N=b*g+v*E+T*m-g*E-v*T-b*m,U=d*T+b*f+p*E-T*f-b*p-d*E,B=d*g*E+v*T*f+b*p*m-b*g*f-v*p*E-d*T*m;n.transform(R/D,N/D,L/D,U/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Js.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0){g=0,y=f[0],_=f[1];for(var b=2;b+2=0;S-=2)r.lineTo(f[S],f[S+1])}v[T].shape.closeStroke&&r.closePath()}}l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RECT)l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===ge.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke());else if(h.type===ge.ELIP){var P=2*u.width,I=2*u.height,A=u.x-P/2,O=u.y-I/2;r.beginPath();var C=P/2*.5522848,M=I/2*.5522848,D=A+P,R=O+I,L=A+P/2,F=O+I/2;r.moveTo(A,F),r.bezierCurveTo(A,F-M,L-C,O,L,O),r.bezierCurveTo(L+C,O,D,F-M,D,F),r.bezierCurveTo(D,F+M,L+C,R,L,R),r.bezierCurveTo(L-C,R,A,F+M,A,F),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}else if(h.type===ge.RREC){var N=u.x,U=u.y,B=u.width,k=u.height,X=u.radius,j=Math.min(B,k)/2|0;X=X>j?j:X,r.beginPath(),r.moveTo(N,U+X),r.lineTo(N,U+k-X),r.quadraticCurveTo(N,U+k,N+X,U+k),r.lineTo(N+B-X,U+k),r.quadraticCurveTo(N+B,U+k,N+B,U+k-X),r.lineTo(N+B,U+X),r.quadraticCurveTo(N+B,U,N+B-X,U),r.lineTo(N+X,U),r.quadraticCurveTo(N,U,N,U+X),r.closePath(),l.visible&&(r.globalAlpha=l.alpha*i,r.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),r.fill()),c.visible&&(r.globalAlpha=c.alpha*i,r.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),r.stroke())}}},$s.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},$s.prototype.destroy=function(){this.renderer=null};var ta=new me;Xn.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=br.create(r.width,r.height,t,e);Qs||(Qs=new qs),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(ta),ta.invert(),ta.tx-=r.x,ta.ty-=r.y,Qs.render(this,i,!0,ta);var n=_r.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},Xn.prototype.cachedGraphicsData=[],Xn.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var ea=new me,ra=function(t){this.renderer=t};ra.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===wt.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(ea),s=ea,Pe.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution|0,s.ty*r.resolution|0),a|=0,h|=0):r.context.setTransform(s.a,s.b,s.c,s.d,s.tx*r.resolution,s.ty*r.resolution);var c=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Zs.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution)):i.drawImage(u,e._frame.x*c,e._frame.y*c,n*c,o*c,a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),d&&i.restore(),r.setBlendMode(_t.NORMAL)}},ra.prototype.destroy=function(){this.renderer=null},Hn.prototype._tintedCanvas=null,Hn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var ia=new Oe,na=function(t){this.renderer=t,t.extract=this};na.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},na.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},na.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=ia).width=this.renderer.width,i.height=this.renderer.height);var s=i.width*r,a=i.height*r,h=new ee(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},na.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof br?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=ia).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},na.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var oa={CanvasExtract:na},sa=16,aa=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=sa,this.canvas.height=sa,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ha)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(io);function ha(t,e){if(e instanceof or){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}var ua={CanvasPrepare:aa};ts.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ee(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Zs.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(h,u),r.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(h+c,u+d),r.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},zo.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=r(function(t){!function(e){var i=/iPhone/i,r=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(i,e)&&!g(u,e),ipod:g(r,e),tablet:!g(i,e)&&g(n,e)&&!g(u,e),device:(g(i,e)||g(r,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var i=navigator.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)>=11&&(e=!0)}if(g.android.device){var r=navigator.userAgent.match(/Android\s([0-9.]*)/);r&&parseInt(r[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=r(function(t){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new n(r,o||t,s),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 s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,r,n=[];if(0===this._eventsCount)return n;for(r in t=this._events)e.call(t,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,s=new Array(o);n80*i){r=o=t[0],n=s=t[1];for(var f=i;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-r,s-n))?1/u:0}return w(d,p,i,r,n,u),p}function T(t,e,i,r,n){var o,s;if(n===H(t,e,i,r)>0)for(o=e;o=e;o-=r)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!N(r,r.next)&&0!==L(r.prev,r,r.next))r=r.next;else{if(j(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function w(t,e,i,r,n,o,s){if(t){!s&&o&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,i,r)),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,r,n,o,s,a,h,u=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,r=i,a=0,e=0;e0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(s>1)}(n)}(t,r,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,r,n,o):S(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,i),e,i,r,n,o,2):2===s&&A(t,e,i,r,n,o):w(E(t),e,i,r,n,o,1);break}}}function S(t){var e=t.prev,i=t,r=t.next;if(L(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&L(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,i,r){var n=t.prev,o=t,s=t.next;if(L(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,i,r),d=M(u,l,e,i,r),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!N(n,o)&&U(n,r,r.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),j(r),j(r.next),r=t=o),r=r.next}while(r!==t);return r}function A(t,e,i,r,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&F(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,i,r,n,o),void w(h,e,i,r,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var i,r=e,n=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>s){if(s=a,a===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x=r.x&&r.x>=l&&n!==r.x&&R(oi.x)&&B(r,t)&&(i=r,d=h),r=r.next;return i}(t,e)){var i=k(e,t);E(i,i.next)}}function M(t,e,i,r,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-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,i=t;do{(e.x=0&&(t-s)*(r-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(n-s)*(r-a)>=0}function F(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&&U(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)}function L(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,i,r){return!!(N(t,e)&&N(i,r)||N(t,r)&&N(i,e))||L(t,e,i)>0!=L(t,e,r)>0&&L(i,r,t)>0!=L(i,r,e)>0}function B(t,e){return L(t.prev,t,t.next)<0?L(t,e,t.next)>=0&&L(t,t.prev,e)>=0:L(t,e,t.prev)<0||L(t,t.next,e)<0}function k(t,e){var i=new G(t.i,t.x,t.y),r=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function X(t,e,i,r){var n=new G(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function j(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 G(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 H(t,e,i,r){for(var n=0,o=e,s=i-r;o0&&(r+=t[n-1].length,i.holes.push(r))}return i},_.default=x;var Y=r(function(t,i){!function(r){var n=i&&!i.nodeType&&i,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(r=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function I(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,i,r=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,i){var r=0;for(t=i?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;r+=l)t=E(t/T);return E(r+(T+1)*t/(t+p))}function D(t){var e,i,r,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((i=t.lastIndexOf(m))<0&&(i=0),r=0;r=128&&S("not-basic"),_.push(t.charCodeAt(r));for(n=i>0?i+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,i,r,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,i=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(r=n=P.length,n&&P.push(m);r<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-i)/(x=r+1))&&S("overflow"),i+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=i,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(i,x,r==n),i=0,++r}++i,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else r.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,i,r){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,i,r){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(r){var n=encodeURIComponent(q(r))+i;return Array.isArray(t[r])?t[r].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[r]))}).join(e):r?encodeURIComponent(q(r))+i+encodeURIComponent(q(t)):""},K=r(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof it))return it.prototype.format.call(t);return t.format()},et=it;function it(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var rt=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,i){if(t&&z.isObject(t)&&t instanceof it)return t;var r=new it;return r.parse(t,e,i),r}it.prototype.parse=function(t,e,i){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),n=-1!==r&&r127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift());return i.search=t.search,i.query=t.query,z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!_.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var b=_.slice(-1)[0],T=(i.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(i.hostname=i.host=P?"":_.length?_.shift():"",(S=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift()));return(m=m||i.host&&_.length)&&!P&&_.unshift(""),_.length?i.pathname=_.join("/"):(i.pathname=null,i.path=null),z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},it.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch(t){return!1}}()),Ot}function Ft(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Lt(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}var Ut=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}();function Bt(t,e){return Ut[e?1:0][t]}function kt(t,e,i,r){return i=i||new Float32Array(4),r||void 0===r?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function Xt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,r=t>>8&255,n=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(n=n*e+.5|0)}function jt(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(r||void 0===r)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function Gt(t){for(var e=6*t,i=new Uint16Array(e),r=0,n=0;r=n||0===i)){var o=n-(i=e+i>n?n-e:i);for(r=e;r>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function qt(t){return!(t&t-1||!t)}function Zt(t){var e=(t>65535)<<4,i=((t>>>=e)>255)<<3;return e|=i,e|=i=((t>>>=i)>15)<<2,(e|=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1}var Kt={},Jt=Object.create(null),Qt=Object.create(null);function $t(t){var e,i,r,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];Ee.push(e);for(var i=0;i<16;i++)for(var r=we(ye[t]*ye[i]+xe[t]*_e[i]),n=we(_e[t]*ye[i]+be[t]*_e[i]),o=we(ye[t]*xe[i]+xe[t]*be[i]),s=we(_e[t]*xe[i]+be[t]*be[i]),a=0;a<16;a++)if(ye[a]===r&&_e[a]===n&&xe[a]===o&&be[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new ge;u.set(ye[h],_e[h],xe[h],be[h],0,0),Te.push(u)}}();var Se={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return ye[t]},uY:function(t){return _e[t]},vX:function(t){return xe[t]},vY:function(t){return be[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return Ee[t][e]},sub:function(t,e){return Ee[t][Se.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Se.S:Se.N:2*Math.abs(e)<=Math.abs(t)?t>0?Se.E:Se.W:e>0?t>0?Se.SE:Se.SW:t>0?Se.NE:Se.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=Te[Se.inv(e)];n.tx=i,n.ty=r,t.append(n)}},Pe=function(){this.worldTransform=new ge,this.localTransform=new ge,this.position=new le(this.onChange,this,0,0),this.scale=new le(this.onChange,this,1,1),this.pivot=new le(this.onChange,this,0,0),this.skew=new le(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ie={rotation:{configurable:!0}};Pe.prototype.onChange=function(){this._localID++},Pe.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Pe.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Pe.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},Pe.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ie.rotation.get=function(){return this._rotation},Ie.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Pe.prototype,Ie),Pe.IDENTITY=new Pe;var Ae=function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=ve.RECT},Oe={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Ce={EMPTY:{configurable:!0}};Oe.left.get=function(){return this.x},Oe.right.get=function(){return this.x+this.width},Oe.top.get=function(){return this.y},Oe.bottom.get=function(){return this.y+this.height},Ce.EMPTY.get=function(){return new Ae(0,0,0,0)},Ae.prototype.clone=function(){return new Ae(this.x,this.y,this.width,this.height)},Ae.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Ae.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Ae.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(i=!i)}return i};var Fe=function(t,e,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=ve.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var i=t-(this.x+this.radius),r=e-(this.y+this.radius),n=this.radius*this.radius;if(i*i+r*r<=n)return!0;if((i=t-(this.x+this.width-this.radius))*i+r*r<=n)return!0;if(i*i+(r=e-(this.y+this.height-this.radius))*r<=n)return!0;if((i=t-(this.x+this.radius))*i+r*r<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Le=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Le.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Le.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Le.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ae.EMPTY:((t=t||new Ae(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Le.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Le.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,o=t[0],s=t[1];e=or?o:r,n=s>n?s:n,e=(o=t[2])r?o:r,n=s>n?s:n,e=(o=t[4])r?o:r,n=s>n?s:n,e=(o=t[6])r?o:r,n=s>n?s:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},Le.prototype.addFrame=function(t,e,i,r,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*i+l,m=a*e+u*i+c;d=gf?g:f,v=m>v?m:v,d=(g=s*r+h*i+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*r+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Le.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=r,this.minY=n,this.maxX=o,this.maxY=s},Le.prototype.addVertices=function(t,e,i,r){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=i;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Le.prototype.addBounds=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minXr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},Le.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Le.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ne=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Pe,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Le,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var i=Object.keys(t),r=0;r1)for(var r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);Ht(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,i=arguments.length;if(i>1)for(var r=0;r0&&o<=n){i=this.children.splice(r,o);for(var s=0;s1&&this.children.sort(Ue),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},Xe.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},Xe.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},Xe.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},Xe.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},Xe.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},Xe.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},Xe.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},Ve.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Ve.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},Ve.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},Ve.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},Ve.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),i=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/i}},qe.shared.get=function(){if(!Ve._shared){var t=Ve._shared=new Ve;t.autoStart=!0,t._protected=!0}return Ve._shared},qe.system.get=function(){if(!Ve._system){var t=Ve._system=new Ve;t.autoStart=!0,t._protected=!0}return Ve._system},Object.defineProperties(Ve.prototype,We),Object.defineProperties(Ve,qe);var Ze=function(){};Ze.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ye.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Ve.shared:new Ve,t.autoStart&&this.start()},Ze.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Ke=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Ge("setRealSize",2),this.onUpdate=new Ge("update")},Je={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Ke.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Ke.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Ke.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Je.valid.get=function(){return!!this._width&&!!this._height},Ke.prototype.update=function(){this.destroyed||this.onUpdate.run()},Ke.prototype.load=function(){return Promise.resolve()},Je.width.get=function(){return this._width},Je.height.get=function(){return this._height},Ke.prototype.upload=function(t,e,i){return!1},Ke.prototype.style=function(t,e,i){return!1},Ke.prototype.dispose=function(){},Ke.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Ke.prototype,Je);var Qe=function(t){function e(e){var i=e.naturalWidth||e.videoWidth||e.width,r=e.naturalHeight||e.videoHeight||e.height;t.call(this,i,r),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=ne(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,r){var n=t.gl,o=e.realWidth,s=e.realHeight;return r=r||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&i.width===o&&i.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,r):(i.width=o,i.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,r)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,i=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Ke),$e=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLImageElement)){var r=new Image;t.crossOrigin(r,e,i.crossorigin),r.src=e,e=r}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==i.createBitmap?i.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==i.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==i.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var i=e.source,r=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?r():i.onload=r}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,i,r){if(i.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,i,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,r,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in i._glTextures){var s=i._glTextures[o];if(s!==r&&s.dirtyId!==i.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}(Qe),ti=[];function ei(t,e){if(!t)return null;var i="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(i=r[1].toLowerCase())}for(var n=ti.length-1;n>=0;--n){var o=ti[n];if(o.test&&o.test(t,i))return new o(t,e)}return new $e(t,e)}var ii=function(t){function e(e,i){var r=i||{},n=r.width,o=r.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;if(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height)r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{i.width=e.width,i.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),r.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Ke),ri={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},ni=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null),t.call(this);var r=(i=i||{}).premultiplyAlpha,n=i.mipmap,o=i.scaleMode,s=i.width,a=i.height,h=i.wrapMode,u=i.format,l=i.type,c=i.target,d=i.resolution,p=i.resourceOptions;!e||e instanceof Ke||((e=ei(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==r,this.uid=zt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={realWidth:{configurable:!0},realHeight:{configurable:!0}};return i.realWidth.get=function(){return this.width*this.resolution},i.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=qt(this.realWidth)&&qt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Qt[this.cacheId],delete Jt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,i){var r=null;"string"==typeof t?r=t:(t._pixiId||(t._pixiId="pixiid_"+zt()),r=t._pixiId);var n=Qt[r];return n||((n=new e(t,i)).cacheId=r,e.addToCache(n,r)),n},e.fromBuffer=function(t,i,r,n){t=t||new Float32Array(i*r*4);var o=new ii(t,{width:i,height:r}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(ri,n||{width:i,height:r,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Qt[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),Qt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=Qt[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var ui=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(r,e[0].src||e[0],i.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&Ve.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},i.autoUpdate.get=function(){return this._autoUpdate},i.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0))},i.updateFPS.get=function(){return this._updateFPS},i.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,i){return t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},Object.defineProperties(e.prototype,i),e}(Qe);ui.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],ti.push($e,si,ui,hi,ii,ai,oi);var li={INSTALLED:ti,autoDetectResource:ei,ArrayResource:oi,BufferResource:ii,CanvasResource:si,CubeResource:ai,ImageResource:$e,SVGResource:hi,VideoResource:ui,Resource:Ke,BaseImageResource:Qe},ci=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};ci.prototype.contextChange=function(t){},ci.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,r.texImage2D(e.target,0,r.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ii),pi=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ge("disposeFramebuffer",2)},fi={colorTexture:{configurable:!0}};fi.colorTexture.get=function(){return this.colorTextures[0]},pi.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new ni(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.addDepthTexture=function(t){return this.depthTexture=t||new ni(new di(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&e.textureCacheIds.splice(i,1),delete Jt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;rthis.baseTexture.width,s=i+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,u="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},i.rotate.get=function(){return this._rotate},i.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},i.width.get=function(){return this.orig.width},i.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,i),e}(y);function _i(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}yi.EMPTY=new yi(new ni),_i(yi.EMPTY),_i(yi.EMPTY.baseTexture),yi.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new yi(new ni(new si(t)))}(),_i(yi.WHITE),_i(yi.WHITE.baseTexture);var xi=function(t){function e(e,i){var r=null;if(!(e instanceof vi)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),r=arguments[0],i=null,e=new vi({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,i),this.legacyRenderer=r,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,i){void 0===i&&(i=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,i&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new vi(t))},e}(yi),bi=function(t,e,i,r,n,o,s){void 0===i&&(i=!1),void 0===r&&(r=5126),this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=o,this.instance=s};bi.prototype.destroy=function(){this.buffer=null},bi.from=function(t,e,i,r,n){return new bi(t,e,i,r,n)};var Ti=0,Ei=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=Ti++,this.disposeRunner=new Ge("disposeBuffer",2)};function wi(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}Ei.prototype.update=function(t){this.data=t||this.data,this._updateID++},Ei.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Ei.prototype.destroy=function(){this.dispose(),this.data=null},Ei.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new Ei(t)};var Si={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Pi={5126:4,5123:2,5121:1},Ii=0,Ai={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Oi=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ii++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new Ge("disposeGeometry",2),this.refCount=0};Oi.prototype.addAttribute=function(t,e,i,r,n,o,s,a){if(void 0===r&&(r=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new Ei(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),i},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,i),e}(ci),Xi=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new pi(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ae,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var i=this.gl;if(t){var r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,r.framebuffer)),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):r.dirtySize!==t.dirtySize&&(r.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}i.stencil||!t.stencil&&!t.depth||(i.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.stencil&&r.deleteRenderbuffer(i.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=r.data.byteLength)e.bufferSubData(o,0,r.data);else{var s=r.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=r.data.byteLength,e.bufferData(o,r.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var i=t.attributes,r=e.attributeData;for(var n in r)if(!i[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var i=t.attributes,r=e.attributeData,n=["g",t.id];for(var o in i)r[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var i=this.gl,r=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Gi[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Gi[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Gi[f.type])}s=i.createVertexArray(),i.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Zi=t,t}return Zi}function Ji(t,e,i){if("precision"!==t.substring(0,9)){var r=e;return e===At.HIGH&&i!==At.HIGH&&(r=At.MEDIUM),"precision "+r+" float;\n"+t}return i!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var Qi={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function $i(t){return Qi[t]}var tr=null,er={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ir(t,e){if(!tr){var i=Object.keys(er);tr={};for(var r=0;r0&&(e+="\nelse "),ie.name?1:-1});for(var u=0;u>=1,i++;this.stateId=t.data}for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,r=0;rthis.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,i=!0)}if(i){for(var o=0,s=0;s=0;i--)this.unload(t.children[i])},e}(ci),kr=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},Xr=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ni}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var i=this.gl;e.mipmap&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST):i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR:i.NEAREST),i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode?i.LINEAR:i.NEAREST)},e}(ci),jr={FilterSystem:Li,BatchSystem:Ui,ContextSystem:ki,FramebufferSystem:Xi,GeometrySystem:Hi,MaskSystem:wr,StencilSystem:Sr,ProjectionSystem:Pr,RenderTextureSystem:Ar,ShaderSystem:Mr,StateSystem:Ur,TextureGCSystem:Br,TextureSystem:Xr},Gr=new ge,Hr=function(t){function e(e,i){t.call(this),(i=Object.assign({},m.RENDER_OPTIONS,i)).roundPixels&&(m.ROUND_PIXELS=i.roundPixels,ae("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=i,this.type=yt.UNKNOWN,this.screen=new Ae(0,0,i.width,i.height),this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution||m.RESOLUTION,this.transparent=i.transparent,this.autoDensity=i.autoDensity||i.autoResize||!1,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new Be,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},i.width.get=function(){return this.view.width},i.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,i,r){0===(r=r||t.getLocalBounds()).width&&(r.width=1),0===r.height&&(r.height=1);var n=xi.create(0|r.width,0|r.height,e,i);return Gr.tx=-r.x,Gr.ty=-r.y,this.render(t,n,!1,Gr,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},i.backgroundColor.get=function(){return this._backgroundColor},i.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Lt(t),Ft(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,i),e}(y),Yr=function(t){function e(i){void 0===i&&(i={}),t.call(this,"WebGL",i),i=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new Ge("destroy"),contextChange:new Ge("contextChange",1),reset:new Ge("reset"),update:new Ge("update"),postrender:new Ge("postrender"),prerender:new Ge("prerender"),resize:new Ge("resize",2)},this.globalUniforms=new Ri({projectionMatrix:new ge},!0),this.addSystem(wr,"mask").addSystem(ki,"context").addSystem(Ur,"state").addSystem(Mr,"shader").addSystem(Xr,"texture").addSystem(Hi,"geometry").addSystem(Xi,"framebuffer").addSystem(Sr,"stencil").addSystem(Pr,"projection").addSystem(Br,"textureGC").addSystem(Li,"filter").addSystem(Ar,"renderTexture").addSystem(Ui,"batch"),this.initPlugins(e.__plugins),i.context?this.context.initFromContext(i.context):this.context.initFromOptions({alpha:this.transparent,antialias:i.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=i,this.runners)this.runners[r].add(i);return this},e.prototype.render=function(t,e,i,r,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=r,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.run(e,i)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(Hr);function zr(t){return Yr.create(t)}var Vr="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",Wr="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,i){return new e(new ai(t,i))},e}(ni),Zr=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new Ei(null,e,!1),this._indexBuffer=new Ei(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oi),Kr=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Jr=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Jr.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var Qr="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",$r=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),tn={},en={};function rn(t,e){if(!en[e]){for(var i=new Int32Array(e),r=0;r0&&(e+="\nelse "),ithis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=Wt(Math.ceil(t/12)),i=Zt(e),r=12*e;this.iBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.iBuffers[i];return n||(this.iBuffers[i]=n=new Uint16Array(r)),n},e.prototype.getAttributeBuffer=function(t){var e=Wt(Math.ceil(t/8)),i=Zt(e),r=8*e;this.aBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.aBuffers[r];return n||(this.aBuffers[r]=n=new Jr(r*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,i=this.renderer.gl,r=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++ni._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,i,r,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(r=!1),s=!0)}}return n&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),i&&i(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=e.length,r=0;rthis.maxSegments&&(i=this.maxSegments),i}},_n=function(){this.reset()};_n.prototype.clone=function(){var t=new _n;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},_n.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=yi.WHITE,this.matrix=null,this.visible=!1},_n.prototype.destroy=function(){this.texture=null,this.matrix=null};var xn=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]};xn.prototype.clone=function(){return new xn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},xn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var bn={build:function(t){var e,i,r=t.shape,n=t.points,o=r.x,s=r.y;if(n.length=0,t.type===ve.CIRC?(e=r.radius,i=r.radius):(e=r.width,i=r.height),0!==e&&0!==i){var a=Math.floor(30*Math.sqrt(r.radius))||Math.floor(15*Math.sqrt(r.width+r.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=r[2*(d-2)],m=r[2*(d-2)+1],y=r[2*(d-1)],_=r[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(r=In.pop()||new Cn,this.batches.push(r)),r.style=d,r.start=f,r.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),En.triangulate(a,this)):h.triangulate(a,this);else{Tn(a,this);for(var m=0;m0&&(o=An.pop()||new Kr,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(r,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}ni._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,i=sr?s+h:r;else if(c===ve.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,i=s-(h=n.radius+d/2)r?s+h:r;else if(c===ve.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,i=s-(h=n.height+d/2)r?s+h:r;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,i=(b=(v+s)/2)-(_=(h/a*g+m)/2)r?b+_:r)}else t=0,e=0,i=0,r=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=i-E,this._bounds.maxY=r+E},e.prototype.transformPoints=function(t,e){for(var i=0;i>16)+(65280&e)+((255&e)<<16),i);r-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,i,r,n,o){for(var s=0,a=e.length,h=i.frame;sl*a}},Ln.arc=function(t,e,i,r,n,o,s,a,h){for(var u=s-o,l=yn._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/de)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+i,(p*-x+f*_)*n+r)}};var Nn=function(t){function e(e,i,r,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*r,u=de/h,l=[],c=0;c0&&r>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:i,width:t,alpha:r,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Re,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Re,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,i,r,n),this},e.prototype.bezierCurveTo=function(t,e,i,r,n,o){return this._initCurve(),Rn.curveTo(t,e,i,r,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var o=this.currentPath.points,s=Ln.curveTo(t,e,i,r,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,i,r,n,o){if(void 0===o&&(o=!1),r===n)return this;if(!o&&n<=r?n+=de:o&&r<=n&&(r+=de),0===n-r)return this;var s=t+Math.cos(r)*i,a=e+Math.sin(r)*i,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Ln.arc(s,a,t,e,i,r,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(yi.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,i,r){void 0===t&&(t=yi.WHITE),void 0===e&&(e=16777215),void 0===i&&(i=1),void 0===r&&(r=null),this.currentPath&&this.startPoly();var n=i>0;return n?(r&&(r=r.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:i,texture:t,matrix:r,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,r){return this.drawShape(new Ae(t,e,i,r))},e.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new Fe(t,e,i,r,n))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new Me(t,e,i))},e.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new De(t,e,i,r))},e.prototype.drawPolygon=function(t){var e=arguments,i=t,r=!0;if(i.points&&(r=i.closeStroke,i=i.points),!Array.isArray(i)){i=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,i=t.b,r=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=r&&Xn.x=n&&Xn.y>16)+(65280&t)+((255&t)<<16)},i.texture.get=function(){return this._texture},i.texture.set=function(t){this._texture!==t&&(this._texture=t||yi.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,i),e}(Be),Hn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},Yn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Hn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},zn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Vn=function(t){this.styleID=0,this.reset(),Kn(this,t,t)},Wn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function qn(t){return"number"==typeof t?Lt(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Zn(t){if(Array.isArray(t)){for(var e=0;e=0;i--){var r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&zn.indexOf(r)<0&&(r='"'+r+'"'),e[i]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Vn.prototype,Wn);var Jn=function(t,e,i,r,n,o,s,a,h){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Jn.measureText=function(t,e,i,r){void 0===r&&(r=Jn._canvas),i=null==i?e.wordWrap:i;var n=e.toFontString(),o=Jn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=r.getContext("2d");s.font=n;for(var a=(i?Jn.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Jn.addLine(o),o="",n=0),Jn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Jn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Jn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Jn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Jn.addLine(o),o="",n=0),(o.length>0||!Jn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Jn.addLine(o,!1)},Jn.addLine=function(t,e){return void 0===e&&(e=!0),t=Jn.trimRight(t),t=e?t+"\n":t},Jn.getFromCache=function(t,e,i,r){var n=i[t];if(void 0===n){var o=t.length*e;n=r.measureText(t).width+o,i[t]=n}return n},Jn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Jn.collapseNewlines=function(t){return"normal"===t},Jn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var i=t[e];if(!Jn.isBreakingSpace(i))break;t=t.slice(0,-1)}return t},Jn.isNewline=function(t){return"string"==typeof t&&Jn._newlines.indexOf(t.charCodeAt(0))>=0},Jn.isBreakingSpace=function(t){return"string"==typeof t&&Jn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Jn.tokenize=function(t){var e=[],i="";if("string"!=typeof t)return e;for(var r=0;rs;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new eo(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(ho),this.registerFindHook(uo),this.registerFindHook(ro),this.registerFindHook(no),this.registerFindHook(oo),this.registerUploadHook(so),this.registerUploadHook(ao)};function ro(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var r=0;r=0;r--)this.add(t.children[r]);return this},io.prototype.destroy=function(){this.ticking&&Ve.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var lo=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(fo),this.registerUploadHook(co),this.registerUploadHook(po)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function co(t,e){return e instanceof ni&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function po(t,e){return e instanceof kn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function fo(t,e){return t instanceof kn&&(e.push(t),!0)}var vo=function(t){this.maxMilliseconds=t,this.frameStart=0};vo.prototype.beginFrame=function(){this.frameStart=Date.now()},vo.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),wo=(i(Eo),Eo.Resource,r(function(t,e){e.__esModule=!0,e.Loader=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=i,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,i){return e._loadResource(t,i)},this._queue=s.queue(this._boundLoadResource,r),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Do(No);No.Resource;var Uo=Ro(function(t,e){e.__esModule=!0,e.encodeBinary=r;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(t){for(var e="",r=0;r>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(r=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=r,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(i),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t,Ft(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(o=i);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(Bt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=kt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;cr&&(p=r),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=r&&Qo.x=n&&Qo.y0&&r.x>h&&(Ht(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,r.x=0,r.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,r.x=0,r.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},i.align.get=function(){return this._font.align},i.align.set=function(t){this._font.align=t||"left",this.dirty=!0},i.anchor.get=function(){return this._anchor},i.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},i.font.get=function(){return this._font},i.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},i.text.get=function(){return this._text},i.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},i.maxWidth.get=function(){return this._maxWidth},i.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},i.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},i.textWidth.get=function(){return this.validate(),this._textWidth},i.letterSpacing.get=function(){return this._letterSpacing},i.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},i.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,i){var r={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=oe(s[0].getAttribute("file"),m.RESOLUTION),h={};r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,r.chars={},i instanceof yi&&(i=[i]);for(var u=0;u=r&&(e=t-s-1),o+=a=a.replace("%value%",i[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=r||4,this.blur=i||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,i,r);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",vs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,Wr,fs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),r=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[i+(1-i)*n,n*(1-i)-o*r,n*(1-i)+o*r,0,0,n*(1-i)+o*r,i+n*(1-i),n*(1-i)-o*r,0,0,n*(1-i)-o*r,n*(1-i)+o*r,i+n*(1-i),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,r=-.5*(i-1),n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,i,r,n){var o=((i=i||16770432)>>16&255)/255,s=(i>>8&255)/255,a=(255&i)/255,h=((r=r||3375104)>>16&255)/255,u=(r>>8&255)/255,l=(255&r)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},i.matrix.get=function(){return this.uniforms.m},i.matrix.set=function(t){this.uniforms.m=t},i.alpha.get=function(){return this.uniforms.uAlpha},i.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,i),e}(mr);vs.prototype.grayscale=vs.prototype.greyscale;var gs="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ms="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",ys=function(t){function e(e,i){var r=new ge;e.renderable=!1,t.call(this,gs,ms,{mapSampler:e._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=r,null==i&&(i=20),this.scale=new ue(i,i)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={map:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,i,r)},i.map.get=function(){return this.uniforms.mapSampler},i.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,i),e}(mr),_s="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",xs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',bs=function(t){function e(){t.call(this,_s,xs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(mr),Ts="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",Es=function(t){function e(e,i){void 0===e&&(e=.5),void 0===i&&(i=Math.random()),t.call(this,Wr,Ts,{uNoise:0,uSeed:0}),this.noise=e,this.seed=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={noise:{configurable:!0},seed:{configurable:!0}};return i.noise.get=function(){return this.uniforms.uNoise},i.noise.set=function(t){this.uniforms.uNoise=t},i.seed.get=function(){return this.uniforms.uSeed},i.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,i),e}(mr),ws=new ge;Ne.prototype._cacheAsBitmap=!1,Ne.prototype._cacheData=!1;var Ss=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ne.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ss),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ne.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ne.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds().clone();if(this.filters){var r=this.filters[0].padding;i.pad(r)}i.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=xi.create(i.width,i.height),s="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=s,ni.addToCache(o.baseTexture,s),yi.addToCache(o,s);var a=ws;a.tx=-i.x,a.ty=-i.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Gn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-i.x/i.width,h.anchor.y=-i.y/i.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ne.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ne.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),i=this.alpha;this.alpha=1;var r=t.context;e.ceil(m.RESOLUTION);var n=xi.create(e.width,e.height),o="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=o,ni.addToCache(n.baseTexture,o),yi.addToCache(n,o);var s=ws;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Gn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=i,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ne.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ne.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ne.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ni.removeFromCache(this._cacheData.textureCacheId),yi.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ne.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ne.prototype.name=null,Be.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},i.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;jt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,i),e}(pr),Fs=function(t){function e(e,i,r){t.call(this);var n=new Ei(e),o=new Ei(i,!0),s=new Ei(r,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertexDirtyId:{configurable:!0}};return i.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,i),e}(Oi),Ls=function(t){function e(e,i,r,n){void 0===e&&(e=100),void 0===i&&(i=100),void 0===r&&(r=10),void 0===n&&(n=10),t.call(this),this.segWidth=r,this.segHeight=n,this.width=e,this.height=i,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],r=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,i=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width},i.width.get=function(){return this._width},i.width.set=function(t){this._width=t,this._refresh()},i.height.get=function(){return this._height},i.height.set=function(t){this._height=t,this._refresh()},i.leftWidth.get=function(){return this._leftWidth},i.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},i.rightWidth.get=function(){return this._rightWidth},i.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},i.topHeight.get=function(){return this._topHeight},i.topHeight.set=function(t){this._topHeight=t,this._refresh()},i.bottomHeight.get=function(){return this._bottomHeight},i.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,i),e}(Bs),Gs=function(t){function e(e,i){t.call(this,e[0]instanceof yi?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==i,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&Ve.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&Ve.shared.add(this.update,this,Ye.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramei&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],r=0;r0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=r(function(t){!function(e){var i=/iPhone/i,r=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(i,e)&&!g(u,e),ipod:g(r,e),tablet:!g(i,e)&&g(n,e)&&!g(u,e),device:(g(i,e)||g(r,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var i=navigator.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)>=11&&(e=!0)}if(g.android.device){var r=navigator.userAgent.match(/Android\s([0-9.]*)/);r&&parseInt(r[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=r(function(t){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new n(r,o||t,s),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 s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,r,n=[];if(0===this._eventsCount)return n;for(r in t=this._events)e.call(t,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,s=new Array(o);n80*i){r=o=t[0],n=s=t[1];for(var f=i;fo&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-r,s-n))?1/u:0}return w(d,p,i,r,n,u),p}function T(t,e,i,r,n){var o,s;if(n===H(t,e,i,r)>0)for(o=e;o=e;o-=r)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!N(r,r.next)&&0!==L(r.prev,r,r.next))r=r.next;else{if(j(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function w(t,e,i,r,n,o,s){if(t){!s&&o&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=M(n.x,n.y,e,i,r)),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,r,n,o,s,a,h,u=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,r=i,a=0,e=0;e0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(s>1)}(n)}(t,r,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?P(t,r,n,o):S(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,i),e,i,r,n,o,2):2===s&&A(t,e,i,r,n,o):w(E(t),e,i,r,n,o,1);break}}}function S(t){var e=t.prev,i=t,r=t.next;if(L(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&L(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,i,r){var n=t.prev,o=t,s=t.next;if(L(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,i,r),d=M(u,l,e,i,r),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!N(n,o)&&U(n,r,r.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),j(r),j(r.next),r=t=o),r=r.next}while(r!==t);return r}function A(t,e,i,r,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&F(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,i,r,n,o),void w(h,e,i,r,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=function(t,e){var i,r=e,n=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>s){if(s=a,a===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x=r.x&&r.x>=l&&n!==r.x&&R(oi.x)&&B(r,t)&&(i=r,d=h),r=r.next;return i}(t,e)){var i=k(e,t);E(i,i.next)}}function M(t,e,i,r,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-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,i=t;do{(e.x=0&&(t-s)*(r-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(n-s)*(r-a)>=0}function F(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&&U(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&B(t,e)&&B(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)}function L(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,i,r){return!!(N(t,e)&&N(i,r)||N(t,r)&&N(i,e))||L(t,e,i)>0!=L(t,e,r)>0&&L(i,r,t)>0!=L(i,r,e)>0}function B(t,e){return L(t.prev,t,t.next)<0?L(t,e,t.next)>=0&&L(t,t.prev,e)>=0:L(t,e,t.prev)<0||L(t,t.next,e)<0}function k(t,e){var i=new G(t.i,t.x,t.y),r=new G(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function X(t,e,i,r){var n=new G(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function j(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 G(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 H(t,e,i,r){for(var n=0,o=e,s=i-r;o0&&(r+=t[n-1].length,i.holes.push(r))}return i},_.default=x;var Y=r(function(t,i){!function(r){var n=i&&!i.nodeType&&i,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(r=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function I(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,i,r=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,i){var r=0;for(t=i?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;r+=l)t=E(t/T);return E(r+(T+1)*t/(t+p))}function D(t){var e,i,r,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((i=t.lastIndexOf(m))<0&&(i=0),r=0;r=128&&S("not-basic"),_.push(t.charCodeAt(r));for(n=i>0?i+1:0;n=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,i,r,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,i=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(r=n=P.length,n&&P.push(m);r<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yE((u-i)/(x=r+1))&&S("overflow"),i+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&S("overflow"),y==e){for(h=i,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(i,x,r==n),i=0,++r}++i,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else r.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=function(t,e,i,r){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=function(t,e,i,r){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(r){var n=encodeURIComponent(q(r))+i;return Array.isArray(t[r])?t[r].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[r]))}).join(e):r?encodeURIComponent(q(r))+i+encodeURIComponent(q(t)):""},K=r(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof it))return it.prototype.format.call(t);return t.format()},et=it;function it(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var rt=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,i){if(t&&z.isObject(t)&&t instanceof it)return t;var r=new it;return r.parse(t,e,i),r}it.prototype.parse=function(t,e,i){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),n=-1!==r&&r127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift());return i.search=t.search,i.query=t.query,z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!_.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var b=_.slice(-1)[0],T=(i.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(i.hostname=i.host=P?"":_.length?_.shift():"",(S=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=S.shift(),i.host=i.hostname=S.shift()));return(m=m||i.host&&_.length)&&!P&&_.unshift(""),_.length?i.pathname=_.join("/"):(i.pathname=null,i.path=null),z.isNull(i.pathname)&&z.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},it.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={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,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.4";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch(t){return!1}}()),Ot}function Ft(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Lt(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}var Ut=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}();function Bt(t,e){return Ut[e?1:0][t]}function kt(t,e,i,r){return i=i||new Float32Array(4),r||void 0===r?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function Xt(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,r=t>>8&255,n=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(n=n*e+.5|0)}function jt(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(r||void 0===r)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function Gt(t){for(var e=6*t,i=new Uint16Array(e),r=0,n=0;r=n||0===i)){var o=n-(i=e+i>n?n-e:i);for(r=e;r>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function qt(t){return!(t&t-1||!t)}function Zt(t){var e=(t>65535)<<4,i=((t>>>=e)>255)<<3;return e|=i,e|=i=((t>>>=i)>15)<<2,(e|=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1}var Kt={},Jt=Object.create(null),Qt=Object.create(null);function $t(t){var e,i,r,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e0?1:0}!function(){for(var t=0;t<16;t++){var e=[];Ee.push(e);for(var i=0;i<16;i++)for(var r=we(ye[t]*ye[i]+xe[t]*_e[i]),n=we(_e[t]*ye[i]+be[t]*_e[i]),o=we(ye[t]*xe[i]+xe[t]*be[i]),s=we(_e[t]*xe[i]+be[t]*be[i]),a=0;a<16;a++)if(ye[a]===r&&_e[a]===n&&xe[a]===o&&be[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new ge;u.set(ye[h],_e[h],xe[h],be[h],0,0),Te.push(u)}}();var Se={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return ye[t]},uY:function(t){return _e[t]},vX:function(t){return xe[t]},vY:function(t){return be[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return Ee[t][e]},sub:function(t,e){return Ee[t][Se.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Se.S:Se.N:2*Math.abs(e)<=Math.abs(t)?t>0?Se.E:Se.W:e>0?t>0?Se.SE:Se.SW:t>0?Se.NE:Se.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=Te[Se.inv(e)];n.tx=i,n.ty=r,t.append(n)}},Pe=function(){this.worldTransform=new ge,this.localTransform=new ge,this.position=new le(this.onChange,this,0,0),this.scale=new le(this.onChange,this,1,1),this.pivot=new le(this.onChange,this,0,0),this.skew=new le(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ie={rotation:{configurable:!0}};Pe.prototype.onChange=function(){this._localID++},Pe.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Pe.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Pe.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},Pe.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ie.rotation.get=function(){return this._rotation},Ie.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Pe.prototype,Ie),Pe.IDENTITY=new Pe;var Ae=function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=ve.RECT},Oe={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Ce={EMPTY:{configurable:!0}};Oe.left.get=function(){return this.x},Oe.right.get=function(){return this.x+this.width},Oe.top.get=function(){return this.y},Oe.bottom.get=function(){return this.y+this.height},Ce.EMPTY.get=function(){return new Ae(0,0,0,0)},Ae.prototype.clone=function(){return new Ae(this.x,this.y,this.width,this.height)},Ae.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Ae.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Ae.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(i=!i)}return i};var Fe=function(t,e,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=ve.RREC};Fe.prototype.clone=function(){return new Fe(this.x,this.y,this.width,this.height,this.radius)},Fe.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var i=t-(this.x+this.radius),r=e-(this.y+this.radius),n=this.radius*this.radius;if(i*i+r*r<=n)return!0;if((i=t-(this.x+this.width-this.radius))*i+r*r<=n)return!0;if(i*i+(r=e-(this.y+this.height-this.radius))*r<=n)return!0;if((i=t-(this.x+this.radius))*i+r*r<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Le=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Le.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Le.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Le.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ae.EMPTY:((t=t||new Ae(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Le.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Le.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,o=t[0],s=t[1];e=or?o:r,n=s>n?s:n,e=(o=t[2])r?o:r,n=s>n?s:n,e=(o=t[4])r?o:r,n=s>n?s:n,e=(o=t[6])r?o:r,n=s>n?s:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},Le.prototype.addFrame=function(t,e,i,r,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*i+l,m=a*e+u*i+c;d=gf?g:f,v=m>v?m:v,d=(g=s*r+h*i+l)f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)f?g:f,v=m>v?m:v,d=(g=s*r+h*n+l)f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Le.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=r,this.minY=n,this.maxX=o,this.maxY=s},Le.prototype.addVertices=function(t,e,i,r){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=i;vp?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Le.prototype.addBounds=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minXr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},Le.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},Le.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}};var Ne=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Pe,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Le,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var i=Object.keys(t),r=0;r1)for(var r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);Ht(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,i=arguments.length;if(i>1)for(var r=0;r0&&o<=n){i=this.children.splice(r,o);for(var s=0;s1&&this.children.sort(Ue),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;tthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},Xe.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},Xe.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},Xe.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},Xe.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},Xe.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},Xe.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},Xe.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;le.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},Ve.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Ve.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},Ve.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},Ve.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},Ve.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS&&e+1=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),i=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/i}},qe.shared.get=function(){if(!Ve._shared){var t=Ve._shared=new Ve;t.autoStart=!0,t._protected=!0}return Ve._shared},qe.system.get=function(){if(!Ve._system){var t=Ve._system=new Ve;t.autoStart=!0,t._protected=!0}return Ve._system},Object.defineProperties(Ve.prototype,We),Object.defineProperties(Ve,qe);var Ze=function(){};Ze.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ye.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Ve.shared:new Ve,t.autoStart&&this.start()},Ze.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Ke=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Ge("setRealSize",2),this.onUpdate=new Ge("update")},Je={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Ke.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Ke.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Ke.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Je.valid.get=function(){return!!this._width&&!!this._height},Ke.prototype.update=function(){this.destroyed||this.onUpdate.run()},Ke.prototype.load=function(){return Promise.resolve()},Je.width.get=function(){return this._width},Je.height.get=function(){return this._height},Ke.prototype.upload=function(t,e,i){return!1},Ke.prototype.style=function(t,e,i){return!1},Ke.prototype.dispose=function(){},Ke.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Ke.prototype,Je);var Qe=function(t){function e(e){var i=e.naturalWidth||e.videoWidth||e.width,r=e.naturalHeight||e.videoHeight||e.height;t.call(this,i,r),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=ne(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,r){var n=t.gl,o=e.realWidth,s=e.realHeight;return r=r||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&i.width===o&&i.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,r):(i.width=o,i.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,r)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,i=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Ke),$e=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLImageElement)){var r=new Image;t.crossOrigin(r,e,i.crossorigin),r.src=e,e=r}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==i.createBitmap?i.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==i.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==i.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var i=e.source,r=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?r():i.onload=r}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,i,r){if(i.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,i,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,r,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in i._glTextures){var s=i._glTextures[o];if(s!==r&&s.dirtyId!==i.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}(Qe),ti=[];function ei(t,e){if(!t)return null;var i="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(i=r[1].toLowerCase())}for(var n=ti.length-1;n>=0;--n){var o=ti[n];if(o.test&&o.test(t,i))return new o(t,e)}return new $e(t,e)}var ii=function(t){function e(e,i){var r=i||{},n=r.width,o=r.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;if(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height)r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{i.width=e.width,i.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),r.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Ke),ri={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},ni=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null),t.call(this);var r=(i=i||{}).premultiplyAlpha,n=i.mipmap,o=i.scaleMode,s=i.width,a=i.height,h=i.wrapMode,u=i.format,l=i.type,c=i.target,d=i.resolution,p=i.resourceOptions;!e||e instanceof Ke||((e=ei(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==r,this.uid=zt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={realWidth:{configurable:!0},realHeight:{configurable:!0}};return i.realWidth.get=function(){return this.width*this.resolution},i.realHeight.get=function(){return this.height*this.resolution},e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=qt(this.realWidth)&&qt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Qt[this.cacheId],delete Jt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,i){var r=null;"string"==typeof t?r=t:(t._pixiId||(t._pixiId="pixiid_"+zt()),r=t._pixiId);var n=Qt[r];return n||((n=new e(t,i)).cacheId=r,e.addToCache(n,r)),n},e.fromBuffer=function(t,i,r,n){t=t||new Float32Array(i*r*4);var o=new ii(t,{width:i,height:r}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(ri,n||{width:i,height:r,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Qt[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),Qt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=Qt[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var ui=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(r,e[0].src||e[0],i.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&Ve.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},i.autoUpdate.get=function(){return this._autoUpdate},i.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(Ve.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(Ve.shared.add(this.update,this),this._isAutoUpdating=!0))},i.updateFPS.get=function(){return this._updateFPS},i.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,i){return t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},Object.defineProperties(e.prototype,i),e}(Qe);ui.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],ti.push($e,si,ui,hi,ii,ai,oi);var li={INSTALLED:ti,autoDetectResource:ei,ArrayResource:oi,BufferResource:ii,CanvasResource:si,CubeResource:ai,ImageResource:$e,SVGResource:hi,VideoResource:ui,Resource:Ke,BaseImageResource:Qe},ci=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};ci.prototype.contextChange=function(t){},ci.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,r.texImage2D(e.target,0,r.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ii),pi=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ge("disposeFramebuffer",2)},fi={colorTexture:{configurable:!0}};fi.colorTexture.get=function(){return this.colorTextures[0]},pi.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new ni(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.addDepthTexture=function(t){return this.depthTexture=t||new ni(new di(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},pi.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&e.textureCacheIds.splice(i,1),delete Jt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;rthis.baseTexture.width,s=i+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,u="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},i.rotate.get=function(){return this._rotate},i.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},i.width.get=function(){return this.orig.width},i.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,i),e}(y);function _i(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}yi.EMPTY=new yi(new ni),_i(yi.EMPTY),_i(yi.EMPTY.baseTexture),yi.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new yi(new ni(new si(t)))}(),_i(yi.WHITE),_i(yi.WHITE.baseTexture);var xi=function(t){function e(e,i){var r=null;if(!(e instanceof vi)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),r=arguments[0],i=null,e=new vi({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,i),this.legacyRenderer=r,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,i){void 0===i&&(i=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,i&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new vi(t))},e}(yi),bi=function(t,e,i,r,n,o,s){void 0===i&&(i=!1),void 0===r&&(r=5126),this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=o,this.instance=s};bi.prototype.destroy=function(){this.buffer=null},bi.from=function(t,e,i,r,n){return new bi(t,e,i,r,n)};var Ti=0,Ei=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=Ti++,this.disposeRunner=new Ge("disposeBuffer",2)};function wi(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}Ei.prototype.update=function(t){this.data=t||this.data,this._updateID++},Ei.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Ei.prototype.destroy=function(){this.dispose(),this.data=null},Ei.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new Ei(t)};var Si={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Pi={5126:4,5123:2,5121:1},Ii=0,Ai={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Oi=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ii++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new Ge("disposeGeometry",2),this.refCount=0};Oi.prototype.addAttribute=function(t,e,i,r,n,o,s,a){if(void 0===r&&(r=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new Ei(e));var h=t.split("|");if(h.length>1){for(var u=0;u=mt.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),i},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,i),e}(ci),Xi=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new pi(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ae,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var i=this.gl;if(t){var r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,r.framebuffer)),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):r.dirtySize!==t.dirtySize&&(r.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}i.stencil||!t.stencil&&!t.depth||(i.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.stencil&&r.deleteRenderbuffer(i.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=r.data.byteLength)e.bufferSubData(o,0,r.data);else{var s=r.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=r.data.byteLength,e.bufferData(o,r.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var i=t.attributes,r=e.attributeData;for(var n in r)if(!i[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var i=t.attributes,r=e.attributeData,n=["g",t.id];for(var o in i)r[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var i=this.gl,r=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Gi[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Gi[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Gi[f.type])}s=i.createVertexArray(),i.bindVertexArray(s);for(var g=0;g=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Zi=t,t}return Zi}function Ji(t,e,i){if("precision"!==t.substring(0,9)){var r=e;return e===At.HIGH&&i!==At.HIGH&&(r=At.MEDIUM),"precision "+r+" float;\n"+t}return i!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var Qi={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function $i(t){return Qi[t]}var tr=null,er={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ir(t,e){if(!tr){var i=Object.keys(er);tr={};for(var r=0;r0&&(e+="\nelse "),ie.name?1:-1});for(var u=0;u>=1,i++;this.stateId=t.data}for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,r=0;rthis.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,i=!0)}if(i){for(var o=0,s=0;s=0;i--)this.unload(t.children[i])},e}(ci),kr=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},Xr=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ni}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var i=this.gl;e.mipmap&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST):i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR:i.NEAREST),i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode?i.LINEAR:i.NEAREST)},e}(ci),jr={FilterSystem:Li,BatchSystem:Ui,ContextSystem:ki,FramebufferSystem:Xi,GeometrySystem:Hi,MaskSystem:wr,StencilSystem:Sr,ProjectionSystem:Pr,RenderTextureSystem:Ar,ShaderSystem:Mr,StateSystem:Ur,TextureGCSystem:Br,TextureSystem:Xr},Gr=new ge,Hr=function(t){function e(e,i){t.call(this),(i=Object.assign({},m.RENDER_OPTIONS,i)).roundPixels&&(m.ROUND_PIXELS=i.roundPixels,ae("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=i,this.type=yt.UNKNOWN,this.screen=new Ae(0,0,i.width,i.height),this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution||m.RESOLUTION,this.transparent=i.transparent,this.autoDensity=i.autoDensity||i.autoResize||!1,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new Be,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},i.width.get=function(){return this.view.width},i.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,i,r){0===(r=r||t.getLocalBounds()).width&&(r.width=1),0===r.height&&(r.height=1);var n=xi.create(0|r.width,0|r.height,e,i);return Gr.tx=-r.x,Gr.ty=-r.y,this.render(t,n,!1,Gr,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},i.backgroundColor.get=function(){return this._backgroundColor},i.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Lt(t),Ft(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,i),e}(y),Yr=function(t){function e(i){void 0===i&&(i={}),t.call(this,"WebGL",i),i=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new Ge("destroy"),contextChange:new Ge("contextChange",1),reset:new Ge("reset"),update:new Ge("update"),postrender:new Ge("postrender"),prerender:new Ge("prerender"),resize:new Ge("resize",2)},this.globalUniforms=new Ri({projectionMatrix:new ge},!0),this.addSystem(wr,"mask").addSystem(ki,"context").addSystem(Ur,"state").addSystem(Mr,"shader").addSystem(Xr,"texture").addSystem(Hi,"geometry").addSystem(Xi,"framebuffer").addSystem(Sr,"stencil").addSystem(Pr,"projection").addSystem(Br,"textureGC").addSystem(Li,"filter").addSystem(Ar,"renderTexture").addSystem(Ui,"batch"),this.initPlugins(e.__plugins),i.context?this.context.initFromContext(i.context):this.context.initFromOptions({alpha:this.transparent,antialias:i.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=i,this.runners)this.runners[r].add(i);return this},e.prototype.render=function(t,e,i,r,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=r,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.run(e,i)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(Hr);function zr(t){return Yr.create(t)}var Vr="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",Wr="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,i){return new e(new ai(t,i))},e}(ni),Zr=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new Ei(null,e,!1),this._indexBuffer=new Ei(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oi),Kr=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Jr=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Jr.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var Qr="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",$r=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),tn={},en={};function rn(t,e){if(!en[e]){for(var i=new Int32Array(e),r=0;r0&&(e+="\nelse "),ithis.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=Wt(Math.ceil(t/12)),i=Zt(e),r=12*e;this.iBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.iBuffers[i];return n||(this.iBuffers[i]=n=new Uint16Array(r)),n},e.prototype.getAttributeBuffer=function(t){var e=Wt(Math.ceil(t/8)),i=Zt(e),r=8*e;this.aBuffers.length<=i&&(this.iBuffers.length=i+1);var n=this.aBuffers[r];return n||(this.aBuffers[r]=n=new Jr(r*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,i=this.renderer.gl,r=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++ni._globalBatch;for(y=0;y=0;l--){var c=u[l],d=this.processInteractive(t,c,i,r,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(r=!1),s=!0)}}return n&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),i&&i(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=e.length,r=0;rthis.maxSegments&&(i=this.maxSegments),i}},_n=function(){this.reset()};_n.prototype.clone=function(){var t=new _n;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},_n.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=yi.WHITE,this.matrix=null,this.visible=!1},_n.prototype.destroy=function(){this.texture=null,this.matrix=null};var xn=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]};xn.prototype.clone=function(){return new xn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},xn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var bn={build:function(t){var e,i,r=t.shape,n=t.points,o=r.x,s=r.y;if(n.length=0,t.type===ve.CIRC?(e=r.radius,i=r.radius):(e=r.width,i=r.height),0!==e&&0!==i){var a=Math.floor(30*Math.sqrt(r.radius))||Math.floor(15*Math.sqrt(r.width+r.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=r[2*(d-2)],m=r[2*(d-2)+1],y=r[2*(d-1)],_=r[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y=6){for(var s=[],a=0;a0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(r=In.pop()||new Cn,this.batches.push(r)),r.style=d,r.start=f,r.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),En.triangulate(a,this)):h.triangulate(a,this);else{Tn(a,this);for(var m=0;m0&&(o=An.pop()||new Kr,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(r,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}ni._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;be?o+a:e,i=sr?s+h:r;else if(c===ve.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)e?o+a:e,i=s-(h=n.radius+d/2)r?s+h:r;else if(c===ve.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)e?o+a:e,i=s-(h=n.height+d/2)r?s+h:r;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2e?x+y:e,i=(b=(v+s)/2)-(_=(h/a*g+m)/2)r?b+_:r)}else t=0,e=0,i=0,r=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=i-E,this._bounds.maxY=r+E},e.prototype.transformPoints=function(t,e){for(var i=0;i>16)+(65280&e)+((255&e)<<16),i);r-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,i,r,n,o){for(var s=0,a=e.length,h=i.frame;sl*a}},Ln.arc=function(t,e,i,r,n,o,s,a,h){for(var u=s-o,l=yn._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/de)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+i,(p*-x+f*_)*n+r)}};var Nn=function(t){function e(e,i,r,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*r,u=de/h,l=[],c=0;c0&&r>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:i,width:t,alpha:r,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Re,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Re,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Fn.curveTo(t,e,i,r,n),this},e.prototype.bezierCurveTo=function(t,e,i,r,n,o){return this._initCurve(),Rn.curveTo(t,e,i,r,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var o=this.currentPath.points,s=Ln.curveTo(t,e,i,r,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,i,r,n,o){if(void 0===o&&(o=!1),r===n)return this;if(!o&&n<=r?n+=de:o&&r<=n&&(r+=de),0===n-r)return this;var s=t+Math.cos(r)*i,a=e+Math.sin(r)*i,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Ln.arc(s,a,t,e,i,r,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(yi.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,i,r){void 0===t&&(t=yi.WHITE),void 0===e&&(e=16777215),void 0===i&&(i=1),void 0===r&&(r=null),this.currentPath&&this.startPoly();var n=i>0;return n?(r&&(r=r.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:i,texture:t,matrix:r,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,r){return this.drawShape(new Ae(t,e,i,r))},e.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new Fe(t,e,i,r,n))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new Me(t,e,i))},e.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new De(t,e,i,r))},e.prototype.drawPolygon=function(t){var e=arguments,i=t,r=!0;if(i.points&&(r=i.closeStroke,i=i.points),!Array.isArray(i)){i=new Array(arguments.length);for(var n=0;n>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,i=t.b,r=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l=r&&Xn.x=n&&Xn.y>16)+(65280&t)+((255&t)<<16)},i.texture.get=function(){return this._texture},i.texture.set=function(t){this._texture!==t&&(this._texture=t||yi.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,i),e}(Be),Hn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},Yn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Hn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},zn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Vn=function(t){this.styleID=0,this.reset(),Kn(this,t,t)},Wn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function qn(t){return"number"==typeof t?Lt(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Zn(t){if(Array.isArray(t)){for(var e=0;e=0;i--){var r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&zn.indexOf(r)<0&&(r='"'+r+'"'),e[i]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Vn.prototype,Wn);var Jn=function(t,e,i,r,n,o,s,a,h){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Jn.measureText=function(t,e,i,r){void 0===r&&(r=Jn._canvas),i=null==i?e.wordWrap:i;var n=e.toFontString(),o=Jn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=r.getContext("2d");s.font=n;for(var a=(i?Jn.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;lp)if(""!==o&&(s+=Jn.addLine(o),o="",n=0),Jn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;bp&&(s+=Jn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Jn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Jn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Jn.addLine(o),o="",n=0),(o.length>0||!Jn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Jn.addLine(o,!1)},Jn.addLine=function(t,e){return void 0===e&&(e=!0),t=Jn.trimRight(t),t=e?t+"\n":t},Jn.getFromCache=function(t,e,i,r){var n=i[t];if(void 0===n){var o=t.length*e;n=r.measureText(t).width+o,i[t]=n}return n},Jn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Jn.collapseNewlines=function(t){return"normal"===t},Jn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var i=t[e];if(!Jn.isBreakingSpace(i))break;t=t.slice(0,-1)}return t},Jn.isNewline=function(t){return"string"==typeof t&&Jn._newlines.indexOf(t.charCodeAt(0))>=0},Jn.isBreakingSpace=function(t){return"string"==typeof t&&Jn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Jn.tokenize=function(t){var e=[],i="";if("string"!=typeof t)return e;for(var r=0;rs;--c){for(var v=0;v0};var io=function(t){var e=this;this.limiter=new eo(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(ho),this.registerFindHook(uo),this.registerFindHook(ro),this.registerFindHook(no),this.registerFindHook(oo),this.registerUploadHook(so),this.registerUploadHook(ao)};function ro(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var r=0;r=0;r--)this.add(t.children[r]);return this},io.prototype.destroy=function(){this.ticking&&Ve.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var lo=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(fo),this.registerUploadHook(co),this.registerUploadHook(po)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function co(t,e){return e instanceof ni&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function po(t,e){return e instanceof kn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function fo(t,e){return t instanceof kn&&(e.push(t),!0)}var vo=function(t){this.maxMilliseconds=t,this.frameStart=0};vo.prototype.beginFrame=function(){this.frameStart=Date.now()},vo.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),wo=(i(Eo),Eo.Resource,r(function(t,e){e.__esModule=!0,e.Loader=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=i,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,i){return e._loadResource(t,i)},this._queue=s.queue(this._boundLoadResource,r),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var i=!(t=(0,r.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Do(No);No.Resource;var Uo=Ro(function(t,e){e.__esModule=!0,e.encodeBinary=r;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(t){for(var e="",r=0;r>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],r-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a16384&&(r=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=r,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(i),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t,Ft(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(o=i);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(Bt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=kt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;cr&&(p=r),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID=r&&Qo.x=n&&Qo.y0&&r.x>h&&(Ht(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,r.x=0,r.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,r.x=0,r.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I=0?t:16777215,this.dirty=!0},i.align.get=function(){return this._font.align},i.align.set=function(t){this._font.align=t||"left",this.dirty=!0},i.anchor.get=function(){return this._anchor},i.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},i.font.get=function(){return this._font},i.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},i.text.get=function(){return this._text},i.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},i.maxWidth.get=function(){return this._maxWidth},i.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},i.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},i.textWidth.get=function(){return this.validate(),this._textWidth},i.letterSpacing.get=function(){return this._letterSpacing},i.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},i.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,i){var r={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=oe(s[0].getAttribute("file"),m.RESOLUTION),h={};r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,r.chars={},i instanceof yi&&(i=[i]);for(var u=0;u=r&&(e=t-s-1),o+=a=a.replace("%value%",i[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=r||4,this.blur=i||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,i,r);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,!1);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",vs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,Wr,fs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),r=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[i+(1-i)*n,n*(1-i)-o*r,n*(1-i)+o*r,0,0,n*(1-i)+o*r,i+n*(1-i),n*(1-i)-o*r,0,0,n*(1-i)-o*r,n*(1-i)+o*r,i+n*(1-i),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,r=-.5*(i-1),n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,i,r,n){var o=((i=i||16770432)>>16&255)/255,s=(i>>8&255)/255,a=(255&i)/255,h=((r=r||3375104)>>16&255)/255,u=(r>>8&255)/255,l=(255&r)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},i.matrix.get=function(){return this.uniforms.m},i.matrix.set=function(t){this.uniforms.m=t},i.alpha.get=function(){return this.uniforms.uAlpha},i.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,i),e}(mr);vs.prototype.grayscale=vs.prototype.greyscale;var gs="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",ms="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",ys=function(t){function e(e,i){var r=new ge;e.renderable=!1,t.call(this,gs,ms,{mapSampler:e._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=r,null==i&&(i=20),this.scale=new ue(i,i)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={map:{configurable:!0}};return e.prototype.apply=function(t,e,i,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,i,r)},i.map.get=function(){return this.uniforms.mapSampler},i.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,i),e}(mr),_s="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",xs='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',bs=function(t){function e(){t.call(this,_s,xs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(mr),Ts="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",Es=function(t){function e(e,i){void 0===e&&(e=.5),void 0===i&&(i=Math.random()),t.call(this,Wr,Ts,{uNoise:0,uSeed:0}),this.noise=e,this.seed=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={noise:{configurable:!0},seed:{configurable:!0}};return i.noise.get=function(){return this.uniforms.uNoise},i.noise.set=function(t){this.uniforms.uNoise=t},i.seed.get=function(){return this.uniforms.uSeed},i.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,i),e}(mr),ws=new ge;Ne.prototype._cacheAsBitmap=!1,Ne.prototype._cacheData=!1;var Ss=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ne.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ss),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Ne.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ne.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds().clone();if(this.filters){var r=this.filters[0].padding;i.pad(r)}i.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=xi.create(i.width,i.height),s="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=s,ni.addToCache(o.baseTexture,s),yi.addToCache(o,s);var a=ws;a.tx=-i.x,a.ty=-i.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Gn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-i.x/i.width,h.anchor.y=-i.y/i.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Ne.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ne.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),i=this.alpha;this.alpha=1;var r=t.context;e.ceil(m.RESOLUTION);var n=xi.create(e.width,e.height),o="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=o,ni.addToCache(n.baseTexture,o),yi.addToCache(n,o);var s=ws;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Gn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=i,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ne.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ne.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ne.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ni.removeFromCache(this._cacheData.textureCacheId),yi.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ne.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ne.prototype.name=null,Be.prototype.getChildByName=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},i.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;jt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,i),e}(pr),Fs=function(t){function e(e,i,r){t.call(this);var n=new Ei(e),o=new Ei(i,!0),s=new Ei(r,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertexDirtyId:{configurable:!0}};return i.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,i),e}(Oi),Ls=function(t){function e(e,i,r,n){void 0===e&&(e=100),void 0===i&&(i=100),void 0===r&&(r=10),void 0===n&&(n=10),t.call(this),this.segWidth=r,this.segHeight=n,this.width=e,this.height=i,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],r=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;he?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,i=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width},i.width.get=function(){return this._width},i.width.set=function(t){this._width=t,this._refresh()},i.height.get=function(){return this._height},i.height.set=function(t){this._height=t,this._refresh()},i.leftWidth.get=function(){return this._leftWidth},i.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},i.rightWidth.get=function(){return this._rightWidth},i.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},i.topHeight.get=function(){return this._topHeight},i.topHeight.set=function(t){this._topHeight=t,this._refresh()},i.bottomHeight.get=function(){return this._bottomHeight},i.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,i),e}(Bs),Gs=function(t){function e(e,i){t.call(this,e[0]instanceof yi?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==i,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&Ve.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&Ve.shared.add(this.update,this,Ye.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramei&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],r=0;r