@omnimedia/omnitool 1.1.0-43 → 1.1.0-45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/package.json +17 -18
  2. package/s/demo/demo.bundle.ts +20 -40
  3. package/s/demo/routines/export-test.ts +8 -0
  4. package/s/demo/routines/playback-test.ts +21 -0
  5. package/s/demo/routines/timeline-setup.ts +24 -0
  6. package/s/demo/routines/transcode-test.ts +2 -0
  7. package/s/driver/driver-worker.ts +9 -0
  8. package/s/driver/driver.test.ts +1 -1
  9. package/s/driver/driver.ts +8 -22
  10. package/s/driver/fns/schematic.ts +6 -2
  11. package/s/driver/fns/work.ts +2 -133
  12. package/s/driver/parts/compositor.ts +178 -0
  13. package/s/driver/parts/machina.ts +19 -20
  14. package/s/index.ts +1 -0
  15. package/s/timeline/index.ts +1 -1
  16. package/s/timeline/parts/media.ts +11 -2
  17. package/s/timeline/parts/{compositor → renderers}/parts/html-tree.ts +2 -2
  18. package/s/timeline/parts/{compositor → renderers}/parts/tree-builder.ts +4 -2
  19. package/s/timeline/parts/{compositor → renderers}/playback.ts +4 -13
  20. package/s/timeline/parts/{compositor → renderers}/samplers/html.ts +19 -5
  21. package/s/timeline/parts/{compositor → renderers}/samplers/webcodecs.ts +1 -1
  22. package/s/timeline/parts/resource-pool.ts +8 -4
  23. package/s/timeline/parts/resource.ts +1 -0
  24. package/s/timeline/sugar/o.ts +8 -4
  25. package/s/timeline/sugar/omni-test.ts +14 -14
  26. package/s/timeline/sugar/omni.ts +2 -2
  27. package/s/timeline/utils/datafile.ts +14 -4
  28. package/s/timeline/utils/dummy-data.ts +3 -3
  29. package/x/demo/WebGLRenderer-Q3OV2JVE.js +2 -0
  30. package/x/demo/WebGLRenderer-Q3OV2JVE.js.map +7 -0
  31. package/x/demo/WebGPURenderer-FUFF62QA.js +2 -0
  32. package/x/demo/WebGPURenderer-FUFF62QA.js.map +7 -0
  33. package/x/demo/browserAll-PGQYU756.js +2 -0
  34. package/x/demo/browserAll-PGQYU756.js.map +7 -0
  35. package/x/demo/chunk-2RBLPWNG.js +393 -0
  36. package/x/demo/chunk-2RBLPWNG.js.map +7 -0
  37. package/x/demo/chunk-6DBMQOFE.js +42 -0
  38. package/x/demo/chunk-6DBMQOFE.js.map +7 -0
  39. package/x/demo/chunk-LAJHJD2S.js +2 -0
  40. package/x/demo/chunk-LAJHJD2S.js.map +7 -0
  41. package/x/demo/chunk-LQU5JKKZ.js +269 -0
  42. package/x/demo/chunk-LQU5JKKZ.js.map +7 -0
  43. package/x/demo/chunk-RFNLITDQ.js +327 -0
  44. package/x/demo/chunk-RFNLITDQ.js.map +7 -0
  45. package/x/demo/chunk-TBWCKYN2.js +2 -0
  46. package/x/demo/chunk-TBWCKYN2.js.map +7 -0
  47. package/x/demo/chunk-TLDBHU4V.js +15 -0
  48. package/x/demo/chunk-TLDBHU4V.js.map +7 -0
  49. package/x/demo/chunk-X2GHKWPJ.js +157 -0
  50. package/x/demo/chunk-X2GHKWPJ.js.map +7 -0
  51. package/x/demo/demo.bundle.js +18 -27
  52. package/x/demo/demo.bundle.js.map +1 -1
  53. package/x/demo/demo.bundle.min.js +2378 -534
  54. package/x/demo/demo.bundle.min.js.map +4 -4
  55. package/x/demo/routines/export-test.d.ts +2 -0
  56. package/x/demo/routines/export-test.js +7 -0
  57. package/x/demo/routines/export-test.js.map +1 -0
  58. package/x/demo/routines/playback-test.d.ts +3 -0
  59. package/x/demo/routines/playback-test.js +17 -0
  60. package/x/demo/routines/playback-test.js.map +1 -0
  61. package/x/demo/routines/timeline-setup.d.ts +6 -0
  62. package/x/demo/routines/timeline-setup.js +13 -0
  63. package/x/demo/routines/timeline-setup.js.map +1 -0
  64. package/x/demo/routines/transcode-test.js +2 -0
  65. package/x/demo/routines/transcode-test.js.map +1 -1
  66. package/x/demo/webworkerAll-3YNCLHCR.js +2 -0
  67. package/x/demo/webworkerAll-3YNCLHCR.js.map +7 -0
  68. package/x/driver/WebGLRenderer-OMRWYQIV.js +2 -0
  69. package/x/driver/WebGLRenderer-OMRWYQIV.js.map +7 -0
  70. package/x/driver/WebGPURenderer-KQJB2OJJ.js +2 -0
  71. package/x/driver/WebGPURenderer-KQJB2OJJ.js.map +7 -0
  72. package/x/driver/browserAll-YBZEJCN3.js +2 -0
  73. package/x/driver/browserAll-YBZEJCN3.js.map +7 -0
  74. package/x/driver/chunk-3L3MB5NY.js +393 -0
  75. package/x/driver/chunk-3L3MB5NY.js.map +7 -0
  76. package/x/driver/chunk-42BQ4XKE.js +269 -0
  77. package/x/driver/chunk-42BQ4XKE.js.map +7 -0
  78. package/x/driver/chunk-4HAYG3N5.js +327 -0
  79. package/x/driver/chunk-4HAYG3N5.js.map +7 -0
  80. package/x/driver/chunk-BFBY7VYB.js +42 -0
  81. package/x/driver/chunk-BFBY7VYB.js.map +7 -0
  82. package/x/driver/chunk-KM6O72WE.js +157 -0
  83. package/x/driver/chunk-KM6O72WE.js.map +7 -0
  84. package/x/driver/chunk-N6HD4WYJ.js +2 -0
  85. package/x/driver/chunk-N6HD4WYJ.js.map +7 -0
  86. package/x/driver/chunk-WCZ2O3UN.js +15 -0
  87. package/x/driver/chunk-WCZ2O3UN.js.map +7 -0
  88. package/x/driver/chunk-XWNSF3WJ.js +2 -0
  89. package/x/driver/chunk-XWNSF3WJ.js.map +7 -0
  90. package/x/driver/driver-worker.d.ts +1 -0
  91. package/x/driver/driver-worker.js +6 -0
  92. package/x/driver/driver-worker.js.map +1 -0
  93. package/x/driver/driver.d.ts +5 -4
  94. package/x/driver/driver.js +10 -20
  95. package/x/driver/driver.js.map +1 -1
  96. package/x/driver/driver.test.js +1 -1
  97. package/x/driver/driver.test.js.map +1 -1
  98. package/x/driver/driver.worker.bundle.min.js +119 -3504
  99. package/x/driver/driver.worker.bundle.min.js.map +4 -4
  100. package/x/driver/fns/host.d.ts +1 -2
  101. package/x/driver/fns/schematic.d.ts +6 -1
  102. package/x/driver/fns/work.d.ts +2 -4
  103. package/x/driver/fns/work.js +1 -100
  104. package/x/driver/fns/work.js.map +1 -1
  105. package/x/driver/parts/compositor.d.ts +15 -0
  106. package/x/driver/parts/compositor.js +152 -0
  107. package/x/driver/parts/compositor.js.map +1 -0
  108. package/x/driver/parts/machina.d.ts +0 -20
  109. package/x/driver/parts/machina.js +6 -10
  110. package/x/driver/parts/machina.js.map +1 -1
  111. package/x/driver/webworkerAll-BKJQW6P7.js +2 -0
  112. package/x/driver/webworkerAll-BKJQW6P7.js.map +7 -0
  113. package/x/features/speech/transcribe/parts/prep-audio.d.ts +1 -1
  114. package/x/features/speech/transcribe/worker.bundle.min.js +899 -899
  115. package/x/features/speech/transcribe/worker.bundle.min.js.map +4 -4
  116. package/x/index.d.ts +1 -0
  117. package/x/index.html +2 -2
  118. package/x/index.js +1 -0
  119. package/x/index.js.map +1 -1
  120. package/x/timeline/index.d.ts +1 -1
  121. package/x/timeline/index.js +1 -1
  122. package/x/timeline/index.js.map +1 -1
  123. package/x/timeline/parts/filmstrip.d.ts +1 -1
  124. package/x/timeline/parts/media.d.ts +2 -0
  125. package/x/timeline/parts/media.js +10 -2
  126. package/x/timeline/parts/media.js.map +1 -1
  127. package/x/timeline/parts/renderers/export.js.map +1 -0
  128. package/x/timeline/parts/{compositor → renderers}/parts/html-tree.js +2 -2
  129. package/x/timeline/parts/renderers/parts/html-tree.js.map +1 -0
  130. package/x/timeline/parts/renderers/parts/schedulers.js.map +1 -0
  131. package/x/timeline/parts/{compositor → renderers}/parts/tree-builder.js +4 -2
  132. package/x/timeline/parts/renderers/parts/tree-builder.js.map +1 -0
  133. package/x/timeline/parts/renderers/parts/webcodecs-tree.js.map +1 -0
  134. package/x/timeline/parts/{compositor → renderers}/playback.d.ts +2 -4
  135. package/x/timeline/parts/{compositor → renderers}/playback.js +5 -14
  136. package/x/timeline/parts/renderers/playback.js.map +1 -0
  137. package/x/timeline/parts/{compositor → renderers}/samplers/html.js +14 -5
  138. package/x/timeline/parts/renderers/samplers/html.js.map +1 -0
  139. package/x/timeline/parts/{compositor → renderers}/samplers/webcodecs.js +1 -1
  140. package/x/timeline/parts/renderers/samplers/webcodecs.js.map +1 -0
  141. package/x/timeline/parts/resource-pool.d.ts +2 -0
  142. package/x/timeline/parts/resource-pool.js +7 -4
  143. package/x/timeline/parts/resource-pool.js.map +1 -1
  144. package/x/timeline/parts/resource.d.ts +1 -0
  145. package/x/timeline/sugar/o.d.ts +4 -1
  146. package/x/timeline/sugar/o.js +4 -4
  147. package/x/timeline/sugar/o.js.map +1 -1
  148. package/x/timeline/sugar/omni-test.js +14 -7
  149. package/x/timeline/sugar/omni-test.js.map +1 -1
  150. package/x/timeline/sugar/omni.d.ts +1 -2
  151. package/x/timeline/sugar/omni.js +2 -2
  152. package/x/timeline/sugar/omni.js.map +1 -1
  153. package/x/timeline/utils/datafile.d.ts +4 -3
  154. package/x/timeline/utils/datafile.js +16 -5
  155. package/x/timeline/utils/datafile.js.map +1 -1
  156. package/x/timeline/utils/dummy-data.d.ts +1 -2
  157. package/x/timeline/utils/dummy-data.js +4 -2
  158. package/x/timeline/utils/dummy-data.js.map +1 -1
  159. package/x/timeline/parts/compositor/export.js.map +0 -1
  160. package/x/timeline/parts/compositor/parts/html-tree.js.map +0 -1
  161. package/x/timeline/parts/compositor/parts/schedulers.js.map +0 -1
  162. package/x/timeline/parts/compositor/parts/tree-builder.js.map +0 -1
  163. package/x/timeline/parts/compositor/parts/webcodecs-tree.js.map +0 -1
  164. package/x/timeline/parts/compositor/playback.js.map +0 -1
  165. package/x/timeline/parts/compositor/samplers/html.js.map +0 -1
  166. package/x/timeline/parts/compositor/samplers/webcodecs.js.map +0 -1
  167. /package/s/timeline/parts/{compositor → renderers}/export.ts +0 -0
  168. /package/s/timeline/parts/{compositor → renderers}/parts/schedulers.ts +0 -0
  169. /package/s/timeline/parts/{compositor → renderers}/parts/webcodecs-tree.ts +0 -0
  170. /package/x/timeline/parts/{compositor → renderers}/export.d.ts +0 -0
  171. /package/x/timeline/parts/{compositor → renderers}/export.js +0 -0
  172. /package/x/timeline/parts/{compositor → renderers}/parts/html-tree.d.ts +0 -0
  173. /package/x/timeline/parts/{compositor → renderers}/parts/schedulers.d.ts +0 -0
  174. /package/x/timeline/parts/{compositor → renderers}/parts/schedulers.js +0 -0
  175. /package/x/timeline/parts/{compositor → renderers}/parts/tree-builder.d.ts +0 -0
  176. /package/x/timeline/parts/{compositor → renderers}/parts/webcodecs-tree.d.ts +0 -0
  177. /package/x/timeline/parts/{compositor → renderers}/parts/webcodecs-tree.js +0 -0
  178. /package/x/timeline/parts/{compositor → renderers}/samplers/html.d.ts +0 -0
  179. /package/x/timeline/parts/{compositor → renderers}/samplers/webcodecs.d.ts +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../node_modules/pixi.js/node_modules/eventemitter3/index.js", "../../node_modules/pixi.js/src/extensions/Extensions.ts", "../../node_modules/pixi.js/src/rendering/renderers/types.ts", "../../node_modules/pixi.js/node_modules/eventemitter3/index.mjs", "../../node_modules/@pixi/colord/index.mjs", "../../node_modules/@pixi/colord/plugins/names.mjs", "../../node_modules/pixi.js/src/color/Color.ts", "../../node_modules/pixi.js/src/maths/misc/const.ts", "../../node_modules/pixi.js/src/maths/point/Point.ts", "../../node_modules/pixi.js/src/maths/matrix/Matrix.ts", "../../node_modules/pixi.js/src/utils/data/uid.ts", "../../node_modules/pixi.js/src/utils/logging/deprecation.ts", "../../node_modules/pixi.js/src/utils/logging/warn.ts", "../../node_modules/pixi.js/src/utils/pool/GlobalResourceRegistry.ts", "../../node_modules/pixi.js/src/utils/pool/Pool.ts", "../../node_modules/pixi.js/src/utils/pool/PoolGroup.ts", "../../node_modules/pixi.js/src/rendering/mask/MaskEffectManager.ts", "../../node_modules/pixi.js/src/maths/misc/pow2.ts", "../../node_modules/pixi.js/src/scene/container/utils/definedProps.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/texture/TextureStyle.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/texture/sources/TextureSource.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/texture/sources/BufferImageSource.ts", "../../node_modules/pixi.js/src/maths/matrix/groupD8.ts", "../../node_modules/pixi.js/src/maths/shapes/Rectangle.ts", "../../node_modules/pixi.js/src/utils/misc/NOOP.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/texture/TextureMatrix.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/texture/Texture.ts", "../../node_modules/pixi.js/src/culling/cullingMixin.ts", "../../node_modules/pixi.js/src/maths/point/ObservablePoint.ts", "../../node_modules/pixi.js/src/scene/container/container-mixins/cacheAsTextureMixin.ts", "../../node_modules/pixi.js/src/utils/data/removeItems.ts", "../../node_modules/pixi.js/src/scene/container/container-mixins/childrenHelperMixin.ts", "../../node_modules/pixi.js/src/scene/container/container-mixins/collectRenderablesMixin.ts", "../../node_modules/pixi.js/src/filters/FilterEffect.ts", "../../node_modules/pixi.js/src/scene/container/container-mixins/effectsMixin.ts", "../../node_modules/pixi.js/src/scene/container/container-mixins/findMixin.ts", "../../node_modules/pixi.js/src/scene/container/bounds/Bounds.ts", "../../node_modules/pixi.js/src/scene/container/bounds/utils/matrixAndBoundsPool.ts", "../../node_modules/pixi.js/src/scene/container/container-mixins/getFastGlobalBoundsMixin.ts", "../../node_modules/pixi.js/src/scene/container/bounds/getGlobalBounds.ts", "../../node_modules/pixi.js/src/scene/container/utils/multiplyHexColors.ts", "../../node_modules/pixi.js/src/scene/container/utils/multiplyColors.ts", "../../node_modules/pixi.js/src/scene/container/container-mixins/getGlobalMixin.ts", "../../node_modules/pixi.js/src/scene/container/bounds/getLocalBounds.ts", "../../node_modules/pixi.js/src/scene/container/utils/checkChildrenDidChange.ts", "../../node_modules/pixi.js/src/scene/container/container-mixins/measureMixin.ts", "../../node_modules/pixi.js/src/scene/container/container-mixins/onRenderMixin.ts", "../../node_modules/pixi.js/src/scene/container/container-mixins/sortMixin.ts", "../../node_modules/pixi.js/src/scene/container/container-mixins/toLocalGlobalMixin.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/instructions/InstructionSet.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/texture/TexturePool.ts", "../../node_modules/pixi.js/src/scene/container/RenderGroup.ts", "../../node_modules/pixi.js/src/scene/container/utils/assignWithIgnore.ts", "../../node_modules/pixi.js/src/scene/container/Container.ts", "../../node_modules/pixi.js/src/environment-browser/BrowserAdapter.ts", "../../node_modules/pixi.js/src/environment/adapter.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/texture/sources/CanvasSource.ts", "../../node_modules/pixi.js/src/rendering/renderers/gpu/shader/BindGroup.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/buffer/utils/fastCopy.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/state/const.ts", "../../node_modules/pixi.js/src/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/buffer/const.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/buffer/Buffer.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/geometry/utils/ensureIsBuffer.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/geometry/utils/getGeometryBounds.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/geometry/Geometry.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/utils/createIdFromString.ts", "../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/getTestContext.ts", "../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/getMaxFragmentPrecision.ts", "../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/preprocessors/addProgramDefines.ts", "../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/preprocessors/ensurePrecision.ts", "../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/preprocessors/insertVersion.ts", "../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/preprocessors/setProgramName.ts", "../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/preprocessors/stripVersion.ts", "../../node_modules/pixi.js/src/rendering/renderers/gl/shader/GlProgram.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/geometry/utils/getAttributeInfoFromFormat.ts", "../../node_modules/pixi.js/src/rendering/renderers/gpu/shader/utils/extractAttributesFromGpuProgram.ts", "../../node_modules/pixi.js/src/rendering/renderers/gpu/shader/utils/extractStructAndGroups.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/shader/const.ts", "../../node_modules/pixi.js/src/rendering/renderers/gpu/shader/utils/generateGpuLayoutGroups.ts", "../../node_modules/pixi.js/src/rendering/renderers/gpu/shader/utils/generateLayoutHash.ts", "../../node_modules/pixi.js/src/rendering/renderers/gpu/shader/utils/removeStructAndGroupDuplicates.ts", "../../node_modules/pixi.js/src/rendering/renderers/gpu/shader/GpuProgram.ts", "../../node_modules/pixi.js/src/rendering/high-shader/compiler/utils/addBits.ts", "../../node_modules/pixi.js/src/rendering/high-shader/compiler/utils/compileHooks.ts", "../../node_modules/pixi.js/src/rendering/high-shader/compiler/utils/compileInputs.ts", "../../node_modules/pixi.js/src/rendering/high-shader/compiler/utils/compileOutputs.ts", "../../node_modules/pixi.js/src/rendering/high-shader/compiler/utils/injectBits.ts", "../../node_modules/pixi.js/src/rendering/high-shader/compiler/compileHighShader.ts", "../../node_modules/pixi.js/src/rendering/high-shader/defaultProgramTemplate.ts", "../../node_modules/pixi.js/src/rendering/high-shader/shader-bits/globalUniformsBit.ts", "../../node_modules/pixi.js/src/rendering/high-shader/compileHighShaderToProgram.ts", "../../node_modules/pixi.js/src/rendering/high-shader/shader-bits/colorBit.ts", "../../node_modules/pixi.js/src/rendering/high-shader/shader-bits/generateTextureBatchBit.ts", "../../node_modules/pixi.js/src/rendering/high-shader/shader-bits/roundPixelsBit.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/shader/types.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/shader/utils/getDefaultUniformValue.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/shader/UniformGroup.ts", "../../node_modules/pixi.js/src/rendering/renderers/gl/shader/getBatchSamplersUniformGroup.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/shader/Shader.ts", "../../node_modules/earcut/src/earcut.js", "../../node_modules/pixi.js/src/utils/utils.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/state/State.ts", "../../node_modules/pixi.js/src/rendering/high-shader/shader-bits/localUniformBit.ts", "../../node_modules/pixi.js/src/ticker/const.ts", "../../node_modules/pixi.js/src/ticker/TickerListener.ts", "../../node_modules/pixi.js/src/ticker/Ticker.ts", "../../node_modules/pixi.js/src/scene/view/ViewContainer.ts", "../../node_modules/pixi.js/src/utils/data/updateQuadBounds.ts", "../../node_modules/pixi.js/src/scene/sprite/Sprite.ts", "../../node_modules/pixi.js/src/utils/data/ViewableBuffer.ts", "../../node_modules/pixi.js/src/rendering/renderers/shared/state/getAdjustedBlendModeBlend.ts", "../../node_modules/pixi.js/src/rendering/batcher/gl/utils/maxRecommendedTextures.ts", "../../node_modules/pixi.js/src/rendering/batcher/shared/BatchTextureArray.ts", "../../node_modules/pixi.js/src/rendering/batcher/shared/Batcher.ts", "../../node_modules/pixi.js/src/rendering/batcher/shared/BatchGeometry.ts", "../../node_modules/pixi.js/src/rendering/batcher/shared/DefaultShader.ts", "../../node_modules/pixi.js/src/rendering/batcher/shared/DefaultBatcher.ts", "../../node_modules/pixi.js/src/scene/graphics/gpu/colorToUniform.ts", "../../node_modules/pixi.js/src/scene/sprite/BatchableSprite.ts", "../../node_modules/pixi.js/src/filters/Filter.ts"],
4
+ "sourcesContent": ["'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n", "/**\n * Collection of valid extension types.\n * @category extensions\n * @advanced\n */\nenum ExtensionType\n{\n /** extensions that are registered as Application plugins */\n Application = 'application',\n\n /** extensions that are registered as WebGL render pipes */\n WebGLPipes = 'webgl-pipes',\n /** extensions that are registered as WebGL render pipes adaptors */\n WebGLPipesAdaptor = 'webgl-pipes-adaptor',\n /** extensions that are registered as WebGL render systems */\n WebGLSystem = 'webgl-system',\n\n /** extensions that are registered as WebGPU render pipes */\n WebGPUPipes = 'webgpu-pipes',\n /** extensions that are registered as WebGPU render pipes adaptors */\n WebGPUPipesAdaptor = 'webgpu-pipes-adaptor',\n /** extensions that are registered as WebGPU render systems */\n WebGPUSystem = 'webgpu-system',\n\n /** extensions that are registered as Canvas render pipes */\n CanvasSystem = 'canvas-system',\n /** extensions that are registered as Canvas render pipes adaptors */\n CanvasPipesAdaptor = 'canvas-pipes-adaptor',\n /** extensions that are registered as Canvas render systems */\n CanvasPipes = 'canvas-pipes',\n\n /** extensions that combine the other Asset extensions */\n Asset = 'asset',\n /** extensions that are used to load assets through Assets */\n LoadParser = 'load-parser',\n /** extensions that are used to resolve asset urls through Assets */\n ResolveParser = 'resolve-parser',\n /** extensions that are used to handle how urls are cached by Assets */\n CacheParser = 'cache-parser',\n /** extensions that are used to add/remove available resources from Assets */\n DetectionParser = 'detection-parser',\n\n /** extensions that are registered with the MaskEffectManager */\n MaskEffect = 'mask-effect',\n\n /** A type of extension for creating a new advanced blend mode */\n BlendMode = 'blend-mode',\n\n /** A type of extension that will be used to auto detect a resource type */\n TextureSource = 'texture-source',\n\n /** A type of extension that will be used to auto detect an environment */\n Environment = 'environment',\n\n /** A type of extension for building and triangulating custom shapes used in graphics. */\n ShapeBuilder = 'shape-builder',\n\n /** A type of extension for creating custom batchers used in rendering. */\n Batcher = 'batcher',\n}\n\n/**\n * The metadata for an extension.\n * @category extensions\n * @ignore\n */\ninterface ExtensionMetadataDetails\n{\n /** The extension type, can be multiple types */\n type: ExtensionType | ExtensionType[];\n /** Optional. Some plugins provide an API name/property, to make them more easily accessible */\n name?: string;\n /** Optional, used for sorting the plugins in a particular order */\n priority?: number;\n}\n\n/**\n * The metadata for an extension.\n * @category extensions\n * @advanced\n */\ntype ExtensionMetadata = ExtensionType | ExtensionMetadataDetails;\n\n/**\n * Format when registering an extension. Generally, the extension\n * should have these values as `extension` static property,\n * but you can override name or type by providing an object.\n * @category extensions\n * @advanced\n */\ninterface ExtensionFormat\n{\n /** The extension type, can be multiple types */\n type: ExtensionType | ExtensionType[];\n /** Optional. Some plugins provide an API name/property, such as Renderer plugins */\n name?: string;\n /** Optional, used for sorting the plugins in a particular order */\n priority?: number;\n /** Reference to the plugin object/class */\n ref: any;\n}\n\n/**\n * Extension format that is used internally for registrations.\n * @category extensions\n * @ignore\n */\ninterface StrictExtensionFormat extends ExtensionFormat\n{\n /** The extension type, always expressed as multiple, even if a single */\n type: ExtensionType[];\n}\n\n/**\n * The function that is called when an extension is added or removed.\n * @category extensions\n * @ignore\n */\ntype ExtensionHandler = (extension: StrictExtensionFormat) => void;\n\n/**\n * Convert input into extension format data.\n * @ignore\n */\nconst normalizeExtension = (ext: ExtensionFormat | any): StrictExtensionFormat =>\n{\n // Class/Object submission, use extension object\n if (typeof ext === 'function' || (typeof ext === 'object' && ext.extension))\n {\n // #if _DEBUG\n if (!ext.extension)\n {\n throw new Error('Extension class must have an extension object');\n }\n // #endif\n const metadata: ExtensionMetadataDetails = (typeof ext.extension !== 'object')\n ? { type: ext.extension }\n : ext.extension;\n\n ext = { ...metadata, ref: ext };\n }\n if (typeof ext === 'object')\n {\n ext = { ...ext };\n }\n else\n {\n throw new Error('Invalid extension type');\n }\n\n if (typeof ext.type === 'string')\n {\n ext.type = [ext.type];\n }\n\n return ext;\n};\n\n/**\n * Get the priority for an extension.\n * @ignore\n * @param ext - Any extension\n * @param defaultPriority - Fallback priority if none is defined.\n * @returns The priority for the extension.\n * @category extensions\n */\nexport const normalizeExtensionPriority = (ext: ExtensionFormat | any, defaultPriority: number): number =>\n normalizeExtension(ext).priority ?? defaultPriority;\n\n/**\n * Global registration system for all PixiJS extensions. Provides a centralized way to add, remove,\n * and manage functionality across the engine.\n *\n * Features:\n * - Register custom extensions and plugins\n * - Handle multiple extension types\n * - Priority-based ordering\n * @example\n * ```ts\n * import { extensions, ExtensionType } from 'pixi.js';\n *\n * // Register a simple object extension\n * extensions.add({\n * extension: {\n * type: ExtensionType.LoadParser,\n * name: 'my-loader',\n * priority: 100, // Optional priority for ordering\n * },\n * // add load parser functions\n * });\n *\n * // Register a class-based extension\n * class MyRendererPlugin {\n * static extension = {\n * type: [ExtensionType.WebGLSystem, ExtensionType.WebGPUSystem],\n * name: 'myRendererPlugin'\n * };\n *\n * // add renderer plugin methods\n * }\n * extensions.add(MyRendererPlugin);\n *\n * // Remove extensions\n * extensions.remove(MyRendererPlugin);\n * ```\n * @remarks\n * - Extensions must have a type from {@link ExtensionType}\n * - Can be registered before or after their handlers\n * - Supports priority-based ordering\n * - Automatically normalizes extension formats\n * @see {@link ExtensionType} For all available extension types\n * @see {@link ExtensionFormat} For extension registration format\n * @see {@link Application} For application plugin system\n * @see {@link LoaderParser} For asset loading extensions\n * @category extensions\n * @standard\n * @class\n */\nconst extensions = {\n\n /** @ignore */\n _addHandlers: {} as Partial<Record<ExtensionType, ExtensionHandler>>,\n\n /** @ignore */\n _removeHandlers: {} as Partial<Record<ExtensionType, ExtensionHandler>>,\n\n /** @ignore */\n _queue: {} as Partial<Record<ExtensionType, StrictExtensionFormat[]>>,\n\n /**\n * Remove extensions from PixiJS.\n * @param extensions - Extensions to be removed. Can be:\n * - Extension class with static `extension` property\n * - Extension format object with `type` and `ref`\n * - Multiple extensions as separate arguments\n * @returns {extensions} this for chaining\n * @example\n * ```ts\n * // Remove a single extension\n * extensions.remove(MyRendererPlugin);\n *\n * // Remove multiple extensions\n * extensions.remove(\n * MyRendererPlugin,\n * MySystemPlugin\n * );\n * ```\n * @see {@link ExtensionType} For available extension types\n * @see {@link ExtensionFormat} For extension format details\n */\n remove(...extensions: Array<ExtensionFormat | any>)\n {\n extensions.map(normalizeExtension).forEach((ext) =>\n {\n ext.type.forEach((type) => this._removeHandlers[type]?.(ext));\n });\n\n return this;\n },\n\n /**\n * Register new extensions with PixiJS. Extensions can be registered in multiple formats:\n * - As a class with a static `extension` property\n * - As an extension format object\n * - As multiple extensions passed as separate arguments\n * @param extensions - Extensions to add to PixiJS. Each can be:\n * - A class with static `extension` property\n * - An extension format object with `type` and `ref`\n * - Multiple extensions as separate arguments\n * @returns This extensions instance for chaining\n * @example\n * ```ts\n * // Register a simple extension\n * extensions.add(MyRendererPlugin);\n *\n * // Register multiple extensions\n * extensions.add(\n * MyRendererPlugin,\n * MySystemPlugin,\n * });\n * ```\n * @see {@link ExtensionType} For available extension types\n * @see {@link ExtensionFormat} For extension format details\n * @see {@link extensions.remove} For removing registered extensions\n */\n add(...extensions: Array<ExtensionFormat | any>)\n {\n // Handle any extensions either passed as class w/ data or as data\n extensions.map(normalizeExtension).forEach((ext) =>\n {\n ext.type.forEach((type) =>\n {\n const handlers = this._addHandlers;\n const queue = this._queue;\n\n if (!handlers[type])\n {\n queue[type] = queue[type] || [];\n queue[type]?.push(ext);\n }\n else\n {\n handlers[type]?.(ext);\n }\n });\n });\n\n return this;\n },\n\n /**\n * Internal method to handle extensions by name.\n * @param type - The extension type.\n * @param onAdd - Function handler when extensions are added/registered {@link StrictExtensionFormat}.\n * @param onRemove - Function handler when extensions are removed/unregistered {@link StrictExtensionFormat}.\n * @returns this for chaining.\n * @internal\n * @ignore\n */\n handle(type: ExtensionType, onAdd: ExtensionHandler, onRemove: ExtensionHandler)\n {\n const addHandlers = this._addHandlers;\n const removeHandlers = this._removeHandlers;\n\n // #if _DEBUG\n if (addHandlers[type] || removeHandlers[type])\n {\n throw new Error(`Extension type ${type} already has a handler`);\n }\n // #endif\n\n addHandlers[type] = onAdd;\n removeHandlers[type] = onRemove;\n\n // Process the queue\n const queue = this._queue;\n\n // Process any plugins that have been registered before the handler\n if (queue[type])\n {\n queue[type]?.forEach((ext) => onAdd(ext));\n delete queue[type];\n }\n\n return this;\n },\n\n /**\n * Handle a type, but using a map by `name` property.\n * @param type - Type of extension to handle.\n * @param map - The object map of named extensions.\n * @returns this for chaining.\n * @ignore\n */\n handleByMap(type: ExtensionType, map: Record<string, any>)\n {\n return this.handle(type,\n (extension) =>\n {\n if (extension.name)\n {\n map[extension.name] = extension.ref;\n }\n },\n (extension) =>\n {\n if (extension.name)\n {\n delete map[extension.name];\n }\n }\n );\n },\n\n /**\n * Handle a type, but using a list of extensions with a `name` property.\n * @param type - Type of extension to handle.\n * @param map - The array of named extensions.\n * @param defaultPriority - Fallback priority if none is defined.\n * @returns this for chaining.\n * @ignore\n */\n handleByNamedList(type: ExtensionType, map: {name: string, value: any}[], defaultPriority = -1)\n {\n return this.handle(\n type,\n (extension) =>\n {\n const index = map.findIndex((item) => item.name === extension.name);\n\n if (index >= 0) return;\n\n map.push({ name: extension.name, value: extension.ref });\n map.sort((a, b) =>\n normalizeExtensionPriority(b.value, defaultPriority)\n - normalizeExtensionPriority(a.value, defaultPriority));\n },\n (extension) =>\n {\n const index = map.findIndex((item) => item.name === extension.name);\n\n if (index !== -1)\n {\n map.splice(index, 1);\n }\n }\n );\n },\n\n /**\n * Handle a type, but using a list of extensions.\n * @param type - Type of extension to handle.\n * @param list - The list of extensions.\n * @param defaultPriority - The default priority to use if none is specified.\n * @returns this for chaining.\n * @ignore\n */\n handleByList(type: ExtensionType, list: any[], defaultPriority = -1)\n {\n return this.handle(\n type,\n (extension) =>\n {\n if (list.includes(extension.ref))\n {\n return;\n }\n\n list.push(extension.ref);\n list.sort((a, b) =>\n normalizeExtensionPriority(b, defaultPriority) - normalizeExtensionPriority(a, defaultPriority));\n },\n (extension) =>\n {\n const index = list.indexOf(extension.ref);\n\n if (index !== -1)\n {\n list.splice(index, 1);\n }\n }\n );\n },\n\n /**\n * Mixin the source object(s) properties into the target class's prototype.\n * Copies all property descriptors from source objects to the target's prototype.\n * @param Target - The target class to mix properties into\n * @param sources - One or more source objects containing properties to mix in\n * @example\n * ```ts\n * // Create a mixin with shared properties\n * const moveable = {\n * x: 0,\n * y: 0,\n * move(x: number, y: number) {\n * this.x += x;\n * this.y += y;\n * }\n * };\n *\n * // Create a mixin with computed properties\n * const scalable = {\n * scale: 1,\n * get scaled() {\n * return this.scale > 1;\n * }\n * };\n *\n * // Apply mixins to a class\n * extensions.mixin(Sprite, moveable, scalable);\n *\n * // Use mixed-in properties\n * const sprite = new Sprite();\n * sprite.move(10, 20);\n * console.log(sprite.x, sprite.y); // 10, 20\n * ```\n * @remarks\n * - Copies all properties including getters/setters\n * - Does not modify source objects\n * - Preserves property descriptors\n * @see {@link Object.defineProperties} For details on property descriptors\n * @see {@link Object.getOwnPropertyDescriptors} For details on property copying\n */\n mixin(Target: any, ...sources: Parameters<typeof Object.getOwnPropertyDescriptors>[0][])\n {\n // Apply each source's properties to the target prototype\n for (const source of sources)\n {\n Object.defineProperties(Target.prototype, Object.getOwnPropertyDescriptors(source));\n }\n }\n};\n\nexport {\n extensions,\n ExtensionType,\n};\nexport type {\n StrictExtensionFormat as ExtensionFormat,\n ExtensionFormat as ExtensionFormatLoose,\n ExtensionHandler,\n ExtensionMetadata,\n ExtensionMetadataDetails\n};\n", "import type { ICanvas } from '../../environment/canvas/ICanvas';\nimport type { WebGLOptions, WebGLPipes, WebGLRenderer } from './gl/WebGLRenderer';\nimport type { WebGPUOptions, WebGPUPipes, WebGPURenderer } from './gpu/WebGPURenderer';\n\n/**\n * A generic renderer that can be either a WebGL or WebGPU renderer.\n * @category rendering\n * @extends WebGLRenderer\n * @extends WebGPURenderer\n * @standard\n */\nexport type Renderer<T extends ICanvas = HTMLCanvasElement> = WebGLRenderer<T> | WebGPURenderer<T>;\n/**\n * Generic pipes for the renderer.\n * @category rendering\n * @advanced\n */\nexport type RenderPipes = WebGLPipes | WebGPUPipes;\n/**\n * Options for the renderer.\n * @extends WebGLOptions\n * @extends WebGPUOptions\n * @category rendering\n * @standard\n */\nexport interface RendererOptions extends WebGLOptions, WebGPUOptions {}\n\n/**\n * Ids for the different render types.\n * The idea is that you can use bitwise operations to filter whether or not you want to do something\n * in a certain render type.\n * Filters for example can be compatible for both webGL or WebGPU but not compatible with canvas.\n * So internally if it works with both we set filter.compatibleRenderers = RendererType.WEBGL | RendererType.WEBGPU\n * if it only works with webgl we set filter.compatibleRenderers = RendererType.WEBGL\n * @category rendering\n * @internal\n */\nexport enum RendererType\n{\n /** The WebGL renderer */\n WEBGL = 0b01,\n /** The WebGPU renderer */\n WEBGPU = 0b10,\n /** Either WebGL or WebGPU renderer */\n BOTH = 0b11\n}\n\n/**\n * The GPU power preference for the WebGPU context.\n * This is an optional hint indicating what configuration of GPU is suitable for the WebGPU context,\n *\n * - `'high-performance'` will prioritize rendering performance over power consumption,\n * - `'low-power'` will prioritize power saving over rendering performance.\n * @category rendering\n * @advanced\n */\nexport type GpuPowerPreference = 'low-power' | 'high-performance';\n", "import EventEmitter from './index.js'\n\nexport { EventEmitter }\nexport default EventEmitter\n", "var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return\"string\"==typeof r?r.length>0:\"number\"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?\"0\"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,p=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s+([+-]?\\d*\\.?\\d+)%\\s+([+-]?\\d*\\.?\\d+)%\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,v=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,m=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},\"hex\"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},\"rgb\"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u=\"deg\"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},\"hsl\"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},\"rgb\"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},\"hsl\"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},\"hsv\"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return\"string\"==typeof r?N(r.trim(),y.string):\"object\"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):\"\",\"#\"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?\"rgba(\"+t+\", \"+n+\", \"+e+\", \"+u+\")\":\"rgb(\"+t+\", \"+n+\", \"+e+\")\";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?\"hsla(\"+t+\", \"+n+\"%, \"+e+\"%, \"+u+\")\":\"hsl(\"+t+\", \"+n+\"%, \"+e+\"%)\";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return\"number\"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return\"number\"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};export{j as Colord,w as colord,k as extend,I as getFormat,E as random};\n", "export default function(e,f){var a={white:\"#ffffff\",bisque:\"#ffe4c4\",blue:\"#0000ff\",cadetblue:\"#5f9ea0\",chartreuse:\"#7fff00\",chocolate:\"#d2691e\",coral:\"#ff7f50\",antiquewhite:\"#faebd7\",aqua:\"#00ffff\",azure:\"#f0ffff\",whitesmoke:\"#f5f5f5\",papayawhip:\"#ffefd5\",plum:\"#dda0dd\",blanchedalmond:\"#ffebcd\",black:\"#000000\",gold:\"#ffd700\",goldenrod:\"#daa520\",gainsboro:\"#dcdcdc\",cornsilk:\"#fff8dc\",cornflowerblue:\"#6495ed\",burlywood:\"#deb887\",aquamarine:\"#7fffd4\",beige:\"#f5f5dc\",crimson:\"#dc143c\",cyan:\"#00ffff\",darkblue:\"#00008b\",darkcyan:\"#008b8b\",darkgoldenrod:\"#b8860b\",darkkhaki:\"#bdb76b\",darkgray:\"#a9a9a9\",darkgreen:\"#006400\",darkgrey:\"#a9a9a9\",peachpuff:\"#ffdab9\",darkmagenta:\"#8b008b\",darkred:\"#8b0000\",darkorchid:\"#9932cc\",darkorange:\"#ff8c00\",darkslateblue:\"#483d8b\",gray:\"#808080\",darkslategray:\"#2f4f4f\",darkslategrey:\"#2f4f4f\",deeppink:\"#ff1493\",deepskyblue:\"#00bfff\",wheat:\"#f5deb3\",firebrick:\"#b22222\",floralwhite:\"#fffaf0\",ghostwhite:\"#f8f8ff\",darkviolet:\"#9400d3\",magenta:\"#ff00ff\",green:\"#008000\",dodgerblue:\"#1e90ff\",grey:\"#808080\",honeydew:\"#f0fff0\",hotpink:\"#ff69b4\",blueviolet:\"#8a2be2\",forestgreen:\"#228b22\",lawngreen:\"#7cfc00\",indianred:\"#cd5c5c\",indigo:\"#4b0082\",fuchsia:\"#ff00ff\",brown:\"#a52a2a\",maroon:\"#800000\",mediumblue:\"#0000cd\",lightcoral:\"#f08080\",darkturquoise:\"#00ced1\",lightcyan:\"#e0ffff\",ivory:\"#fffff0\",lightyellow:\"#ffffe0\",lightsalmon:\"#ffa07a\",lightseagreen:\"#20b2aa\",linen:\"#faf0e6\",mediumaquamarine:\"#66cdaa\",lemonchiffon:\"#fffacd\",lime:\"#00ff00\",khaki:\"#f0e68c\",mediumseagreen:\"#3cb371\",limegreen:\"#32cd32\",mediumspringgreen:\"#00fa9a\",lightskyblue:\"#87cefa\",lightblue:\"#add8e6\",midnightblue:\"#191970\",lightpink:\"#ffb6c1\",mistyrose:\"#ffe4e1\",moccasin:\"#ffe4b5\",mintcream:\"#f5fffa\",lightslategray:\"#778899\",lightslategrey:\"#778899\",navajowhite:\"#ffdead\",navy:\"#000080\",mediumvioletred:\"#c71585\",powderblue:\"#b0e0e6\",palegoldenrod:\"#eee8aa\",oldlace:\"#fdf5e6\",paleturquoise:\"#afeeee\",mediumturquoise:\"#48d1cc\",mediumorchid:\"#ba55d3\",rebeccapurple:\"#663399\",lightsteelblue:\"#b0c4de\",mediumslateblue:\"#7b68ee\",thistle:\"#d8bfd8\",tan:\"#d2b48c\",orchid:\"#da70d6\",mediumpurple:\"#9370db\",purple:\"#800080\",pink:\"#ffc0cb\",skyblue:\"#87ceeb\",springgreen:\"#00ff7f\",palegreen:\"#98fb98\",red:\"#ff0000\",yellow:\"#ffff00\",slateblue:\"#6a5acd\",lavenderblush:\"#fff0f5\",peru:\"#cd853f\",palevioletred:\"#db7093\",violet:\"#ee82ee\",teal:\"#008080\",slategray:\"#708090\",slategrey:\"#708090\",aliceblue:\"#f0f8ff\",darkseagreen:\"#8fbc8f\",darkolivegreen:\"#556b2f\",greenyellow:\"#adff2f\",seagreen:\"#2e8b57\",seashell:\"#fff5ee\",tomato:\"#ff6347\",silver:\"#c0c0c0\",sienna:\"#a0522d\",lavender:\"#e6e6fa\",lightgreen:\"#90ee90\",orange:\"#ffa500\",orangered:\"#ff4500\",steelblue:\"#4682b4\",royalblue:\"#4169e1\",turquoise:\"#40e0d0\",yellowgreen:\"#9acd32\",salmon:\"#fa8072\",saddlebrown:\"#8b4513\",sandybrown:\"#f4a460\",rosybrown:\"#bc8f8f\",darksalmon:\"#e9967a\",lightgoldenrodyellow:\"#fafad2\",snow:\"#fffafa\",lightgrey:\"#d3d3d3\",lightgray:\"#d3d3d3\",dimgray:\"#696969\",dimgrey:\"#696969\",olivedrab:\"#6b8e23\",olive:\"#808000\"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return\"transparent\";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b=\"black\";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d=\"transparent\"===r?\"#0000\":a[r];return d?new e(d).toRgb():null},\"name\"])}\n", "import { colord, extend } from '@pixi/colord';\nimport namesPlugin from '@pixi/colord/plugins/names';\n\nimport type { AnyColor, HslaColor, HslColor, HsvaColor, HsvColor, RgbaColor, RgbColor } from '@pixi/colord';\n\nextend([namesPlugin]);\n\n/**\n * Array of RGBA color components, where each component is a number between 0 and 1.\n * The array must contain exactly 4 numbers in the order: red, green, blue, alpha.\n * @example\n * ```ts\n * // Full white (opaque)\n * const white: RgbaArray = [1, 1, 1, 1];\n *\n * // Semi-transparent red\n * const transparentRed: RgbaArray = [1, 0, 0, 0.5];\n * ```\n * @remarks\n * - All components must be between 0 and 1\n * - Array must contain exactly 4 values\n * - Order is [red, green, blue, alpha]\n * @see {@link Color} For the main color utility class\n * @category color\n * @standard\n */\nexport type RgbaArray = [number, number, number, number];\n\n/**\n * Valid color formats supported by PixiJS. These types extend from [colord](https://www.npmjs.com/package/colord)\n * with additional PixiJS-specific formats.\n *\n * Common Formats:\n * ```ts\n * // CSS Color Names\n * new Color('red');\n * new Color('blue');\n * new Color('green');\n *\n * // Hex Values\n * new Color(0xff0000); // RGB integer\n * new Color('#ff0000'); // 6-digit hex\n * new Color('#f00'); // 3-digit hex\n * new Color('#ff0000ff'); // 8-digit hex (with alpha)\n * new Color('#f00f'); // 4-digit hex (with alpha)\n *\n * // RGB/RGBA Objects\n * new Color({ r: 255, g: 0, b: 0 });\n * new Color({ r: 255, g: 0, b: 0, a: 0.5 });\n *\n * // RGB/RGBA Strings\n * new Color('rgb(255, 0, 0)');\n * new Color('rgba(255, 0, 0, 0.5)');\n * new Color('rgb(100% 0% 0%)');\n * new Color('rgba(100% 0% 0% / 50%)');\n *\n * // Arrays (normalized 0-1)\n * new Color([1, 0, 0]); // RGB\n * new Color([1, 0, 0, 0.5]); // RGBA\n * new Color(new Float32Array([1, 0, 0, 0.5]));\n *\n * // Arrays (0-255)\n * new Color(new Uint8Array([255, 0, 0]));\n * new Color(new Uint8ClampedArray([255, 0, 0, 128]));\n *\n * // HSL/HSLA\n * new Color({ h: 0, s: 100, l: 50 });\n * new Color({ h: 0, s: 100, l: 50, a: 0.5 });\n * new Color('hsl(0, 100%, 50%)');\n * new Color('hsla(0deg 100% 50% / 50%)');\n *\n * // HSV/HSVA\n * new Color({ h: 0, s: 100, v: 100 });\n * new Color({ h: 0, s: 100, v: 100, a: 0.5 });\n * ```\n * @remarks\n * - All color values are normalized internally to 0-1 range\n * - Alpha is always between 0-1\n * - Invalid colors will throw an error\n * - Original format is preserved when possible\n * @see {@link Color} For the main color utility class\n * @see {@link https://www.w3.org/TR/css-color-4} CSS Color Level 4 Specification\n * @since 7.2.0\n * @category color\n * @standard\n */\nexport type ColorSource =\n | string\n | number\n | number[]\n | Float32Array\n | Uint8Array\n | Uint8ClampedArray\n | HslColor\n | HslaColor\n | HsvColor\n | HsvaColor\n | RgbColor\n | RgbaColor\n | Color\n | number;\n\ntype ColorSourceTypedArray = Float32Array | Uint8Array | Uint8ClampedArray;\n\n/**\n * Color utility class for managing colors in various formats. Provides a unified way to work\n * with colors across your PixiJS application.\n *\n * Features:\n * - Accepts multiple color formats (hex, RGB, HSL, etc.)\n * - Automatic format conversion\n * - Color manipulation methods\n * - Component access (r,g,b,a)\n * - Chainable operations\n * @example\n * ```js\n * import { Color } from 'pixi.js';\n *\n * new Color('red').toArray(); // [1, 0, 0, 1]\n * new Color(0xff0000).toArray(); // [1, 0, 0, 1]\n * new Color('ff0000').toArray(); // [1, 0, 0, 1]\n * new Color('#f00').toArray(); // [1, 0, 0, 1]\n * new Color('0xff0000ff').toArray(); // [1, 0, 0, 1]\n * new Color('#f00f').toArray(); // [1, 0, 0, 1]\n * new Color({ r: 255, g: 0, b: 0, a: 0.5 }).toArray(); // [1, 0, 0, 0.5]\n * new Color('rgb(255, 0, 0, 0.5)').toArray(); // [1, 0, 0, 0.5]\n * new Color([1, 1, 1]).toArray(); // [1, 1, 1, 1]\n * new Color([1, 0, 0, 0.5]).toArray(); // [1, 0, 0, 0.5]\n * new Color(new Float32Array([1, 0, 0, 0.5])).toArray(); // [1, 0, 0, 0.5]\n * new Color(new Uint8Array([255, 0, 0, 255])).toArray(); // [1, 0, 0, 1]\n * new Color(new Uint8ClampedArray([255, 0, 0, 255])).toArray(); // [1, 0, 0, 1]\n * new Color({ h: 0, s: 100, l: 50, a: 0.5 }).toArray(); // [1, 0, 0, 0.5]\n * new Color('hsl(0, 100%, 50%, 50%)').toArray(); // [1, 0, 0, 0.5]\n * new Color({ h: 0, s: 100, v: 100, a: 0.5 }).toArray(); // [1, 0, 0, 0.5]\n *\n * // Convert between formats\n * const color = new Color('red');\n * color.toHex(); // \"#ff0000\"\n * color.toRgbString(); // \"rgb(255,0,0,1)\"\n * color.toNumber(); // 0xff0000\n *\n * // Access components\n * color.red; // 1\n * color.green; // 0\n * color.blue; // 0\n * color.alpha; // 1\n *\n * // Chain operations\n * color\n * .setAlpha(0.5)\n * .multiply([0.5, 0.5, 0.5])\n * .premultiply(0.8);\n * ```\n * @remarks\n * The Color class automatically normalizes all color values internally:\n * - RGB components are stored as floats between 0-1\n * - Alpha is always between 0-1\n * - Color operations clamp values to valid ranges\n * - Original input format is preserved when possible\n * @since 7.2.0\n * @category color\n * @standard\n */\nexport class Color\n{\n /**\n * Static shared Color instance used for utility operations. This is a singleton color object\n * that can be reused to avoid creating unnecessary Color instances.\n * > [!IMPORTANT] You should be careful when using this shared instance, as it is mutable and can be\n * > changed by any code that uses it.\n * >\n * > It is best used for one-off color operations or temporary transformations.\n * > For persistent colors, create your own Color instance instead.\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Use shared instance for one-off color operations\n * Color.shared.setValue(0xff0000);\n * const redHex = Color.shared.toHex(); // \"#ff0000\"\n * const redRgb = Color.shared.toRgbArray(); // [1, 0, 0]\n *\n * // Temporary color transformations\n * const colorNumber = Color.shared\n * .setValue('#ff0000') // Set to red\n * .setAlpha(0.5) // Make semi-transparent\n * .premultiply(0.8) // Apply premultiplication\n * .toNumber(); // Convert to number\n *\n * // Chain multiple operations\n * const result = Color.shared\n * .setValue(someColor)\n * .multiply(tintColor)\n * .toPremultiplied(alpha);\n * ```\n * @remarks\n * - This is a shared instance - be careful about multiple code paths using it simultaneously\n * - Use for temporary color operations to avoid allocating new Color instances\n * - The value is preserved between operations, so reset if needed\n * - For persistent colors, create your own Color instance instead\n */\n public static readonly shared = new Color();\n\n /**\n * Temporary Color object for static uses internally.\n * As to not conflict with Color.shared.\n * @ignore\n */\n private static readonly _temp = new Color();\n\n /** Pattern for hex strings */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private static readonly HEX_PATTERN = /^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;\n\n /** Internal color source, from constructor or set value */\n private _value: Exclude<ColorSource, Color> | null;\n\n /** Normalized rgba component, floats from 0-1 */\n private _components: Float32Array;\n\n /** Cache color as number */\n private _int: number;\n\n /** An array of the current Color. Only populated when `toArray` functions are called */\n private _arrayRgba: number[] | null;\n private _arrayRgb: number[] | null;\n\n /**\n * @param {ColorSource} value - Optional value to use, if not provided, white is used.\n */\n constructor(value: ColorSource = 0xffffff)\n {\n this._value = null;\n this._components = new Float32Array(4);\n this._components.fill(1);\n this._int = 0xffffff;\n this.value = value;\n }\n\n /**\n * Get the red component of the color, normalized between 0 and 1.\n * @example\n * ```ts\n * const color = new Color('red');\n * console.log(color.red); // 1\n *\n * const green = new Color('#00ff00');\n * console.log(green.red); // 0\n * ```\n */\n get red(): number\n {\n return this._components[0];\n }\n\n /**\n * Get the green component of the color, normalized between 0 and 1.\n * @example\n * ```ts\n * const color = new Color('lime');\n * console.log(color.green); // 1\n *\n * const red = new Color('#ff0000');\n * console.log(red.green); // 0\n * ```\n */\n get green(): number\n {\n return this._components[1];\n }\n\n /**\n * Get the blue component of the color, normalized between 0 and 1.\n * @example\n * ```ts\n * const color = new Color('blue');\n * console.log(color.blue); // 1\n *\n * const yellow = new Color('#ffff00');\n * console.log(yellow.blue); // 0\n * ```\n */\n get blue(): number\n {\n return this._components[2];\n }\n\n /**\n * Get the alpha component of the color, normalized between 0 and 1.\n * @example\n * ```ts\n * const color = new Color('red');\n * console.log(color.alpha); // 1 (fully opaque)\n *\n * const transparent = new Color('rgba(255, 0, 0, 0.5)');\n * console.log(transparent.alpha); // 0.5 (semi-transparent)\n * ```\n */\n get alpha(): number\n {\n return this._components[3];\n }\n\n /**\n * Sets the color value and returns the instance for chaining.\n *\n * This is a chainable version of setting the `value` property.\n * @param value - The color to set. Accepts various formats:\n * - Hex strings/numbers (e.g., '#ff0000', 0xff0000)\n * - RGB/RGBA values (arrays, objects)\n * - CSS color names\n * - HSL/HSLA values\n * - HSV/HSVA values\n * @returns The Color instance for chaining\n * @example\n * ```ts\n * // Basic usage\n * const color = new Color();\n * color.setValue('#ff0000')\n * .setAlpha(0.5)\n * .premultiply(0.8);\n *\n * // Different formats\n * color.setValue(0xff0000); // Hex number\n * color.setValue('#ff0000'); // Hex string\n * color.setValue([1, 0, 0]); // RGB array\n * color.setValue([1, 0, 0, 0.5]); // RGBA array\n * color.setValue({ r: 1, g: 0, b: 0 }); // RGB object\n *\n * // Copy from another color\n * const red = new Color('red');\n * color.setValue(red);\n * ```\n * @throws {Error} If the color value is invalid or null\n * @see {@link Color.value} For the underlying value property\n */\n public setValue(value: ColorSource): this\n {\n this.value = value;\n\n return this;\n }\n\n /**\n * The current color source. This property allows getting and setting the color value\n * while preserving the original format where possible.\n * @remarks\n * When setting:\n * - Setting to a `Color` instance copies its source and components\n * - Setting to other valid sources normalizes and stores the value\n * - Setting to `null` throws an Error\n * - The color remains unchanged if normalization fails\n *\n * When getting:\n * - Returns `null` if color was modified by {@link Color.multiply} or {@link Color.premultiply}\n * - Otherwise returns the original color source\n * @example\n * ```ts\n * // Setting different color formats\n * const color = new Color();\n *\n * color.value = 0xff0000; // Hex number\n * color.value = '#ff0000'; // Hex string\n * color.value = [1, 0, 0]; // RGB array\n * color.value = [1, 0, 0, 0.5]; // RGBA array\n * color.value = { r: 1, g: 0, b: 0 }; // RGB object\n *\n * // Copying from another color\n * const red = new Color('red');\n * color.value = red; // Copies red's components\n *\n * // Getting the value\n * console.log(color.value); // Returns original format\n *\n * // After modifications\n * color.multiply([0.5, 0.5, 0.5]);\n * console.log(color.value); // Returns null\n * ```\n * @throws {Error} When attempting to set `null`\n */\n set value(value: ColorSource | null)\n {\n // Support copying from other Color objects\n if (value instanceof Color)\n {\n this._value = this._cloneSource(value._value);\n this._int = value._int;\n this._components.set(value._components);\n }\n else if (value === null)\n {\n throw new Error('Cannot set Color#value to null');\n }\n else if (this._value === null || !this._isSourceEqual(this._value, value))\n {\n this._value = this._cloneSource(value);\n this._normalize(this._value);\n }\n }\n get value(): Exclude<ColorSource, Color> | null\n {\n return this._value;\n }\n\n /**\n * Copy a color source internally.\n * @param value - Color source\n */\n private _cloneSource(value: Exclude<ColorSource, Color> | null): Exclude<ColorSource, Color> | null\n {\n if (typeof value === 'string' || typeof value === 'number' || value instanceof Number || value === null)\n {\n return value;\n }\n else if (Array.isArray(value) || ArrayBuffer.isView(value))\n {\n return value.slice(0);\n }\n else if (typeof value === 'object' && value !== null)\n {\n return { ...value };\n }\n\n return value;\n }\n\n /**\n * Equality check for color sources.\n * @param value1 - First color source\n * @param value2 - Second color source\n * @returns `true` if the color sources are equal, `false` otherwise.\n */\n private _isSourceEqual(value1: Exclude<ColorSource, Color>, value2: Exclude<ColorSource, Color>): boolean\n {\n const type1 = typeof value1;\n const type2 = typeof value2;\n\n // Mismatched types\n if (type1 !== type2)\n {\n return false;\n }\n // Handle numbers/strings and things that extend Number\n // important to do the instanceof Number first, as this is \"object\" type\n else if (type1 === 'number' || type1 === 'string' || value1 instanceof Number)\n {\n return value1 === value2;\n }\n // Handle Arrays and TypedArrays\n else if (\n (Array.isArray(value1) && Array.isArray(value2))\n || (ArrayBuffer.isView(value1) && ArrayBuffer.isView(value2))\n )\n {\n if (value1.length !== value2.length)\n {\n return false;\n }\n\n return value1.every((v, i) => v === value2[i]);\n }\n // Handle Objects\n else if (value1 !== null && value2 !== null)\n {\n const keys1 = Object.keys(value1) as (keyof typeof value1)[];\n const keys2 = Object.keys(value2) as (keyof typeof value2)[];\n\n if (keys1.length !== keys2.length)\n {\n return false;\n }\n\n return keys1.every((key) => value1[key] === value2[key]);\n }\n\n return value1 === value2;\n }\n\n /**\n * Convert to a RGBA color object with normalized components (0-1).\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Convert colors to RGBA objects\n * new Color('white').toRgba(); // returns { r: 1, g: 1, b: 1, a: 1 }\n * new Color('#ff0000').toRgba(); // returns { r: 1, g: 0, b: 0, a: 1 }\n *\n * // With transparency\n * new Color('rgba(255,0,0,0.5)').toRgba(); // returns { r: 1, g: 0, b: 0, a: 0.5 }\n * ```\n * @returns An RGBA object with normalized components\n */\n public toRgba(): RgbaColor\n {\n const [r, g, b, a] = this._components;\n\n return { r, g, b, a };\n }\n\n /**\n * Convert to a RGB color object with normalized components (0-1).\n *\n * Alpha component is omitted in the output.\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Convert colors to RGB objects\n * new Color('white').toRgb(); // returns { r: 1, g: 1, b: 1 }\n * new Color('#ff0000').toRgb(); // returns { r: 1, g: 0, b: 0 }\n *\n * // Alpha is ignored\n * new Color('rgba(255,0,0,0.5)').toRgb(); // returns { r: 1, g: 0, b: 0 }\n * ```\n * @returns An RGB object with normalized components\n */\n public toRgb(): RgbColor\n {\n const [r, g, b] = this._components;\n\n return { r, g, b };\n }\n\n /**\n * Convert to a CSS-style rgba string representation.\n *\n * RGB components are scaled to 0-255 range, alpha remains 0-1.\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Convert colors to RGBA strings\n * new Color('white').toRgbaString(); // returns \"rgba(255,255,255,1)\"\n * new Color('#ff0000').toRgbaString(); // returns \"rgba(255,0,0,1)\"\n *\n * // With transparency\n * new Color([1, 0, 0, 0.5]).toRgbaString(); // returns \"rgba(255,0,0,0.5)\"\n * ```\n * @returns A CSS-compatible rgba string\n */\n public toRgbaString(): string\n {\n const [r, g, b] = this.toUint8RgbArray();\n\n return `rgba(${r},${g},${b},${this.alpha})`;\n }\n\n /**\n * Convert to an [R, G, B] array of clamped uint8 values (0 to 255).\n * @param {number[]|Uint8Array|Uint8ClampedArray} [out] - Optional output array. If not provided,\n * a cached array will be used and returned.\n * @returns Array containing RGB components as integers between 0-255\n * @example\n * ```ts\n * // Basic usage\n * new Color('white').toUint8RgbArray(); // returns [255, 255, 255]\n * new Color('#ff0000').toUint8RgbArray(); // returns [255, 0, 0]\n *\n * // Using custom output array\n * const rgb = new Uint8Array(3);\n * new Color('blue').toUint8RgbArray(rgb); // rgb is now [0, 0, 255]\n *\n * // Using different array types\n * new Color('red').toUint8RgbArray(new Uint8ClampedArray(3)); // [255, 0, 0]\n * new Color('red').toUint8RgbArray([]); // [255, 0, 0]\n * ```\n * @remarks\n * - Output values are always clamped between 0-255\n * - Alpha component is not included in output\n * - Reuses internal cache array if no output array provided\n */\n public toUint8RgbArray<T extends number[] | Uint8Array | Uint8ClampedArray = number[]>(out?: T): T\n {\n const [r, g, b] = this._components;\n\n if (!this._arrayRgb)\n {\n this._arrayRgb = [];\n }\n\n out ||= this._arrayRgb as T;\n\n out[0] = Math.round(r * 255);\n out[1] = Math.round(g * 255);\n out[2] = Math.round(b * 255);\n\n return out;\n }\n\n /**\n * Convert to an [R, G, B, A] array of normalized floats (numbers from 0.0 to 1.0).\n * @param {number[]|Float32Array} [out] - Optional output array. If not provided,\n * a cached array will be used and returned.\n * @returns Array containing RGBA components as floats between 0-1\n * @example\n * ```ts\n * // Basic usage\n * new Color('white').toArray(); // returns [1, 1, 1, 1]\n * new Color('red').toArray(); // returns [1, 0, 0, 1]\n *\n * // With alpha\n * new Color('rgba(255,0,0,0.5)').toArray(); // returns [1, 0, 0, 0.5]\n *\n * // Using custom output array\n * const rgba = new Float32Array(4);\n * new Color('blue').toArray(rgba); // rgba is now [0, 0, 1, 1]\n * ```\n * @remarks\n * - Output values are normalized between 0-1\n * - Includes alpha component as the fourth value\n * - Reuses internal cache array if no output array provided\n */\n public toArray<T extends number[] | Float32Array = number[]>(out?: T): T\n {\n if (!this._arrayRgba)\n {\n this._arrayRgba = [];\n }\n\n out ||= this._arrayRgba as T;\n const [r, g, b, a] = this._components;\n\n out[0] = r;\n out[1] = g;\n out[2] = b;\n out[3] = a;\n\n return out;\n }\n\n /**\n * Convert to an [R, G, B] array of normalized floats (numbers from 0.0 to 1.0).\n * @param {number[]|Float32Array} [out] - Optional output array. If not provided,\n * a cached array will be used and returned.\n * @returns Array containing RGB components as floats between 0-1\n * @example\n * ```ts\n * // Basic usage\n * new Color('white').toRgbArray(); // returns [1, 1, 1]\n * new Color('red').toRgbArray(); // returns [1, 0, 0]\n *\n * // Using custom output array\n * const rgb = new Float32Array(3);\n * new Color('blue').toRgbArray(rgb); // rgb is now [0, 0, 1]\n * ```\n * @remarks\n * - Output values are normalized between 0-1\n * - Alpha component is omitted from output\n * - Reuses internal cache array if no output array provided\n */\n public toRgbArray<T extends number[] | Float32Array = number[]>(out?: T): T\n {\n if (!this._arrayRgb)\n {\n this._arrayRgb = [];\n }\n\n out ||= this._arrayRgb as T;\n const [r, g, b] = this._components;\n\n out[0] = r;\n out[1] = g;\n out[2] = b;\n\n return out;\n }\n\n /**\n * Convert to a hexadecimal number.\n * @returns The color as a 24-bit RGB integer\n * @example\n * ```ts\n * // Basic usage\n * new Color('white').toNumber(); // returns 0xffffff\n * new Color('red').toNumber(); // returns 0xff0000\n *\n * // Store as hex\n * const color = new Color('blue');\n * const hex = color.toNumber(); // 0x0000ff\n * ```\n */\n public toNumber(): number\n {\n return this._int;\n }\n\n /**\n * Convert to a BGR number.\n *\n * Useful for platforms that expect colors in BGR format.\n * @returns The color as a 24-bit BGR integer\n * @example\n * ```ts\n * // Convert RGB to BGR\n * new Color(0xffcc99).toBgrNumber(); // returns 0x99ccff\n *\n * // Common use case: platform-specific color format\n * const color = new Color('orange');\n * const bgrColor = color.toBgrNumber(); // Color with swapped R/B channels\n * ```\n * @remarks\n * This swaps the red and blue channels compared to the normal RGB format:\n * - RGB 0xRRGGBB becomes BGR 0xBBGGRR\n */\n public toBgrNumber(): number\n {\n const [r, g, b] = this.toUint8RgbArray();\n\n return (b << 16) + (g << 8) + r;\n }\n\n /**\n * Convert to a hexadecimal number in little endian format (e.g., BBGGRR).\n *\n * Useful for platforms that expect colors in little endian byte order.\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Convert RGB color to little endian format\n * new Color(0xffcc99).toLittleEndianNumber(); // returns 0x99ccff\n *\n * // Common use cases:\n * const color = new Color('orange');\n * const leColor = color.toLittleEndianNumber(); // Swaps byte order for LE systems\n *\n * // Multiple conversions\n * const colors = {\n * normal: 0xffcc99,\n * littleEndian: new Color(0xffcc99).toLittleEndianNumber(), // 0x99ccff\n * backToNormal: new Color(0x99ccff).toLittleEndianNumber() // 0xffcc99\n * };\n * ```\n * @remarks\n * - Swaps R and B channels in the color value\n * - RGB 0xRRGGBB becomes 0xBBGGRR\n * - Useful for systems that use little endian byte order\n * - Can be used to convert back and forth between formats\n * @returns The color as a number in little endian format (BBGGRR)\n * @see {@link Color.toBgrNumber} For BGR format without byte swapping\n */\n public toLittleEndianNumber(): number\n {\n const value = this._int;\n\n return (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n }\n\n /**\n * Multiply with another color.\n *\n * This action is destructive and modifies the original color.\n * @param {ColorSource} value - The color to multiply by. Accepts any valid color format:\n * - Hex strings/numbers (e.g., '#ff0000', 0xff0000)\n * - RGB/RGBA arrays ([1, 0, 0], [1, 0, 0, 1])\n * - Color objects ({ r: 1, g: 0, b: 0 })\n * - CSS color names ('red', 'blue')\n * @returns this - The Color instance for chaining\n * @example\n * ```ts\n * // Basic multiplication\n * const color = new Color('#ff0000');\n * color.multiply(0x808080); // 50% darker red\n *\n * // With transparency\n * color.multiply([1, 1, 1, 0.5]); // 50% transparent\n *\n * // Chain operations\n * color\n * .multiply('#808080')\n * .multiply({ r: 1, g: 1, b: 1, a: 0.5 });\n * ```\n * @remarks\n * - Multiplies each RGB component and alpha separately\n * - Values are clamped between 0-1\n * - Original color format is lost (value becomes null)\n * - Operation cannot be undone\n */\n public multiply(value: ColorSource): this\n {\n const [r, g, b, a] = Color._temp.setValue(value)._components;\n\n this._components[0] *= r;\n this._components[1] *= g;\n this._components[2] *= b;\n this._components[3] *= a;\n\n this._refreshInt();\n this._value = null;\n\n return this;\n }\n\n /**\n * Converts color to a premultiplied alpha format.\n *\n * This action is destructive and modifies the original color.\n * @param alpha - The alpha value to multiply by (0-1)\n * @param {boolean} [applyToRGB=true] - Whether to premultiply RGB channels\n * @returns {Color} The Color instance for chaining\n * @example\n * ```ts\n * // Basic premultiplication\n * const color = new Color('red');\n * color.premultiply(0.5); // 50% transparent red with premultiplied RGB\n *\n * // Alpha only (RGB unchanged)\n * color.premultiply(0.5, false); // 50% transparent, original RGB\n *\n * // Chain with other operations\n * color\n * .multiply(0x808080)\n * .premultiply(0.5)\n * .toNumber();\n * ```\n * @remarks\n * - RGB channels are multiplied by alpha when applyToRGB is true\n * - Alpha is always set to the provided value\n * - Values are clamped between 0-1\n * - Original color format is lost (value becomes null)\n * - Operation cannot be undone\n */\n public premultiply(alpha: number, applyToRGB = true): this\n {\n if (applyToRGB)\n {\n this._components[0] *= alpha;\n this._components[1] *= alpha;\n this._components[2] *= alpha;\n }\n this._components[3] = alpha;\n\n this._refreshInt();\n this._value = null;\n\n return this;\n }\n\n /**\n * Returns the color as a 32-bit premultiplied alpha integer.\n *\n * Format: 0xAARRGGBB\n * @param {number} alpha - The alpha value to multiply by (0-1)\n * @param {boolean} [applyToRGB=true] - Whether to premultiply RGB channels\n * @returns {number} The premultiplied color as a 32-bit integer\n * @example\n * ```ts\n * // Convert to premultiplied format\n * const color = new Color('red');\n *\n * // Full opacity (0xFFRRGGBB)\n * color.toPremultiplied(1.0); // 0xFFFF0000\n *\n * // 50% transparency with premultiplied RGB\n * color.toPremultiplied(0.5); // 0x7F7F0000\n *\n * // 50% transparency without RGB premultiplication\n * color.toPremultiplied(0.5, false); // 0x7FFF0000\n * ```\n * @remarks\n * - Returns full opacity (0xFF000000) when alpha is 1.0\n * - Returns 0 when alpha is 0.0 and applyToRGB is true\n * - RGB values are rounded during premultiplication\n */\n public toPremultiplied(alpha: number, applyToRGB = true): number\n {\n if (alpha === 1.0)\n {\n return (0xff << 24) + this._int;\n }\n if (alpha === 0.0)\n {\n return applyToRGB ? 0 : this._int;\n }\n let r = (this._int >> 16) & 0xff;\n let g = (this._int >> 8) & 0xff;\n let b = this._int & 0xff;\n\n if (applyToRGB)\n {\n r = ((r * alpha) + 0.5) | 0;\n g = ((g * alpha) + 0.5) | 0;\n b = ((b * alpha) + 0.5) | 0;\n }\n\n return ((alpha * 255) << 24) + (r << 16) + (g << 8) + b;\n }\n\n /**\n * Convert to a hexadecimal string (6 characters).\n * @returns A CSS-compatible hex color string (e.g., \"#ff0000\")\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Basic colors\n * new Color('red').toHex(); // returns \"#ff0000\"\n * new Color('white').toHex(); // returns \"#ffffff\"\n * new Color('black').toHex(); // returns \"#000000\"\n *\n * // From different formats\n * new Color(0xff0000).toHex(); // returns \"#ff0000\"\n * new Color([1, 0, 0]).toHex(); // returns \"#ff0000\"\n * new Color({ r: 1, g: 0, b: 0 }).toHex(); // returns \"#ff0000\"\n * ```\n * @remarks\n * - Always returns a 6-character hex string\n * - Includes leading \"#\" character\n * - Alpha channel is ignored\n * - Values are rounded to nearest hex value\n */\n public toHex(): string\n {\n const hexString = this._int.toString(16);\n\n return `#${'000000'.substring(0, 6 - hexString.length) + hexString}`;\n }\n\n /**\n * Convert to a hexadecimal string with alpha (8 characters).\n * @returns A CSS-compatible hex color string with alpha (e.g., \"#ff0000ff\")\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Fully opaque colors\n * new Color('red').toHexa(); // returns \"#ff0000ff\"\n * new Color('white').toHexa(); // returns \"#ffffffff\"\n *\n * // With transparency\n * new Color('rgba(255, 0, 0, 0.5)').toHexa(); // returns \"#ff00007f\"\n * new Color([1, 0, 0, 0]).toHexa(); // returns \"#ff000000\"\n * ```\n * @remarks\n * - Returns an 8-character hex string\n * - Includes leading \"#\" character\n * - Alpha is encoded in last two characters\n * - Values are rounded to nearest hex value\n */\n public toHexa(): string\n {\n const alphaValue = Math.round(this._components[3] * 255);\n const alphaString = alphaValue.toString(16);\n\n return this.toHex() + '00'.substring(0, 2 - alphaString.length) + alphaString;\n }\n\n /**\n * Set alpha (transparency) value while preserving color components.\n *\n * Provides a chainable interface for setting alpha.\n * @param alpha - Alpha value between 0 (fully transparent) and 1 (fully opaque)\n * @returns The Color instance for chaining\n * @example\n * ```ts\n * // Basic alpha setting\n * const color = new Color('red');\n * color.setAlpha(0.5); // 50% transparent red\n *\n * // Chain with other operations\n * color\n * .setValue('#ff0000')\n * .setAlpha(0.8) // 80% opaque\n * .premultiply(0.5); // Further modify alpha\n *\n * // Reset to fully opaque\n * color.setAlpha(1);\n * ```\n * @remarks\n * - Alpha value is clamped between 0-1\n * - Can be chained with other color operations\n */\n public setAlpha(alpha: number): this\n {\n this._components[3] = this._clamp(alpha);\n\n return this;\n }\n\n /**\n * Normalize the input value into rgba\n * @param value - Input value\n */\n private _normalize(value: Exclude<ColorSource, Color>): void\n {\n let r: number | undefined;\n let g: number | undefined;\n let b: number | undefined;\n let a: number | undefined;\n\n // Number is a primitive so typeof works fine, but in the case\n // that someone creates a class that extends Number, we also\n // need to check for instanceof Number\n if (\n (typeof value === 'number' || value instanceof Number)\n && (value as number) >= 0\n && (value as number) <= 0xffffff\n )\n {\n const int = value as number; // cast required because instanceof Number is ambiguous for TS\n\n r = ((int >> 16) & 0xff) / 255;\n g = ((int >> 8) & 0xff) / 255;\n b = (int & 0xff) / 255;\n a = 1.0;\n }\n else if (\n (Array.isArray(value) || value instanceof Float32Array)\n // Can be rgb or rgba\n && value.length >= 3\n && value.length <= 4\n )\n {\n // make sure all values are 0 - 1\n value = this._clamp(value);\n [r, g, b, a = 1.0] = value;\n }\n else if (\n (value instanceof Uint8Array || value instanceof Uint8ClampedArray)\n // Can be rgb or rgba\n && value.length >= 3\n && value.length <= 4\n )\n {\n // make sure all values are 0 - 255\n value = this._clamp(value, 0, 255);\n [r, g, b, a = 255] = value;\n r /= 255;\n g /= 255;\n b /= 255;\n a /= 255;\n }\n else if (typeof value === 'string' || typeof value === 'object')\n {\n if (typeof value === 'string')\n {\n const match = Color.HEX_PATTERN.exec(value);\n\n if (match)\n {\n // Normalize hex string, remove 0x or # prefix\n value = `#${match[2]}`;\n }\n }\n\n const color = colord(value as AnyColor);\n\n if (color.isValid())\n {\n ({ r, g, b, a } = color.rgba);\n r /= 255;\n g /= 255;\n b /= 255;\n }\n }\n\n // Cache normalized values for rgba and hex integer\n if (r !== undefined)\n {\n this._components[0] = r as number;\n this._components[1] = g as number;\n this._components[2] = b as number;\n this._components[3] = a as number;\n this._refreshInt();\n }\n else\n {\n throw new Error(`Unable to convert color ${value}`);\n }\n }\n\n /** Refresh the internal color rgb number */\n private _refreshInt(): void\n {\n // Clamp values to 0 - 1\n this._clamp(this._components);\n\n const [r, g, b] = this._components;\n\n this._int = ((r * 255) << 16) + ((g * 255) << 8) + ((b * 255) | 0);\n }\n\n /**\n * Clamps values to a range. Will override original values\n * @param value - Value(s) to clamp\n * @param min - Minimum value\n * @param max - Maximum value\n */\n private _clamp<T extends number | number[] | ColorSourceTypedArray>(value: T, min = 0, max = 1): T\n {\n if (typeof value === 'number')\n {\n return Math.min(Math.max(value, min), max) as T;\n }\n\n value.forEach((v, i) =>\n {\n value[i] = Math.min(Math.max(v, min), max);\n });\n\n return value;\n }\n\n /**\n * Check if a value can be interpreted as a valid color format.\n * Supports all color formats that can be used with the Color class.\n * @param value - Value to check\n * @returns True if the value can be used as a color\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // CSS colors and hex values\n * Color.isColorLike('red'); // true\n * Color.isColorLike('#ff0000'); // true\n * Color.isColorLike(0xff0000); // true\n *\n * // Arrays (RGB/RGBA)\n * Color.isColorLike([1, 0, 0]); // true\n * Color.isColorLike([1, 0, 0, 0.5]); // true\n *\n * // TypedArrays\n * Color.isColorLike(new Float32Array([1, 0, 0])); // true\n * Color.isColorLike(new Uint8Array([255, 0, 0])); // true\n * Color.isColorLike(new Uint8ClampedArray([255, 0, 0])); // true\n *\n * // Object formats\n * Color.isColorLike({ r: 1, g: 0, b: 0 }); // true (RGB)\n * Color.isColorLike({ r: 1, g: 0, b: 0, a: 0.5 }); // true (RGBA)\n * Color.isColorLike({ h: 0, s: 100, l: 50 }); // true (HSL)\n * Color.isColorLike({ h: 0, s: 100, l: 50, a: 0.5 }); // true (HSLA)\n * Color.isColorLike({ h: 0, s: 100, v: 100 }); // true (HSV)\n * Color.isColorLike({ h: 0, s: 100, v: 100, a: 0.5 });// true (HSVA)\n *\n * // Color instances\n * Color.isColorLike(new Color('red')); // true\n *\n * // Invalid values\n * Color.isColorLike(null); // false\n * Color.isColorLike(undefined); // false\n * Color.isColorLike({}); // false\n * Color.isColorLike([]); // false\n * Color.isColorLike('not-a-color'); // false\n * ```\n * @remarks\n * Checks for the following formats:\n * - Numbers (0x000000 to 0xffffff)\n * - CSS color strings\n * - RGB/RGBA arrays and objects\n * - HSL/HSLA objects\n * - HSV/HSVA objects\n * - TypedArrays (Float32Array, Uint8Array, Uint8ClampedArray)\n * - Color instances\n * @see {@link ColorSource} For supported color format types\n * @see {@link Color.setValue} For setting color values\n * @category utility\n */\n public static isColorLike(value: unknown): value is ColorSource\n {\n return (\n typeof value === 'number'\n || typeof value === 'string'\n || value instanceof Number\n || value instanceof Color\n || Array.isArray(value)\n || value instanceof Uint8Array\n || value instanceof Uint8ClampedArray\n || value instanceof Float32Array\n || ((value as RgbColor).r !== undefined\n && (value as RgbColor).g !== undefined\n && (value as RgbColor).b !== undefined)\n || ((value as RgbaColor).r !== undefined\n && (value as RgbaColor).g !== undefined\n && (value as RgbaColor).b !== undefined\n && (value as RgbaColor).a !== undefined)\n || ((value as HslColor).h !== undefined\n && (value as HslColor).s !== undefined\n && (value as HslColor).l !== undefined)\n || ((value as HslaColor).h !== undefined\n && (value as HslaColor).s !== undefined\n && (value as HslaColor).l !== undefined\n && (value as HslaColor).a !== undefined)\n || ((value as HsvColor).h !== undefined\n && (value as HsvColor).s !== undefined\n && (value as HsvColor).v !== undefined)\n || ((value as HsvaColor).h !== undefined\n && (value as HsvaColor).s !== undefined\n && (value as HsvaColor).v !== undefined\n && (value as HsvaColor).a !== undefined)\n );\n }\n}\n", "/**\n * Two Pi.\n * @type {number}\n * @category maths\n * @standard\n */\nexport const PI_2 = Math.PI * 2;\n\n/**\n * Conversion factor for converting radians to degrees.\n * @type {number} RAD_TO_DEG\n * @category maths\n * @standard\n */\nexport const RAD_TO_DEG = 180 / Math.PI;\n\n/**\n * Conversion factor for converting degrees to radians.\n * @type {number}\n * @category maths\n * @standard\n */\nexport const DEG_TO_RAD = Math.PI / 180;\n\n/**\n * Constants that identify shapes, mainly to prevent `instanceof` calls.\n * @category maths\n * @advanced\n */\nexport type SHAPE_PRIMITIVE =\n | 'polygon'\n | 'rectangle'\n | 'circle'\n | 'ellipse'\n | 'triangle'\n | 'roundedRectangle';\n", "/* eslint-disable @typescript-eslint/no-use-before-define */\nimport type { PointData } from './PointData';\nimport type { PointLike } from './PointLike';\n\n// eslint-disable-next-line max-len\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type, requireExport/require-export-jsdoc, requireMemberAPI/require-member-api-doc\nexport interface Point extends PixiMixins.Point { }\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where `x` represents\n * the position on the horizontal axis and `y` represents the position on the vertical axis.\n *\n * Many Pixi functions accept the `PointData` type as an alternative to `Point`,\n * which only requires `x` and `y` properties.\n * @example\n * ```ts\n * // Basic point creation\n * const point = new Point(100, 200);\n *\n * // Using with transformations\n * const matrix = new Matrix();\n * matrix.translate(50, 50).apply(point);\n *\n * // Point arithmetic\n * const start = new Point(0, 0);\n * const end = new Point(100, 100);\n * const middle = new Point(\n * (start.x + end.x) / 2,\n * (start.y + end.y) / 2\n * );\n * ```\n * @see {@link PointData} For basic x,y interface\n * @see {@link PointLike} For point manipulation interface\n * @see {@link ObservablePoint} For observable version\n * @category maths\n * @standard\n */\nexport class Point implements PointLike\n{\n /**\n * Position of the point on the x axis\n * @example\n * ```ts\n * // Set x position\n * const point = new Point();\n * point.x = 100;\n *\n * // Use in calculations\n * const width = rightPoint.x - leftPoint.x;\n * ```\n */\n public x = 0;\n /**\n * Position of the point on the y axis\n * @example\n * ```ts\n * // Set y position\n * const point = new Point();\n * point.y = 200;\n *\n * // Use in calculations\n * const height = bottomPoint.y - topPoint.y;\n * ```\n */\n public y = 0;\n\n /**\n * Creates a new `Point`\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n constructor(x = 0, y = 0)\n {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Creates a clone of this point, which is a new instance with the same `x` and `y` values.\n * @example\n * ```ts\n * // Basic point cloning\n * const original = new Point(100, 200);\n * const copy = original.clone();\n *\n * // Clone and modify\n * const modified = original.clone();\n * modified.set(300, 400);\n *\n * // Verify independence\n * console.log(original); // Point(100, 200)\n * console.log(modified); // Point(300, 400)\n * ```\n * @remarks\n * - Creates new Point instance\n * - Deep copies x and y values\n * - Independent from original\n * - Useful for preserving values\n * @returns A clone of this point\n * @see {@link Point.copyFrom} For copying into existing point\n * @see {@link Point.copyTo} For copying to existing point\n */\n public clone(): Point\n {\n return new Point(this.x, this.y);\n }\n\n /**\n * Copies x and y from the given point into this point.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Point(100, 200);\n * const target = new Point();\n * target.copyFrom(source);\n *\n * // Copy and chain operations\n * const point = new Point()\n * .copyFrom(source)\n * .set(x + 50, y + 50);\n *\n * // Copy from any PointData\n * const data = { x: 10, y: 20 };\n * point.copyFrom(data);\n * ```\n * @param p - The point to copy from\n * @returns The point instance itself\n * @see {@link Point.copyTo} For copying to another point\n * @see {@link Point.clone} For creating new point copy\n */\n public copyFrom(p: PointData): this\n {\n this.set(p.x, p.y);\n\n return this;\n }\n\n /**\n * Copies this point's x and y into the given point.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Point(100, 200);\n * const target = new Point();\n * source.copyTo(target);\n * ```\n * @param p - The point to copy to. Can be any type that is or extends `PointLike`\n * @returns The point (`p`) with values updated\n * @see {@link Point.copyFrom} For copying from another point\n * @see {@link Point.clone} For creating new point copy\n */\n public copyTo<T extends PointLike>(p: T): T\n {\n p.set(this.x, this.y);\n\n return p;\n }\n\n /**\n * Checks if another point is equal to this point.\n *\n * Compares x and y values using strict equality.\n * @example\n * ```ts\n * // Basic equality check\n * const p1 = new Point(100, 200);\n * const p2 = new Point(100, 200);\n * console.log(p1.equals(p2)); // true\n *\n * // Compare with PointData\n * const data = { x: 100, y: 200 };\n * console.log(p1.equals(data)); // true\n *\n * // Check different points\n * const p3 = new Point(200, 300);\n * console.log(p1.equals(p3)); // false\n * ```\n * @param p - The point to check\n * @returns `true` if both `x` and `y` are equal\n * @see {@link Point.copyFrom} For making points equal\n * @see {@link PointData} For point data interface\n */\n public equals(p: PointData): boolean\n {\n return (p.x === this.x) && (p.y === this.y);\n }\n\n /**\n * Sets the point to a new x and y position.\n *\n * If y is omitted, both x and y will be set to x.\n * @example\n * ```ts\n * // Basic position setting\n * const point = new Point();\n * point.set(100, 200);\n *\n * // Set both x and y to same value\n * point.set(50); // x=50, y=50\n *\n * // Chain with other operations\n * point\n * .set(10, 20)\n * .copyTo(otherPoint);\n * ```\n * @param x - Position on the x axis\n * @param y - Position on the y axis, defaults to x\n * @returns The point instance itself\n * @see {@link Point.copyFrom} For copying from another point\n * @see {@link Point.equals} For comparing positions\n */\n public set(x = 0, y: number = x): this\n {\n this.x = x;\n this.y = y;\n\n return this;\n }\n\n // #if _DEBUG\n public toString(): string\n {\n return `[pixi.js/math:Point x=${this.x} y=${this.y}]`;\n }\n // #endif\n\n /**\n * A static Point object with `x` and `y` values of `0`.\n *\n * This shared instance is reset to zero values when accessed.\n *\n * > [!IMPORTANT] This point is shared and temporary. Do not store references to it.\n * @example\n * ```ts\n * // Use for temporary calculations\n * const tempPoint = Point.shared;\n * tempPoint.set(100, 200);\n * matrix.apply(tempPoint);\n *\n * // Will be reset to (0,0) on next access\n * const fresh = Point.shared; // x=0, y=0\n * ```\n * @readonly\n * @returns A fresh zeroed point for temporary use\n * @see {@link Point.constructor} For creating new points\n * @see {@link PointData} For basic point interface\n */\n static get shared(): Point\n {\n tempPoint.x = 0;\n tempPoint.y = 0;\n\n return tempPoint;\n }\n}\n\nconst tempPoint = new Point();\n", "/* eslint-disable @typescript-eslint/no-use-before-define */\nimport { PI_2 } from '../misc/const';\nimport { Point } from '../point/Point';\n\nimport type { PointData } from '../point/PointData';\n\n/**\n * The data structure that contains the position, scale, pivot, skew and rotation of an object.\n * This is used by the {@link Matrix} class to decompose the matrix into its components.\n * @category maths\n * @advanced\n */\nexport interface TransformableObject\n{\n /** The position of the object */\n position: PointData;\n /** The scale of the object */\n scale: PointData;\n /** The pivot of the object */\n pivot: PointData;\n /** The skew of the object */\n skew: PointData;\n /** The rotation of the object */\n rotation: number;\n}\n\n/**\n * A fast matrix for 2D transformations.\n * Represents a 3x3 transformation matrix:\n *\n * ```js\n * | a c tx |\n * | b d ty |\n * | 0 0 1 |\n * ```\n * @example\n * ```ts\n * // Create identity matrix\n * const matrix = new Matrix();\n *\n * // Create matrix with custom values\n * const transform = new Matrix(2, 0, 0, 2, 100, 100); // Scale 2x, translate 100,100\n *\n * // Transform a point\n * const point = { x: 10, y: 20 };\n * const transformed = transform.apply(point);\n *\n * // Chain transformations\n * matrix\n * .translate(100, 50)\n * .rotate(Math.PI / 4)\n * .scale(2, 2);\n * ```\n * @remarks\n * - Used for transform hierarchies\n * - Supports scale, rotation, position\n * - Can be concatenated with append/prepend\n * - Efficient for batched transformations\n * @category maths\n * @standard\n */\nexport class Matrix\n{\n /**\n * Scale on the x axis.\n * @default 1\n */\n public a: number;\n\n /**\n * Shear on the y axis.\n * @default 0\n */\n public b: number;\n\n /**\n * Shear on the x axis.\n * @default 0\n */\n public c: number;\n\n /**\n * Scale on the y axis.\n * @default 1\n */\n public d: number;\n\n /**\n * Translation on the x axis.\n * @default 0\n */\n public tx: number;\n\n /**\n * Translation on the y axis.\n * @default 0\n */\n public ty: number;\n\n /**\n * Array representation of the matrix.\n * Only populated when `toArray()` is called.\n * @default null\n * @see {@link Matrix.toArray} For filling this array\n */\n public array: Float32Array | null = null;\n\n /**\n * @param a - x scale\n * @param b - y skew\n * @param c - x skew\n * @param d - y scale\n * @param tx - x translation\n * @param ty - y translation\n */\n constructor(a = 1, b = 0, c = 0, d = 1, tx = 0, ty = 0)\n {\n this.a = a;\n this.b = b;\n this.c = c;\n this.d = d;\n this.tx = tx;\n this.ty = ty;\n }\n\n /**\n * Creates a Matrix object based on the given array.\n * Populates matrix components from a flat array in column-major order.\n *\n * > [!NOTE] Array mapping order:\n * > ```\n * > array[0] = a (x scale)\n * > array[1] = b (y skew)\n * > array[2] = tx (x translation)\n * > array[3] = c (x skew)\n * > array[4] = d (y scale)\n * > array[5] = ty (y translation)\n * > ```\n * @example\n * ```ts\n * // Create matrix from array\n * const matrix = new Matrix();\n * matrix.fromArray([\n * 2, 0, 100, // a, b, tx\n * 0, 2, 100 // c, d, ty\n * ]);\n *\n * // Create matrix from typed array\n * const float32Array = new Float32Array([\n * 1, 0, 0, // Scale x1, no skew\n * 0, 1, 0 // No skew, scale x1\n * ]);\n * matrix.fromArray(float32Array);\n * ```\n * @param array - The array to populate the matrix from\n * @see {@link Matrix.toArray} For converting matrix to array\n * @see {@link Matrix.set} For setting values directly\n */\n public fromArray(array: number[]): void\n {\n this.a = array[0];\n this.b = array[1];\n this.c = array[3];\n this.d = array[4];\n this.tx = array[2];\n this.ty = array[5];\n }\n\n /**\n * Sets the matrix properties directly.\n * All matrix components can be set in one call.\n * @example\n * ```ts\n * // Set to identity matrix\n * matrix.set(1, 0, 0, 1, 0, 0);\n *\n * // Set to scale matrix\n * matrix.set(2, 0, 0, 2, 0, 0); // Scale 2x\n *\n * // Set to translation matrix\n * matrix.set(1, 0, 0, 1, 100, 50); // Move 100,50\n * ```\n * @param a - Scale on x axis\n * @param b - Shear on y axis\n * @param c - Shear on x axis\n * @param d - Scale on y axis\n * @param tx - Translation on x axis\n * @param ty - Translation on y axis\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.identity} For resetting to identity\n * @see {@link Matrix.fromArray} For setting from array\n */\n public set(a: number, b: number, c: number, d: number, tx: number, ty: number): this\n {\n this.a = a;\n this.b = b;\n this.c = c;\n this.d = d;\n this.tx = tx;\n this.ty = ty;\n\n return this;\n }\n\n /**\n * Creates an array from the current Matrix object.\n *\n * > [!NOTE] The array format is:\n * > ```\n * > Non-transposed:\n * > [a, c, tx,\n * > b, d, ty,\n * > 0, 0, 1]\n * >\n * > Transposed:\n * > [a, b, 0,\n * > c, d, 0,\n * > tx,ty,1]\n * > ```\n * @example\n * ```ts\n * // Basic array conversion\n * const matrix = new Matrix(2, 0, 0, 2, 100, 100);\n * const array = matrix.toArray();\n *\n * // Using existing array\n * const float32Array = new Float32Array(9);\n * matrix.toArray(false, float32Array);\n *\n * // Get transposed array\n * const transposed = matrix.toArray(true);\n * ```\n * @param transpose - Whether to transpose the matrix\n * @param out - Optional Float32Array to store the result\n * @returns The array containing the matrix values\n * @see {@link Matrix.fromArray} For creating matrix from array\n * @see {@link Matrix.array} For cached array storage\n */\n public toArray(transpose?: boolean, out?: Float32Array): Float32Array\n {\n if (!this.array)\n {\n this.array = new Float32Array(9);\n }\n\n const array = out || this.array;\n\n if (transpose)\n {\n array[0] = this.a;\n array[1] = this.b;\n array[2] = 0;\n array[3] = this.c;\n array[4] = this.d;\n array[5] = 0;\n array[6] = this.tx;\n array[7] = this.ty;\n array[8] = 1;\n }\n else\n {\n array[0] = this.a;\n array[1] = this.c;\n array[2] = this.tx;\n array[3] = this.b;\n array[4] = this.d;\n array[5] = this.ty;\n array[6] = 0;\n array[7] = 0;\n array[8] = 1;\n }\n\n return array;\n }\n\n /**\n * Get a new position with the current transformation applied.\n *\n * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)\n * @example\n * ```ts\n * // Basic point transformation\n * const matrix = new Matrix().translate(100, 50).rotate(Math.PI / 4);\n * const point = new Point(10, 20);\n * const transformed = matrix.apply(point);\n *\n * // Reuse existing point\n * const output = new Point();\n * matrix.apply(point, output);\n * ```\n * @param pos - The origin point to transform\n * @param newPos - Optional point to store the result\n * @returns The transformed point\n * @see {@link Matrix.applyInverse} For inverse transformation\n * @see {@link Point} For point operations\n */\n public apply<P extends PointData = Point>(pos: PointData, newPos?: P): P\n {\n newPos = (newPos || new Point()) as P;\n\n const x = pos.x;\n const y = pos.y;\n\n newPos.x = (this.a * x) + (this.c * y) + this.tx;\n newPos.y = (this.b * x) + (this.d * y) + this.ty;\n\n return newPos;\n }\n\n /**\n * Get a new position with the inverse of the current transformation applied.\n *\n * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)\n * @example\n * ```ts\n * // Basic inverse transformation\n * const matrix = new Matrix().translate(100, 50).rotate(Math.PI / 4);\n * const worldPoint = new Point(150, 100);\n * const localPoint = matrix.applyInverse(worldPoint);\n *\n * // Reuse existing point\n * const output = new Point();\n * matrix.applyInverse(worldPoint, output);\n *\n * // Convert mouse position to local space\n * const mousePoint = new Point(mouseX, mouseY);\n * const localMouse = matrix.applyInverse(mousePoint);\n * ```\n * @param pos - The origin point to inverse-transform\n * @param newPos - Optional point to store the result\n * @returns The inverse-transformed point\n * @see {@link Matrix.apply} For forward transformation\n * @see {@link Matrix.invert} For getting inverse matrix\n */\n public applyInverse<P extends PointData = Point>(pos: PointData, newPos?: P): P\n {\n newPos = (newPos || new Point()) as P;\n\n const a = this.a;\n const b = this.b;\n const c = this.c;\n const d = this.d;\n const tx = this.tx;\n const ty = this.ty;\n\n const id = 1 / ((a * d) + (c * -b));\n\n const x = pos.x;\n const y = pos.y;\n\n newPos.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id);\n newPos.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id);\n\n return newPos;\n }\n\n /**\n * Translates the matrix on the x and y axes.\n * Adds to the position values while preserving scale, rotation and skew.\n * @example\n * ```ts\n * // Basic translation\n * const matrix = new Matrix();\n * matrix.translate(100, 50); // Move right 100, down 50\n *\n * // Chain with other transformations\n * matrix\n * .scale(2, 2)\n * .translate(100, 0)\n * .rotate(Math.PI / 4);\n * ```\n * @param x - How much to translate on the x axis\n * @param y - How much to translate on the y axis\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.set} For setting position directly\n * @see {@link Matrix.setTransform} For complete transform setup\n */\n public translate(x: number, y: number): this\n {\n this.tx += x;\n this.ty += y;\n\n return this;\n }\n\n /**\n * Applies a scale transformation to the matrix.\n * Multiplies the scale values with existing matrix components.\n * @example\n * ```ts\n * // Basic scaling\n * const matrix = new Matrix();\n * matrix.scale(2, 3); // Scale 2x horizontally, 3x vertically\n *\n * // Chain with other transformations\n * matrix\n * .translate(100, 100)\n * .scale(2, 2) // Scales after translation\n * .rotate(Math.PI / 4);\n * ```\n * @param x - The amount to scale horizontally\n * @param y - The amount to scale vertically\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.setTransform} For setting scale directly\n * @see {@link Matrix.append} For combining transformations\n */\n public scale(x: number, y: number): this\n {\n this.a *= x;\n this.d *= y;\n this.c *= x;\n this.b *= y;\n this.tx *= x;\n this.ty *= y;\n\n return this;\n }\n\n /**\n * Applies a rotation transformation to the matrix.\n *\n * Rotates around the origin (0,0) by the given angle in radians.\n * @example\n * ```ts\n * // Basic rotation\n * const matrix = new Matrix();\n * matrix.rotate(Math.PI / 4); // Rotate 45 degrees\n *\n * // Chain with other transformations\n * matrix\n * .translate(100, 100) // Move to rotation center\n * .rotate(Math.PI) // Rotate 180 degrees\n * .scale(2, 2); // Scale after rotation\n *\n * // Common angles\n * matrix.rotate(Math.PI / 2); // 90 degrees\n * matrix.rotate(Math.PI); // 180 degrees\n * matrix.rotate(Math.PI * 2); // 360 degrees\n * ```\n * @remarks\n * - Rotates around origin point (0,0)\n * - Affects position if translation was set\n * - Uses counter-clockwise rotation\n * - Order of operations matters when chaining\n * @param angle - The angle in radians\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.setTransform} For setting rotation directly\n * @see {@link Matrix.append} For combining transformations\n */\n public rotate(angle: number): this\n {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n\n const a1 = this.a;\n const c1 = this.c;\n const tx1 = this.tx;\n\n this.a = (a1 * cos) - (this.b * sin);\n this.b = (a1 * sin) + (this.b * cos);\n this.c = (c1 * cos) - (this.d * sin);\n this.d = (c1 * sin) + (this.d * cos);\n this.tx = (tx1 * cos) - (this.ty * sin);\n this.ty = (tx1 * sin) + (this.ty * cos);\n\n return this;\n }\n\n /**\n * Appends the given Matrix to this Matrix.\n * Combines two matrices by multiplying them together: this = this * matrix\n * @example\n * ```ts\n * // Basic matrix combination\n * const matrix = new Matrix();\n * const other = new Matrix().translate(100, 0).rotate(Math.PI / 4);\n * matrix.append(other);\n * ```\n * @remarks\n * - Order matters: A.append(B) !== B.append(A)\n * - Modifies current matrix\n * - Preserves transformation order\n * - Commonly used for combining transforms\n * @param matrix - The matrix to append\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.prepend} For prepending transformations\n * @see {@link Matrix.appendFrom} For appending two external matrices\n */\n public append(matrix: Matrix): this\n {\n const a1 = this.a;\n const b1 = this.b;\n const c1 = this.c;\n const d1 = this.d;\n\n this.a = (matrix.a * a1) + (matrix.b * c1);\n this.b = (matrix.a * b1) + (matrix.b * d1);\n this.c = (matrix.c * a1) + (matrix.d * c1);\n this.d = (matrix.c * b1) + (matrix.d * d1);\n\n this.tx = (matrix.tx * a1) + (matrix.ty * c1) + this.tx;\n this.ty = (matrix.tx * b1) + (matrix.ty * d1) + this.ty;\n\n return this;\n }\n\n /**\n * Appends two matrices and sets the result to this matrix.\n * Performs matrix multiplication: this = A * B\n * @example\n * ```ts\n * // Basic matrix multiplication\n * const result = new Matrix();\n * const matrixA = new Matrix().scale(2, 2);\n * const matrixB = new Matrix().rotate(Math.PI / 4);\n * result.appendFrom(matrixA, matrixB);\n * ```\n * @remarks\n * - Order matters: A * B !== B * A\n * - Creates a new transformation from two others\n * - More efficient than append() for multiple operations\n * - Does not modify input matrices\n * @param a - The first matrix to multiply\n * @param b - The second matrix to multiply\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.append} For single matrix combination\n * @see {@link Matrix.prepend} For reverse order multiplication\n */\n public appendFrom(a: Matrix, b: Matrix): this\n {\n const a1 = a.a;\n const b1 = a.b;\n const c1 = a.c;\n const d1 = a.d;\n const tx = a.tx;\n const ty = a.ty;\n\n const a2 = b.a;\n const b2 = b.b;\n const c2 = b.c;\n const d2 = b.d;\n\n this.a = (a1 * a2) + (b1 * c2);\n this.b = (a1 * b2) + (b1 * d2);\n this.c = (c1 * a2) + (d1 * c2);\n this.d = (c1 * b2) + (d1 * d2);\n this.tx = (tx * a2) + (ty * c2) + b.tx;\n this.ty = (tx * b2) + (ty * d2) + b.ty;\n\n return this;\n }\n\n /**\n * Sets the matrix based on all the available properties.\n * Combines position, scale, rotation, skew and pivot in a single operation.\n * @example\n * ```ts\n * // Basic transform setup\n * const matrix = new Matrix();\n * matrix.setTransform(\n * 100, 100, // position\n * 0, 0, // pivot\n * 2, 2, // scale\n * Math.PI / 4, // rotation (45 degrees)\n * 0, 0 // skew\n * );\n * ```\n * @remarks\n * - Updates all matrix components at once\n * - More efficient than separate transform calls\n * - Uses radians for rotation and skew\n * - Pivot affects rotation center\n * @param x - Position on the x axis\n * @param y - Position on the y axis\n * @param pivotX - Pivot on the x axis\n * @param pivotY - Pivot on the y axis\n * @param scaleX - Scale on the x axis\n * @param scaleY - Scale on the y axis\n * @param rotation - Rotation in radians\n * @param skewX - Skew on the x axis\n * @param skewY - Skew on the y axis\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.decompose} For extracting transform properties\n * @see {@link TransformableObject} For transform data structure\n */\n public setTransform(x: number, y: number, pivotX: number, pivotY: number, scaleX: number,\n scaleY: number, rotation: number, skewX: number, skewY: number): this\n {\n this.a = Math.cos(rotation + skewY) * scaleX;\n this.b = Math.sin(rotation + skewY) * scaleX;\n this.c = -Math.sin(rotation - skewX) * scaleY;\n this.d = Math.cos(rotation - skewX) * scaleY;\n\n this.tx = x - ((pivotX * this.a) + (pivotY * this.c));\n this.ty = y - ((pivotX * this.b) + (pivotY * this.d));\n\n return this;\n }\n\n /**\n * Prepends the given Matrix to this Matrix.\n * Combines two matrices by multiplying them together: this = matrix * this\n * @example\n * ```ts\n * // Basic matrix prepend\n * const matrix = new Matrix().scale(2, 2);\n * const other = new Matrix().translate(100, 0);\n * matrix.prepend(other); // Translation happens before scaling\n * ```\n * @remarks\n * - Order matters: A.prepend(B) !== B.prepend(A)\n * - Modifies current matrix\n * - Reverses transformation order compared to append()\n * @param matrix - The matrix to prepend\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.append} For appending transformations\n * @see {@link Matrix.appendFrom} For combining external matrices\n */\n public prepend(matrix: Matrix): this\n {\n const tx1 = this.tx;\n\n if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1)\n {\n const a1 = this.a;\n const c1 = this.c;\n\n this.a = (a1 * matrix.a) + (this.b * matrix.c);\n this.b = (a1 * matrix.b) + (this.b * matrix.d);\n this.c = (c1 * matrix.a) + (this.d * matrix.c);\n this.d = (c1 * matrix.b) + (this.d * matrix.d);\n }\n\n this.tx = (tx1 * matrix.a) + (this.ty * matrix.c) + matrix.tx;\n this.ty = (tx1 * matrix.b) + (this.ty * matrix.d) + matrix.ty;\n\n return this;\n }\n\n /**\n * Decomposes the matrix into its individual transform components.\n * Extracts position, scale, rotation and skew values from the matrix.\n * @example\n * ```ts\n * // Basic decomposition\n * const matrix = new Matrix()\n * .translate(100, 100)\n * .rotate(Math.PI / 4)\n * .scale(2, 2);\n *\n * const transform = {\n * position: new Point(),\n * scale: new Point(),\n * pivot: new Point(),\n * skew: new Point(),\n * rotation: 0\n * };\n *\n * matrix.decompose(transform);\n * console.log(transform.position); // Point(100, 100)\n * console.log(transform.rotation); // ~0.785 (PI/4)\n * console.log(transform.scale); // Point(2, 2)\n * ```\n * @remarks\n * - Handles combined transformations\n * - Accounts for pivot points\n * - Chooses between rotation/skew based on transform type\n * - Uses radians for rotation and skew\n * @param transform - The transform object to store the decomposed values\n * @returns The transform with the newly applied properties\n * @see {@link Matrix.setTransform} For composing from components\n * @see {@link TransformableObject} For transform structure\n */\n public decompose(transform: TransformableObject): TransformableObject\n {\n // sort out rotation / skew..\n const a = this.a;\n const b = this.b;\n const c = this.c;\n const d = this.d;\n const pivot = transform.pivot;\n\n const skewX = -Math.atan2(-c, d);\n const skewY = Math.atan2(b, a);\n\n const delta = Math.abs(skewX + skewY);\n\n if (delta < 0.00001 || Math.abs(PI_2 - delta) < 0.00001)\n {\n transform.rotation = skewY;\n transform.skew.x = transform.skew.y = 0;\n }\n else\n {\n transform.rotation = 0;\n transform.skew.x = skewX;\n transform.skew.y = skewY;\n }\n\n // next set scale\n transform.scale.x = Math.sqrt((a * a) + (b * b));\n transform.scale.y = Math.sqrt((c * c) + (d * d));\n\n // next set position\n transform.position.x = this.tx + ((pivot.x * a) + (pivot.y * c));\n transform.position.y = this.ty + ((pivot.x * b) + (pivot.y * d));\n\n return transform;\n }\n\n /**\n * Inverts this matrix.\n * Creates the matrix that when multiplied with this matrix results in an identity matrix.\n * @example\n * ```ts\n * // Basic matrix inversion\n * const matrix = new Matrix()\n * .translate(100, 50)\n * .scale(2, 2);\n *\n * matrix.invert(); // Now transforms in opposite direction\n *\n * // Verify inversion\n * const point = new Point(50, 50);\n * const transformed = matrix.apply(point);\n * const original = matrix.invert().apply(transformed);\n * // original ≈ point\n * ```\n * @remarks\n * - Modifies the current matrix\n * - Useful for reversing transformations\n * - Cannot invert matrices with zero determinant\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.identity} For resetting to identity\n * @see {@link Matrix.applyInverse} For inverse transformations\n */\n public invert(): this\n {\n const a1 = this.a;\n const b1 = this.b;\n const c1 = this.c;\n const d1 = this.d;\n const tx1 = this.tx;\n const n = (a1 * d1) - (b1 * c1);\n\n this.a = d1 / n;\n this.b = -b1 / n;\n this.c = -c1 / n;\n this.d = a1 / n;\n this.tx = ((c1 * this.ty) - (d1 * tx1)) / n;\n this.ty = -((a1 * this.ty) - (b1 * tx1)) / n;\n\n return this;\n }\n\n /**\n * Checks if this matrix is an identity matrix.\n *\n * An identity matrix has no transformations applied (default state).\n * @example\n * ```ts\n * // Check if matrix is identity\n * const matrix = new Matrix();\n * console.log(matrix.isIdentity()); // true\n *\n * // Check after transformations\n * matrix.translate(100, 0);\n * console.log(matrix.isIdentity()); // false\n *\n * // Reset and verify\n * matrix.identity();\n * console.log(matrix.isIdentity()); // true\n * ```\n * @remarks\n * - Verifies a = 1, d = 1 (no scale)\n * - Verifies b = 0, c = 0 (no skew)\n * - Verifies tx = 0, ty = 0 (no translation)\n * @returns True if matrix has no transformations\n * @see {@link Matrix.identity} For resetting to identity\n * @see {@link Matrix.IDENTITY} For constant identity matrix\n */\n public isIdentity(): boolean\n {\n return this.a === 1 && this.b === 0 && this.c === 0 && this.d === 1 && this.tx === 0 && this.ty === 0;\n }\n\n /**\n * Resets this Matrix to an identity (default) matrix.\n * Sets all components to their default values: scale=1, no skew, no translation.\n * @example\n * ```ts\n * // Reset transformed matrix\n * const matrix = new Matrix()\n * .scale(2, 2)\n * .rotate(Math.PI / 4);\n * matrix.identity(); // Back to default state\n *\n * // Chain after reset\n * matrix\n * .identity()\n * .translate(100, 100)\n * .scale(2, 2);\n *\n * // Compare with identity constant\n * const isDefault = matrix.equals(Matrix.IDENTITY);\n * ```\n * @remarks\n * - Sets a=1, d=1 (default scale)\n * - Sets b=0, c=0 (no skew)\n * - Sets tx=0, ty=0 (no translation)\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.IDENTITY} For constant identity matrix\n * @see {@link Matrix.isIdentity} For checking identity state\n */\n public identity(): this\n {\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.tx = 0;\n this.ty = 0;\n\n return this;\n }\n\n /**\n * Creates a new Matrix object with the same values as this one.\n * @returns A copy of this matrix. Good for chaining method calls.\n */\n public clone(): Matrix\n {\n const matrix = new Matrix();\n\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n\n return matrix;\n }\n\n /**\n * Creates a new Matrix object with the same values as this one.\n * @param matrix\n * @example\n * ```ts\n * // Basic matrix cloning\n * const matrix = new Matrix()\n * .translate(100, 100)\n * .rotate(Math.PI / 4);\n * const copy = matrix.clone();\n *\n * // Clone and modify\n * const modified = matrix.clone()\n * .scale(2, 2);\n *\n * // Compare matrices\n * console.log(matrix.equals(copy)); // true\n * console.log(matrix.equals(modified)); // false\n * ```\n * @returns A copy of this matrix. Good for chaining method calls.\n * @see {@link Matrix.copyTo} For copying to existing matrix\n * @see {@link Matrix.copyFrom} For copying from another matrix\n */\n public copyTo(matrix: Matrix): Matrix\n {\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n\n return matrix;\n }\n\n /**\n * Changes the values of the matrix to be the same as the ones in given matrix.\n * @example\n * ```ts\n * // Basic matrix copying\n * const source = new Matrix()\n * .translate(100, 100)\n * .rotate(Math.PI / 4);\n * const target = new Matrix();\n * target.copyFrom(source);\n * ```\n * @param matrix - The matrix to copy from\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.clone} For creating new matrix copy\n * @see {@link Matrix.copyTo} For copying to another matrix\n */\n public copyFrom(matrix: Matrix): this\n {\n this.a = matrix.a;\n this.b = matrix.b;\n this.c = matrix.c;\n this.d = matrix.d;\n this.tx = matrix.tx;\n this.ty = matrix.ty;\n\n return this;\n }\n\n /**\n * Checks if this matrix equals another matrix.\n * Compares all components for exact equality.\n * @example\n * ```ts\n * // Basic equality check\n * const m1 = new Matrix();\n * const m2 = new Matrix();\n * console.log(m1.equals(m2)); // true\n *\n * // Compare transformed matrices\n * const transform = new Matrix()\n * .translate(100, 100)\n * const clone = new Matrix()\n * .scale(2, 2);\n * console.log(transform.equals(clone)); // false\n * ```\n * @param matrix - The matrix to compare to\n * @returns True if matrices are identical\n * @see {@link Matrix.copyFrom} For copying matrix values\n * @see {@link Matrix.isIdentity} For identity comparison\n */\n public equals(matrix: Matrix)\n {\n return matrix.a === this.a && matrix.b === this.b\n && matrix.c === this.c && matrix.d === this.d\n && matrix.tx === this.tx && matrix.ty === this.ty;\n }\n\n // #if _DEBUG\n public toString(): string\n {\n return `[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`;\n }\n // #endif\n\n /**\n * A default (identity) matrix with no transformations applied.\n *\n * > [!IMPORTANT] This is a shared read-only object. Create a new Matrix if you need to modify it.\n * @example\n * ```ts\n * // Get identity matrix reference\n * const identity = Matrix.IDENTITY;\n * console.log(identity.isIdentity()); // true\n *\n * // Compare with identity\n * const matrix = new Matrix();\n * console.log(matrix.equals(Matrix.IDENTITY)); // true\n *\n * // Create new matrix instead of modifying IDENTITY\n * const transform = new Matrix()\n * .copyFrom(Matrix.IDENTITY)\n * .translate(100, 100);\n * ```\n * @readonly\n * @returns A read-only identity matrix\n * @see {@link Matrix.shared} For temporary calculations\n * @see {@link Matrix.identity} For resetting matrices\n */\n static get IDENTITY(): Readonly<Matrix>\n {\n return identityMatrix.identity();\n }\n\n /**\n * A static Matrix that can be used to avoid creating new objects.\n * Will always ensure the matrix is reset to identity when requested.\n *\n * > [!IMPORTANT] This matrix is shared and temporary. Do not store references to it.\n * @example\n * ```ts\n * // Use for temporary calculations\n * const tempMatrix = Matrix.shared;\n * tempMatrix.translate(100, 100).rotate(Math.PI / 4);\n * const point = tempMatrix.apply({ x: 10, y: 20 });\n *\n * // Will be reset to identity on next access\n * const fresh = Matrix.shared; // Back to identity\n * ```\n * @remarks\n * - Always returns identity matrix\n * - Safe to modify temporarily\n * - Not safe to store references\n * - Useful for one-off calculations\n * @readonly\n * @returns A fresh identity matrix for temporary use\n * @see {@link Matrix.IDENTITY} For immutable identity matrix\n * @see {@link Matrix.identity} For resetting matrices\n */\n static get shared(): Matrix\n {\n return tempMatrix.identity();\n }\n}\n\nconst tempMatrix = new Matrix();\nconst identityMatrix = new Matrix();\n", "const uidCache: Record<string, number> = {\n default: -1,\n};\n\n/**\n * The names of the unique identifiers. These are used to create unique identifiers for different types of objects.\n * @category utils\n * @internal\n */\nexport type UIDNames =\n | 'default'\n | 'resource'\n | 'texture'\n | 'textureSource'\n | 'textureResource'\n | 'batcher' //\n | 'graphicsContext' //\n | 'graphicsView' //\n | 'graphicsPath' //\n | 'fillGradient' //\n | 'fillPattern' //\n | 'meshView' //\n | 'renderable' //\n | 'buffer' //\n | 'bufferResource' //\n | 'geometry'\n | 'instructionSet' //\n | 'renderTarget' //\n | 'uniform' //\n | 'spriteView' //\n | 'textView' //\n | 'tilingSpriteView' //\n | 'shader' //\n | 'renderer' //\n | 'textStyle'\n | (string & {});\n\n/**\n * Gets the next unique identifier\n * @param name - The name of the identifier.\n * @returns {number} The next unique identifier to use.\n * @category utils\n * @internal\n */\nexport function uid(name: UIDNames = 'default'): number\n{\n if (uidCache[name] === undefined)\n {\n uidCache[name] = -1;\n }\n\n return ++uidCache[name];\n}\n\n/**\n * Resets the next unique identifier to 0. This is used for some tests, dont touch or things WILL explode :)\n * @internal\n */\nexport function resetUids(): void\n{\n for (const key in uidCache)\n {\n delete uidCache[key];\n }\n}\n", "// A set of warning messages already fired\nconst warnings: Set<string> = new Set();\n\n/**\n * deprecation name for version 8.0.0\n * @ignore\n * @internal\n */\nexport const v8_0_0 = '8.0.0';\n/**\n * deprecation name for version 8.1.0\n * @ignore\n * @internal\n */\nexport const v8_3_4 = '8.3.4';\n\n/**\n * Options for managing deprecation messages behavior globally\n * @category utils\n * @standard\n */\ninterface DeprecationOptions\n{\n /**\n * When set to true, all deprecation warning messages will be hidden.\n * Use this if you want to silence deprecation notifications.\n * @default false\n * @standard\n */\n quiet: boolean;\n /**\n * When set to true, deprecation messages will be displayed as plain text without color formatting.\n * Use this if you want to disable colored console output for deprecation warnings.\n * @default false\n * @standard\n */\n noColor: boolean;\n}\n\n/** @internal */\nexport type DeprecationFn = ((version: string, message: string, ignoreDepth?: number) => void) & DeprecationOptions;\n\nconst deprecationState: DeprecationOptions = {\n quiet: false,\n noColor: false\n};\n\n/**\n * Helper for warning developers about deprecated features & settings.\n * A stack track for warnings is given; useful for tracking-down where\n * deprecated methods/properties/classes are being used within the code.\n *\n * Deprecation messages can be configured globally:\n * ```ts\n * // Suppress all deprecation messages\n * deprecation.quiet = true;\n *\n * // Put plain text to console instead of colorful messages\n * deprecation.noColor = true;\n * ```\n * @category utils\n * @ignore\n * @function deprecation\n * @param {string} version - The version where the feature became deprecated\n * @param {string} message - Message should include what is deprecated, where, and the new solution\n * @param {number} [ignoreDepth=3] - The number of steps to ignore at the top of the error stack\n * this is mostly to ignore internal deprecation calls.\n */\nexport const deprecation: DeprecationFn = ((version: string, message: string, ignoreDepth: number = 3) =>\n{\n // Suppress if is in quiet mode and ignore duplicate\n if (deprecationState.quiet || warnings.has(message)) return;\n\n /* eslint-disable no-console */\n let stack = new Error().stack;\n\n const deprecationMessage = `${message}\\nDeprecated since v${version}`;\n const useGroup = typeof console.groupCollapsed === 'function' && !deprecationState.noColor;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined')\n {\n console.warn('PixiJS Deprecation Warning: ', deprecationMessage);\n }\n else\n {\n // chop off the stack trace which includes PixiJS internal calls\n stack = stack.split('\\n').splice(ignoreDepth).join('\\n');\n\n if (useGroup)\n {\n console.groupCollapsed(\n '%cPixiJS Deprecation Warning: %c%s',\n 'color:#614108;background:#fffbe6',\n 'font-weight:normal;color:#614108;background:#fffbe6',\n deprecationMessage\n );\n console.warn(stack);\n console.groupEnd();\n }\n else\n {\n console.warn('PixiJS Deprecation Warning: ', deprecationMessage);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n\n warnings.add(message);\n}) as DeprecationFn;\n\nObject.defineProperties(deprecation, {\n quiet: {\n get: () => deprecationState.quiet,\n set: (value: boolean) =>\n {\n deprecationState.quiet = value;\n },\n enumerable: true,\n configurable: false\n },\n noColor: {\n get: () => deprecationState.noColor,\n set: (value: boolean) =>\n {\n deprecationState.noColor = value;\n },\n enumerable: true,\n configurable: false\n }\n} satisfies {[key in keyof DeprecationOptions]: PropertyDescriptor});\n", "let warnCount = 0;\nconst maxWarnings = 500;\n\n/**\n * Logs a PixiJS warning message to the console. Stops logging after 500 warnings have been logged.\n * @param args - The warning message(s) to log\n * @returns {void}\n * @category utils\n * @ignore\n */\nexport function warn(...args: any[])\n{\n if (warnCount === maxWarnings) return;\n\n warnCount++;\n\n if (warnCount === maxWarnings)\n {\n console.warn('PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS.');\n }\n else\n {\n console.warn('PixiJS Warning: ', ...args);\n }\n}\n", "/** Interface for objects that can be cleaned up by the PoolCollector. */\ninterface Cleanable\n{\n clear(): void;\n}\n\n/**\n * A singleton collector that manages and provides cleanup for registered pools and caches.\n * Useful for cleaning up all pools/caches at once during application shutdown or reset.\n * @category utils\n * @internal\n */\nexport const GlobalResourceRegistry = {\n /**\n * Set of registered pools and cleanable objects.\n * @private\n */\n _registeredResources: new Set<Cleanable>(),\n\n /**\n * Registers a pool or cleanable object for cleanup.\n * @param {Cleanable} pool - The pool or object to register.\n */\n register(pool: Cleanable): void\n {\n this._registeredResources.add(pool);\n },\n\n /**\n * Unregisters a pool or cleanable object from cleanup.\n * @param {Cleanable} pool - The pool or object to unregister.\n */\n unregister(pool: Cleanable): void\n {\n this._registeredResources.delete(pool);\n },\n\n /** Clears all registered pools and cleanable objects. This will call clear() on each registered item. */\n release(): void\n {\n this._registeredResources.forEach((pool) => pool.clear());\n },\n\n /**\n * Gets the number of registered pools and cleanable objects.\n * @returns {number} The count of registered items.\n */\n get registeredCount(): number\n {\n return this._registeredResources.size;\n },\n\n /**\n * Checks if a specific pool or cleanable object is registered.\n * @param {Cleanable} pool - The pool or object to check.\n * @returns {boolean} True if the item is registered, false otherwise.\n */\n isRegistered(pool: Cleanable): boolean\n {\n return this._registeredResources.has(pool);\n },\n\n /**\n * Removes all registrations without clearing the pools.\n * Useful if you want to reset the collector without affecting the pools.\n */\n reset(): void\n {\n this._registeredResources.clear();\n }\n};\n", "/**\n * A generic class for managing a pool of items.\n * @template T The type of items in the pool. Must implement {@link PoolItem}.\n * @category utils\n * @advanced\n */\nexport class Pool<T extends PoolItem>\n{\n /** @internal */\n public readonly _classType: PoolItemConstructor<T>;\n private readonly _pool: T[] = [];\n private _count = 0;\n private _index = 0;\n\n /**\n * Constructs a new Pool.\n * @param ClassType - The constructor of the items in the pool.\n * @param {number} [initialSize] - The initial size of the pool.\n */\n constructor(ClassType: PoolItemConstructor<T>, initialSize?: number)\n {\n this._classType = ClassType;\n\n if (initialSize)\n {\n this.prepopulate(initialSize);\n }\n }\n\n /**\n * Prepopulates the pool with a given number of items.\n * @param total - The number of items to add to the pool.\n */\n public prepopulate(total: number): void\n {\n for (let i = 0; i < total; i++)\n {\n this._pool[this._index++] = new this._classType();\n }\n\n this._count += total;\n }\n\n /**\n * Gets an item from the pool. Calls the item's `init` method if it exists.\n * If there are no items left in the pool, a new one will be created.\n * @param {unknown} [data] - Optional data to pass to the item's constructor.\n * @returns {T} The item from the pool.\n */\n public get(data?: unknown): T\n {\n let item;\n\n if (this._index > 0)\n {\n item = this._pool[--this._index];\n }\n else\n {\n item = new this._classType();\n this._count++;\n }\n\n item.init?.(data);\n\n return item;\n }\n\n /**\n * Returns an item to the pool. Calls the item's `reset` method if it exists.\n * @param {T} item - The item to return to the pool.\n */\n public return(item: T): void\n {\n item.reset?.();\n\n this._pool[this._index++] = item;\n }\n\n /**\n * Gets the number of items in the pool.\n * @readonly\n */\n get totalSize(): number\n {\n return this._count;\n }\n\n /**\n * Gets the number of items in the pool that are free to use without needing to create more.\n * @readonly\n */\n get totalFree(): number\n {\n return this._index;\n }\n\n /**\n * Gets the number of items in the pool that are currently in use.\n * @readonly\n */\n get totalUsed(): number\n {\n return this._count - this._index;\n }\n\n /** clears the pool */\n public clear()\n {\n if (this._pool.length > 0 && this._pool[0].destroy)\n {\n for (let i = 0; i < this._index; i++)\n {\n this._pool[i].destroy();\n }\n }\n this._pool.length = 0;\n this._count = 0;\n this._index = 0;\n }\n}\n\n/**\n * An object that can be stored in a {@link Pool}.\n * @category utils\n * @advanced\n */\nexport type PoolItem = {\n init?: (data?: any) => void;\n reset?: () => void;\n destroy?: () => void;\n [key: string]: any;\n};\n\n/**\n * The constructor of an object that can be stored in a {@link Pool}.\n * @typeParam K - The type of the object that can be stored in a {@link Pool}.\n * @category utils\n * @advanced\n */\nexport type PoolItemConstructor<K extends PoolItem> = new () => K;\n", "import { GlobalResourceRegistry } from './GlobalResourceRegistry';\nimport { Pool } from './Pool';\n\nimport type { PoolItem, PoolItemConstructor } from './Pool';\n\n/**\n * A type alias for a constructor of a Pool.\n * @template T The type of items in the pool. Must extend PoolItem.\n * @category utils\n * @advanced\n */\nexport type PoolConstructor<T extends PoolItem> = new () => Pool<T>;\n\n/**\n * A group of pools that can be used to store objects of different types.\n * @category utils\n * @advanced\n */\nexport class PoolGroupClass\n{\n /**\n * A map to store the pools by their class type.\n * @private\n */\n private readonly _poolsByClass: Map<PoolItemConstructor<PoolItem>, Pool<PoolItem>> = new Map();\n\n /**\n * Prepopulates a specific pool with a given number of items.\n * @template T The type of items in the pool. Must extend PoolItem.\n * @param {PoolItemConstructor<T>} Class - The constructor of the items in the pool.\n * @param {number} total - The number of items to add to the pool.\n */\n public prepopulate<T extends PoolItem>(Class: PoolItemConstructor<T>, total: number): void\n {\n const classPool = this.getPool(Class);\n\n classPool.prepopulate(total);\n }\n\n /**\n * Gets an item from a specific pool.\n * @template T The type of items in the pool. Must extend PoolItem.\n * @param {PoolItemConstructor<T>} Class - The constructor of the items in the pool.\n * @param {unknown} [data] - Optional data to pass to the item's constructor.\n * @returns {T} The item from the pool.\n */\n public get<T extends PoolItem>(Class: PoolItemConstructor<T>, data?: unknown): T\n {\n const pool = this.getPool(Class);\n\n return pool.get(data) as T;\n }\n\n /**\n * Returns an item to its respective pool.\n * @param {PoolItem} item - The item to return to the pool.\n */\n public return(item: PoolItem): void\n {\n const pool = this.getPool(item.constructor as PoolItemConstructor<PoolItem>);\n\n pool.return(item);\n }\n\n /**\n * Gets a specific pool based on the class type.\n * @template T The type of items in the pool. Must extend PoolItem.\n * @param {PoolItemConstructor<T>} ClassType - The constructor of the items in the pool.\n * @returns {Pool<T>} The pool of the given class type.\n */\n public getPool<T extends PoolItem>(ClassType: PoolItemConstructor<T>): Pool<T>\n {\n if (!this._poolsByClass.has(ClassType))\n {\n this._poolsByClass.set(ClassType, new Pool(ClassType));\n }\n\n return this._poolsByClass.get(ClassType) as Pool<T>;\n }\n\n /** gets the usage stats of each pool in the system */\n public stats(): Record<string, {free: number; used: number; size: number}>\n {\n const stats = {} as Record<string, {free: number; used: number; size: number}>;\n\n this._poolsByClass.forEach((pool) =>\n {\n // TODO: maybe we should allow the name to be set when `createEntity` is called\n const name = stats[pool._classType.name]\n ? pool._classType.name + (pool._classType as any).ID : pool._classType.name;\n\n stats[name] = {\n free: pool.totalFree,\n used: pool.totalUsed,\n size: pool.totalSize,\n };\n });\n\n return stats;\n }\n\n /** Clears all pools in the group. This will reset all pools and free their resources. */\n public clear(): void\n {\n this._poolsByClass.forEach((pool) => pool.clear());\n this._poolsByClass.clear();\n }\n}\n\n/**\n * A singleton instance of the PoolGroupClass that can be used throughout the application.\n * @internal\n */\nexport const BigPool = new PoolGroupClass();\nGlobalResourceRegistry.register(BigPool);\n", "import { extensions, ExtensionType } from '../../extensions/Extensions';\nimport { BigPool } from '../../utils/pool/PoolGroup';\n\nimport type { Effect, EffectConstructor } from '../../scene/container/Effect';\nimport type { PoolItem, PoolItemConstructor } from '../../utils/pool/Pool';\n\ninterface MaskConversionTest\n{\n test: (item: any) => boolean;\n maskClass: new (item: any) => Effect & PoolItem;\n}\n\n/**\n * Represents a mask effect that can be applied to a container.\n * @category rendering\n * @advanced\n */\nexport type MaskEffect = {mask: unknown} & Effect;\n\n/**\n * A class that manages the conversion of masks to mask effects.\n * @category rendering\n * @ignore\n */\nexport class MaskEffectManagerClass\n{\n /** @private */\n public readonly _effectClasses: EffectConstructor[] = [];\n private readonly _tests: MaskConversionTest[] = [];\n private _initialized = false;\n\n public init()\n {\n if (this._initialized) return;\n\n this._initialized = true;\n\n this._effectClasses.forEach((test) =>\n {\n this.add({\n test: test.test,\n maskClass: test\n });\n });\n }\n\n public add(test: MaskConversionTest)\n {\n this._tests.push(test);\n }\n\n public getMaskEffect(item: any): MaskEffect\n {\n if (!this._initialized) this.init();\n\n for (let i = 0; i < this._tests.length; i++)\n {\n const test = this._tests[i];\n\n if (test.test(item))\n {\n return BigPool.get(test.maskClass as PoolItemConstructor<MaskEffect & PoolItem>, item);\n }\n }\n\n return item;\n }\n\n public returnMaskEffect(effect: Effect & PoolItem)\n {\n BigPool.return(effect);\n }\n}\n\n/**\n * A class that manages the conversion of masks to mask effects.\n * @class\n * @category rendering\n * @advanced\n */\nexport const MaskEffectManager = new MaskEffectManagerClass();\n\n// Handle registration of extensions\nextensions\n .handleByList(ExtensionType.MaskEffect, MaskEffectManager._effectClasses);\n", "// Taken from the bit-twiddle package\n\n/**\n * Rounds to next power of two.\n * @function nextPow2\n * @param {number} v - input value\n * @returns {number} - next rounded power of two\n * @category maths\n * @advanced\n */\nexport function nextPow2(v: number): number\n{\n v += v === 0 ? 1 : 0;\n --v;\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n\n return v + 1;\n}\n\n/**\n * Checks if a number is a power of two.\n * @function isPow2\n * @param {number} v - input value\n * @returns {boolean} `true` if value is power of two\n * @category maths\n * @advanced\n */\nexport function isPow2(v: number): boolean\n{\n return !(v & (v - 1)) && (!!v);\n}\n\n/**\n * Computes ceil of log base 2\n * @function log2\n * @param {number} v - input value\n * @returns {number} logarithm base 2\n * @category maths\n * @advanced\n */\nexport function log2(v: number): number\n{\n let r = (v > 0xFFFF ? 1 : 0) << 4;\n\n v >>>= r;\n\n let shift = (v > 0xFF ? 1 : 0) << 3;\n\n v >>>= shift; r |= shift;\n shift = (v > 0xF ? 1 : 0) << 2;\n v >>>= shift; r |= shift;\n shift = (v > 0x3 ? 1 : 0) << 1;\n v >>>= shift; r |= shift;\n\n return r | (v >> 1);\n}\n", "/**\n * Returns a new object with all properties from the input object that have defined values.\n * @template T - The type of the input object.\n * @param {T} obj - The input object.\n * @returns {T} - A new object with only the defined properties from the input object.\n * @category utils\n * @ignore\n */\nexport function definedProps<T extends Record<string, any>>(obj: T): T\n{\n const result: Partial<T> = {};\n\n for (const key in obj)\n {\n if (obj[key] !== undefined)\n {\n result[key] = obj[key];\n }\n }\n\n return result as T;\n}\n", "import EventEmitter from 'eventemitter3';\nimport { uid } from '../../../../utils/data/uid';\nimport { deprecation, v8_0_0 } from '../../../../utils/logging/deprecation';\n\nimport type { BindResource } from '../../gpu/shader/BindResource';\nimport type { COMPARE_FUNCTION, SCALE_MODE, WRAP_MODE } from './const';\n\nconst idHash: Record<string, number> = Object.create(null);\n\n/**\n * This takes a shader string and maps it to a resource id.\n * This is a little different than regular resource ids as these ids\n * are not unique to the resource. But must not overlap with other (non sampler) resources Ids.\n * @param value - the string to turn into a resource id\n * @returns a unique resource id\n */\nfunction createResourceIdFromString(value: string): number\n{\n const id = idHash[value];\n\n if (id === undefined)\n {\n idHash[value] = uid('resource');\n }\n\n return id;\n}\n\n/**\n * The options for the texture style.\n * @category rendering\n * @advanced\n */\nexport interface TextureStyleOptions extends Partial<TextureStyle>\n{\n /** setting this will set wrapModeU,wrapModeV and wrapModeW all at once! */\n addressMode?: WRAP_MODE;\n /** specifies the {{GPUAddressMode|address modes}} for the texture width, height, and depth coordinates, respectively. */\n addressModeU?: WRAP_MODE;\n /** specifies the {{GPUAddressMode|address modes}} for the texture width, height, and depth coordinates, respectively. */\n addressModeV?: WRAP_MODE;\n /** Specifies the {{GPUAddressMode|address modes}} for the texture width, height, and depth coordinates, respectively. */\n addressModeW?: WRAP_MODE;\n\n /** setting this will set magFilter,minFilter and mipmapFilter all at once! */\n scaleMode?: SCALE_MODE;\n\n /** specifies the sampling behavior when the sample footprint is smaller than or equal to one texel. */\n magFilter?: SCALE_MODE;\n /** specifies the sampling behavior when the sample footprint is larger than one texel. */\n minFilter?: SCALE_MODE;\n /** specifies behavior for sampling between mipmap levels. */\n mipmapFilter?: SCALE_MODE;\n\n /** specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture. */\n lodMinClamp?: number;\n /** Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture. */\n lodMaxClamp?: number;\n /**\n * When provided the sampler will be a comparison sampler with the specified\n * {@link COMPARE_FUNCTION}.\n * Note: Comparison samplers may use filtering, but the sampling results will be\n * implementation-dependent and may differ from the normal filtering rules.\n */\n compare?: COMPARE_FUNCTION;\n /**\n * Specifies the maximum anisotropy value clamp used by the sampler.\n * Note: Most implementations support {@link TextureStyle#maxAnisotropy} values in range\n * between 1 and 16, inclusive. The used value of {@link TextureStyle#maxAnisotropy} will\n * be clamped to the maximum value that the platform supports.\n *\n * setting this to anything higher than 1 will set scale modes to 'linear'\n */\n maxAnisotropy?: number;\n}\n\n/**\n * A texture style describes how a texture should be sampled by a shader.\n * @category rendering\n * @advanced\n */\nexport class TextureStyle extends EventEmitter<{\n change: TextureStyle,\n destroy: TextureStyle,\n}> implements BindResource\n{\n /** @internal */\n public _resourceType = 'textureSampler';\n /** @internal */\n public _touched = 0;\n private _sharedResourceId: number;\n\n /** default options for the style */\n public static readonly defaultOptions: TextureStyleOptions = {\n addressMode: 'clamp-to-edge',\n scaleMode: 'linear'\n };\n\n /** */\n public addressModeU?: WRAP_MODE;\n /** */\n public addressModeV?: WRAP_MODE;\n /** Specifies the {{GPUAddressMode|address modes}} for the texture width, height, and depth coordinates, respectively. */\n public addressModeW?: WRAP_MODE;\n /** Specifies the sampling behavior when the sample footprint is smaller than or equal to one texel. */\n public magFilter?: SCALE_MODE;\n /** Specifies the sampling behavior when the sample footprint is larger than one texel. */\n public minFilter?: SCALE_MODE;\n /** Specifies behavior for sampling between mipmap levels. */\n public mipmapFilter?: SCALE_MODE;\n /** */\n public lodMinClamp?: number;\n /** Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture. */\n public lodMaxClamp?: number;\n /**\n * When provided the sampler will be a comparison sampler with the specified\n * {@link COMPARE_FUNCTION}.\n * Note: Comparison samplers may use filtering, but the sampling results will be\n * implementation-dependent and may differ from the normal filtering rules.\n */\n public compare?: COMPARE_FUNCTION;\n /**\n * Specifies the maximum anisotropy value clamp used by the sampler.\n * Note: Most implementations support {@link TextureStyle#maxAnisotropy} values in range\n * between 1 and 16, inclusive. The used value of {@link TextureStyle#maxAnisotropy} will\n * be clamped to the maximum value that the platform supports.\n * @internal\n */\n public _maxAnisotropy?: number = 1;\n\n /**\n * Has the style been destroyed?\n * @readonly\n */\n public destroyed = false;\n\n /**\n * @param options - options for the style\n */\n constructor(options: TextureStyleOptions = {})\n {\n super();\n\n options = { ...TextureStyle.defaultOptions, ...options };\n\n this.addressMode = options.addressMode;\n\n this.addressModeU = options.addressModeU ?? this.addressModeU;\n this.addressModeV = options.addressModeV ?? this.addressModeV;\n this.addressModeW = options.addressModeW ?? this.addressModeW;\n\n this.scaleMode = options.scaleMode;\n\n this.magFilter = options.magFilter ?? this.magFilter;\n this.minFilter = options.minFilter ?? this.minFilter;\n this.mipmapFilter = options.mipmapFilter ?? this.mipmapFilter;\n\n this.lodMinClamp = options.lodMinClamp;\n this.lodMaxClamp = options.lodMaxClamp;\n\n this.compare = options.compare;\n\n this.maxAnisotropy = options.maxAnisotropy ?? 1;\n }\n\n set addressMode(value: WRAP_MODE)\n {\n this.addressModeU = value;\n this.addressModeV = value;\n this.addressModeW = value;\n }\n\n /** setting this will set wrapModeU,wrapModeV and wrapModeW all at once! */\n get addressMode(): WRAP_MODE\n {\n return this.addressModeU;\n }\n\n set wrapMode(value: WRAP_MODE)\n {\n // #if _DEBUG\n deprecation(v8_0_0, 'TextureStyle.wrapMode is now TextureStyle.addressMode');\n // #endif\n\n this.addressMode = value;\n }\n\n get wrapMode(): WRAP_MODE\n {\n return this.addressMode;\n }\n\n set scaleMode(value: SCALE_MODE)\n {\n this.magFilter = value;\n this.minFilter = value;\n this.mipmapFilter = value;\n }\n\n /** setting this will set magFilter,minFilter and mipmapFilter all at once! */\n get scaleMode(): SCALE_MODE\n {\n return this.magFilter;\n }\n\n /** Specifies the maximum anisotropy value clamp used by the sampler. */\n set maxAnisotropy(value: number)\n {\n this._maxAnisotropy = Math.min(value, 16);\n\n if (this._maxAnisotropy > 1)\n {\n this.scaleMode = 'linear';\n }\n }\n\n get maxAnisotropy(): number\n {\n return this._maxAnisotropy;\n }\n\n // TODO - move this to WebGL?\n get _resourceId(): number\n {\n return this._sharedResourceId || this._generateResourceId();\n }\n\n public update()\n {\n // manage the resource..\n this.emit('change', this);\n this._sharedResourceId = null;\n }\n\n private _generateResourceId(): number\n {\n // eslint-disable-next-line max-len\n const bigKey = `${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;\n\n this._sharedResourceId = createResourceIdFromString(bigKey);\n\n return this._resourceId;\n }\n\n /** Destroys the style */\n public destroy()\n {\n this.destroyed = true;\n\n this.emit('destroy', this);\n this.emit('change', this);\n\n this.removeAllListeners();\n }\n}\n", "import EventEmitter from 'eventemitter3';\nimport { isPow2 } from '../../../../../maths/misc/pow2';\nimport { definedProps } from '../../../../../scene/container/utils/definedProps';\nimport { uid } from '../../../../../utils/data/uid';\nimport { TextureStyle } from '../TextureStyle';\n\nimport type { BindResource } from '../../../gpu/shader/BindResource';\nimport type { ALPHA_MODES, SCALE_MODE, TEXTURE_DIMENSIONS, TEXTURE_FORMATS, WRAP_MODE } from '../const';\nimport type { TextureStyleOptions } from '../TextureStyle';\nimport type { TextureResourceOrOptions } from '../utils/textureFrom';\n\n/**\n * options for creating a new TextureSource\n * @category rendering\n * @advanced\n */\nexport interface TextureSourceOptions<T extends Record<string, any> = any> extends TextureStyleOptions\n{\n /**\n * the resource that will be uploaded to the GPU. This is where we get our pixels from\n * eg an ImageBimt / Canvas / Video etc\n */\n resource?: T;\n /** the pixel width of this texture source. This is the REAL pure number, not accounting resolution */\n width?: number;\n /** the pixel height of this texture source. This is the REAL pure number, not accounting resolution */\n height?: number;\n /** the resolution of the texture. */\n resolution?: number;\n /** the format that the texture data has */\n format?: TEXTURE_FORMATS;\n /**\n * Used by internal textures\n * @ignore\n */\n sampleCount?: number;\n /**\n * Only really affects RenderTextures.\n * Should we use antialiasing for this texture. It will look better, but may impact performance as a\n * Blit operation will be required to resolve the texture.\n */\n antialias?: boolean;\n /** how many dimensions does this texture have? currently v8 only supports 2d */\n dimensions?: TEXTURE_DIMENSIONS;\n /** The number of mip levels to generate for this texture. this is overridden if autoGenerateMipmaps is true */\n mipLevelCount?: number;\n /**\n * Should we auto generate mipmaps for this texture? This will automatically generate mipmaps\n * for this texture when uploading to the GPU. Mipmapped textures take up more memory, but\n * can look better when scaled down.\n *\n * For performance reasons, it is recommended to NOT use this with RenderTextures, as they are often updated every frame.\n * If you do, make sure to call `updateMipmaps` after you update the texture.\n */\n autoGenerateMipmaps?: boolean;\n /** the alpha mode of the texture */\n alphaMode?: ALPHA_MODES;\n /** optional label, can be used for debugging */\n label?: string;\n /** If true, the Garbage Collector will unload this texture if it is not used after a period of time */\n autoGarbageCollect?: boolean;\n}\n\n/**\n * A TextureSource stores the information that represents an image.\n * All textures have require TextureSource, which contains information about the source.\n * Therefore you can have many textures all using a single TextureSource (eg a sprite sheet)\n *\n * This is an class is extended depending on the source of the texture.\n * Eg if you are using an an image as your resource, then an ImageSource is used.\n * @category rendering\n * @advanced\n */\nexport class TextureSource<T extends Record<string, any> = any> extends EventEmitter<{\n change: BindResource;\n update: TextureSource;\n unload: TextureSource;\n destroy: TextureSource;\n resize: TextureSource;\n styleChange: TextureSource;\n updateMipmaps: TextureSource;\n error: Error;\n}> implements BindResource\n{\n /** The default options used when creating a new TextureSource. override these to add your own defaults */\n public static defaultOptions: TextureSourceOptions = {\n resolution: 1,\n format: 'bgra8unorm',\n alphaMode: 'premultiply-alpha-on-upload',\n dimensions: '2d',\n mipLevelCount: 1,\n autoGenerateMipmaps: false,\n sampleCount: 1,\n antialias: false,\n autoGarbageCollect: false,\n };\n\n /** unique id for this Texture source */\n public readonly uid: number = uid('textureSource');\n /** optional label, can be used for debugging */\n public label: string;\n\n /**\n * The resource type used by this TextureSource. This is used by the bind groups to determine\n * how to handle this resource.\n * @internal\n */\n public readonly _resourceType = 'textureSource';\n /**\n * i unique resource id, used by the bind group systems.\n * This can change if the texture is resized or its resource changes\n * @internal\n */\n public _resourceId = uid('resource');\n /**\n * this is how the backends know how to upload this texture to the GPU\n * It changes depending on the resource type. Classes that extend TextureSource\n * should override this property.\n * @internal\n */\n public uploadMethodId = 'unknown';\n\n /** @internal */\n public _resolution = 1;\n\n /** the pixel width of this texture source. This is the REAL pure number, not accounting resolution */\n public pixelWidth = 1;\n /** the pixel height of this texture source. This is the REAL pure number, not accounting resolution */\n public pixelHeight = 1;\n\n /**\n * the width of this texture source, accounting for resolution\n * eg pixelWidth 200, resolution 2, then width will be 100\n */\n public width = 1;\n /**\n * the height of this texture source, accounting for resolution\n * eg pixelHeight 200, resolution 2, then height will be 100\n */\n public height = 1;\n\n /**\n * the resource that will be uploaded to the GPU. This is where we get our pixels from\n * eg an ImageBimt / Canvas / Video etc\n */\n public resource: T;\n\n /**\n * The number of samples of a multisample texture. This is always 1 for non-multisample textures.\n * To enable multisample for a texture, set antialias to true\n * @internal\n */\n public sampleCount = 1;\n\n /** The number of mip levels to generate for this texture. this is overridden if autoGenerateMipmaps is true */\n public mipLevelCount = 1;\n /**\n * Should we auto generate mipmaps for this texture? This will automatically generate mipmaps\n * for this texture when uploading to the GPU. Mipmapped textures take up more memory, but\n * can look better when scaled down.\n *\n * For performance reasons, it is recommended to NOT use this with RenderTextures, as they are often updated every frame.\n * If you do, make sure to call `updateMipmaps` after you update the texture.\n */\n public autoGenerateMipmaps = false;\n /** the format that the texture data has */\n public format: TEXTURE_FORMATS = 'rgba8unorm';\n /** how many dimensions does this texture have? currently v8 only supports 2d */\n public dimension: TEXTURE_DIMENSIONS = '2d';\n /** the alpha mode of the texture */\n public alphaMode: ALPHA_MODES;\n private _style: TextureStyle;\n\n /**\n * Only really affects RenderTextures.\n * Should we use antialiasing for this texture. It will look better, but may impact performance as a\n * Blit operation will be required to resolve the texture.\n */\n public antialias = false;\n\n /**\n * Has the source been destroyed?\n * @readonly\n */\n public destroyed: boolean;\n\n /**\n * Used by automatic texture Garbage Collection, stores last GC tick when it was bound\n * @protected\n */\n public _touched = 0;\n\n /**\n * Used by the batcher to build texture batches. faster to have the variable here!\n * @protected\n */\n public _batchTick = -1;\n /**\n * A temporary batch location for the texture batching. Here for performance reasons only!\n * @protected\n */\n public _textureBindLocation = -1;\n\n public isPowerOfTwo: boolean;\n\n /** If true, the Garbage Collector will unload this texture if it is not used after a period of time */\n public autoGarbageCollect: boolean;\n\n /**\n * used internally to know where a texture came from. Usually assigned by the asset loader!\n * @ignore\n */\n public _sourceOrigin: string;\n\n /**\n * @param options - options for creating a new TextureSource\n */\n constructor(protected readonly options: TextureSourceOptions<T> = {})\n {\n super();\n\n options = { ...TextureSource.defaultOptions, ...options };\n\n this.label = options.label ?? '';\n this.resource = options.resource;\n this.autoGarbageCollect = options.autoGarbageCollect;\n this._resolution = options.resolution;\n\n if (options.width)\n {\n this.pixelWidth = options.width * this._resolution;\n }\n else\n {\n this.pixelWidth = this.resource ? (this.resourceWidth ?? 1) : 1;\n }\n\n if (options.height)\n {\n this.pixelHeight = options.height * this._resolution;\n }\n else\n {\n this.pixelHeight = this.resource ? (this.resourceHeight ?? 1) : 1;\n }\n\n this.width = this.pixelWidth / this._resolution;\n this.height = this.pixelHeight / this._resolution;\n\n this.format = options.format;\n this.dimension = options.dimensions;\n this.mipLevelCount = options.mipLevelCount;\n this.autoGenerateMipmaps = options.autoGenerateMipmaps;\n this.sampleCount = options.sampleCount;\n this.antialias = options.antialias;\n this.alphaMode = options.alphaMode;\n\n this.style = new TextureStyle(definedProps(options));\n\n this.destroyed = false;\n\n this._refreshPOT();\n }\n\n /** returns itself */\n get source(): TextureSource\n {\n return this;\n }\n\n /** the style of the texture */\n get style(): TextureStyle\n {\n return this._style;\n }\n\n set style(value: TextureStyle)\n {\n if (this.style === value) return;\n\n this._style?.off('change', this._onStyleChange, this);\n this._style = value;\n this._style?.on('change', this._onStyleChange, this);\n\n this._onStyleChange();\n }\n\n /** Specifies the maximum anisotropy value clamp used by the sampler. */\n set maxAnisotropy(value: number)\n {\n this._style.maxAnisotropy = value;\n }\n\n get maxAnisotropy(): number\n {\n return this._style.maxAnisotropy;\n }\n\n /** setting this will set wrapModeU, wrapModeV and wrapModeW all at once! */\n get addressMode(): WRAP_MODE\n {\n return this._style.addressMode;\n }\n\n set addressMode(value: WRAP_MODE)\n {\n this._style.addressMode = value;\n }\n\n /** setting this will set wrapModeU, wrapModeV and wrapModeW all at once! */\n get repeatMode(): WRAP_MODE\n {\n return this._style.addressMode;\n }\n\n set repeatMode(value: WRAP_MODE)\n {\n this._style.addressMode = value;\n }\n\n /** Specifies the sampling behavior when the sample footprint is smaller than or equal to one texel. */\n get magFilter(): SCALE_MODE\n {\n return this._style.magFilter;\n }\n\n set magFilter(value: SCALE_MODE)\n {\n this._style.magFilter = value;\n }\n\n /** Specifies the sampling behavior when the sample footprint is larger than one texel. */\n get minFilter(): SCALE_MODE\n {\n return this._style.minFilter;\n }\n\n set minFilter(value: SCALE_MODE)\n {\n this._style.minFilter = value;\n }\n\n /** Specifies behavior for sampling between mipmap levels. */\n get mipmapFilter(): SCALE_MODE\n {\n return this._style.mipmapFilter;\n }\n\n set mipmapFilter(value: SCALE_MODE)\n {\n this._style.mipmapFilter = value;\n }\n\n /** Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture. */\n get lodMinClamp(): number\n {\n return this._style.lodMinClamp;\n }\n\n set lodMinClamp(value: number)\n {\n this._style.lodMinClamp = value;\n }\n\n /** Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture. */\n get lodMaxClamp(): number\n {\n return this._style.lodMaxClamp;\n }\n\n set lodMaxClamp(value: number)\n {\n this._style.lodMaxClamp = value;\n }\n\n private _onStyleChange()\n {\n this.emit('styleChange', this);\n }\n\n /** call this if you have modified the texture outside of the constructor */\n public update()\n {\n // update resource...\n if (this.resource)\n {\n const resolution = this._resolution;\n\n const didResize = this.resize(this.resourceWidth / resolution, this.resourceHeight / resolution);\n\n // no need to dispatch the update we resized as that will\n // notify the texture systems anyway\n if (didResize) return;\n }\n\n this.emit('update', this);\n }\n\n /** Destroys this texture source */\n public destroy()\n {\n this.destroyed = true;\n this.emit('destroy', this);\n this.emit('change', this);\n\n if (this._style)\n {\n this._style.destroy();\n this._style = null;\n }\n\n this.uploadMethodId = null;\n this.resource = null;\n this.removeAllListeners();\n }\n\n /**\n * This will unload the Texture source from the GPU. This will free up the GPU memory\n * As soon as it is required fore rendering, it will be re-uploaded.\n */\n public unload()\n {\n this._resourceId = uid('resource');\n this.emit('change', this);\n this.emit('unload', this);\n }\n\n /** the width of the resource. This is the REAL pure number, not accounting resolution */\n public get resourceWidth(): number\n {\n const { resource } = this;\n\n return resource.naturalWidth || resource.videoWidth || resource.displayWidth || resource.width;\n }\n\n /** the height of the resource. This is the REAL pure number, not accounting resolution */\n public get resourceHeight(): number\n {\n const { resource } = this;\n\n return resource.naturalHeight || resource.videoHeight || resource.displayHeight || resource.height;\n }\n\n /**\n * the resolution of the texture. Changing this number, will not change the number of pixels in the actual texture\n * but will the size of the texture when rendered.\n *\n * changing the resolution of this texture to 2 for example will make it appear twice as small when rendered (as pixel\n * density will have increased)\n */\n get resolution(): number\n {\n return this._resolution;\n }\n\n set resolution(resolution: number)\n {\n if (this._resolution === resolution) return;\n\n this._resolution = resolution;\n\n this.width = this.pixelWidth / resolution;\n this.height = this.pixelHeight / resolution;\n }\n\n /**\n * Resize the texture, this is handy if you want to use the texture as a render texture\n * @param width - the new width of the texture\n * @param height - the new height of the texture\n * @param resolution - the new resolution of the texture\n * @returns - if the texture was resized\n */\n public resize(width?: number, height?: number, resolution?: number): boolean\n {\n resolution ||= this._resolution;\n width ||= this.width;\n height ||= this.height;\n\n // make sure we work with rounded pixels\n const newPixelWidth = Math.round(width * resolution);\n const newPixelHeight = Math.round(height * resolution);\n\n this.width = newPixelWidth / resolution;\n this.height = newPixelHeight / resolution;\n\n this._resolution = resolution;\n\n if (this.pixelWidth === newPixelWidth && this.pixelHeight === newPixelHeight)\n {\n return false;\n }\n\n this._refreshPOT();\n\n this.pixelWidth = newPixelWidth;\n this.pixelHeight = newPixelHeight;\n\n this.emit('resize', this);\n\n this._resourceId = uid('resource');\n this.emit('change', this);\n\n return true;\n }\n\n /**\n * Lets the renderer know that this texture has been updated and its mipmaps should be re-generated.\n * This is only important for RenderTexture instances, as standard Texture instances will have their\n * mipmaps generated on upload. You should call this method after you make any change to the texture\n *\n * The reason for this is is can be quite expensive to update mipmaps for a texture. So by default,\n * We want you, the developer to specify when this action should happen.\n *\n * Generally you don't want to have mipmaps generated on Render targets that are changed every frame,\n */\n public updateMipmaps()\n {\n if (this.autoGenerateMipmaps && this.mipLevelCount > 1)\n {\n this.emit('updateMipmaps', this);\n }\n }\n\n set wrapMode(value: WRAP_MODE)\n {\n this._style.wrapMode = value;\n }\n\n get wrapMode(): WRAP_MODE\n {\n return this._style.wrapMode;\n }\n\n set scaleMode(value: SCALE_MODE)\n {\n this._style.scaleMode = value;\n }\n\n /** setting this will set magFilter,minFilter and mipmapFilter all at once! */\n get scaleMode(): SCALE_MODE\n {\n return this._style.scaleMode;\n }\n\n /**\n * Refresh check for isPowerOfTwo texture based on size\n * @private\n */\n protected _refreshPOT(): void\n {\n this.isPowerOfTwo = isPow2(this.pixelWidth) && isPow2(this.pixelHeight);\n }\n\n public static test(_resource: any): any\n {\n // this should be overridden by other sources..\n throw new Error('Unimplemented');\n }\n\n /**\n * A helper function that creates a new TextureSource based on the resource you provide.\n * @param resource - The resource to create the texture source from.\n */\n public static from: (resource: TextureResourceOrOptions) => TextureSource;\n}\n", "import { ExtensionType } from '../../../../../extensions/Extensions';\nimport { TextureSource } from './TextureSource';\n\nimport type { ExtensionMetadata } from '../../../../../extensions/Extensions';\nimport type { TypedArray } from '../../buffer/Buffer';\nimport type { TextureSourceOptions } from './TextureSource';\n\n/**\n * Options for creating a BufferImageSource.\n * @category rendering\n * @advanced\n */\nexport interface BufferSourceOptions extends TextureSourceOptions<TypedArray | ArrayBuffer>\n{\n width: number;\n height: number;\n}\n\n/**\n * A texture source that uses a TypedArray or ArrayBuffer as its resource.\n * It automatically determines the format based on the type of TypedArray provided.\n * @category rendering\n * @advanced\n */\nexport class BufferImageSource extends TextureSource<TypedArray | ArrayBuffer>\n{\n public static extension: ExtensionMetadata = ExtensionType.TextureSource;\n\n public uploadMethodId = 'buffer';\n\n constructor(options: BufferSourceOptions)\n {\n const buffer = options.resource || new Float32Array(options.width * options.height * 4);\n let format = options.format;\n\n if (!format)\n {\n if (buffer instanceof Float32Array)\n {\n format = 'rgba32float';\n }\n else if (buffer instanceof Int32Array)\n {\n format = 'rgba32uint';\n }\n else if (buffer instanceof Uint32Array)\n {\n format = 'rgba32uint';\n }\n else if (buffer instanceof Int16Array)\n {\n format = 'rgba16uint';\n }\n else if (buffer instanceof Uint16Array)\n {\n format = 'rgba16uint';\n }\n else if (buffer instanceof Int8Array)\n {\n format = 'bgra8unorm';\n }\n else\n {\n format = 'bgra8unorm';\n }\n }\n\n super({\n ...options,\n resource: buffer,\n format,\n });\n }\n\n public static test(resource: any): resource is TypedArray | ArrayBuffer\n {\n return resource instanceof Int8Array\n || resource instanceof Uint8Array\n || resource instanceof Uint8ClampedArray\n || resource instanceof Int16Array\n || resource instanceof Uint16Array\n || resource instanceof Int32Array\n || resource instanceof Uint32Array\n || resource instanceof Float32Array;\n }\n}\n", "// Your friendly neighbour https://en.wikipedia.org/wiki/Dihedral_group\n//\n// This file implements the dihedral group of order 16, also called\n// of degree 8. That's why its called groupD8.\n\nimport { type RectangleLike } from '../../culling/Culler';\nimport { type Rectangle } from '../shapes/Rectangle';\nimport { Matrix } from './Matrix';\n\n/*\n * Transform matrix for operation n is:\n * | ux | vx |\n * | uy | vy |\n */\n\nconst ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1];\nconst uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1];\nconst vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1];\nconst vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1];\n\n/**\n * [Cayley Table]{@link https://en.wikipedia.org/wiki/Cayley_table}\n * for the composition of each rotation in the dihederal group D8.\n * @type {number[][]}\n * @private\n */\nconst rotationCayley: number[][] = [];\n\n/**\n * Matrices for each `GD8Symmetry` rotation.\n * @type {Matrix[]}\n * @private\n */\nconst rotationMatrices: Matrix[] = [];\n\n/** Alias for `Math.sign`. */\nconst signum = Math.sign;\n\n/*\n * Initializes `rotationCayley` and `rotationMatrices`. It is called\n * only once below.\n */\nfunction init(): void\n{\n for (let i = 0; i < 16; i++)\n {\n const row: number[] = [];\n\n rotationCayley.push(row);\n\n for (let j = 0; j < 16; j++)\n {\n /* Multiplies rotation matrices i and j. */\n const _ux = signum((ux[i] * ux[j]) + (vx[i] * uy[j]));\n const _uy = signum((uy[i] * ux[j]) + (vy[i] * uy[j]));\n const _vx = signum((ux[i] * vx[j]) + (vx[i] * vy[j]));\n const _vy = signum((uy[i] * vx[j]) + (vy[i] * vy[j]));\n\n /* Finds rotation matrix matching the product and pushes it. */\n for (let k = 0; k < 16; k++)\n {\n if (ux[k] === _ux && uy[k] === _uy\n && vx[k] === _vx && vy[k] === _vy)\n {\n row.push(k);\n break;\n }\n }\n }\n }\n\n for (let i = 0; i < 16; i++)\n {\n const mat = new Matrix();\n\n mat.set(ux[i], uy[i], vx[i], vy[i], 0, 0);\n rotationMatrices.push(mat);\n }\n}\n\ninit();\n\ntype GD8Symmetry = number;\n/**\n * @typedef {number} GD8Symmetry\n * @see groupD8\n */\n\n/**\n * Implements the dihedral group D8, which is similar to\n * [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html};\n * D8 is the same but with diagonals, and it is used for texture\n * rotations.\n *\n * The directions the U- and V- axes after rotation\n * of an angle of `a: GD8Constant` are the vectors `(uX(a), uY(a))`\n * and `(vX(a), vY(a))`. These aren't necessarily unit vectors.\n * @author Ivan: ivanpopelyshev\n * @groupDescription groupD8\n * @category maths\n * @advanced\n */\nexport const groupD8 = {\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 0° | East |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n E: 0,\n\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 45°↻ | Southeast |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n SE: 1,\n\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 90°↻ | South |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n S: 2,\n\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 135°↻ | Southwest |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n SW: 3,\n\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 180° | West |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n W: 4,\n\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -135°/225°↻ | Northwest |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n NW: 5,\n\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -90°/270°↻ | North |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n N: 6,\n\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -45°/315°↻ | Northeast |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n NE: 7,\n\n /**\n * Reflection about Y-axis.\n * @group groupD8\n * @type {GD8Symmetry}\n */\n MIRROR_VERTICAL: 8,\n\n /**\n * Reflection about the main diagonal.\n * @group groupD8\n * @type {GD8Symmetry}\n */\n MAIN_DIAGONAL: 10,\n\n /**\n * Reflection about X-axis.\n * @group groupD8\n * @type {GD8Symmetry}\n */\n MIRROR_HORIZONTAL: 12,\n\n /**\n * Reflection about reverse diagonal.\n * @group groupD8\n * @type {GD8Symmetry}\n */\n REVERSE_DIAGONAL: 14,\n\n /**\n * @group groupD8\n * @param {GD8Symmetry} ind - sprite rotation angle.\n * @returns {GD8Symmetry} The X-component of the U-axis\n * after rotating the axes.\n */\n uX: (ind: GD8Symmetry): GD8Symmetry => ux[ind],\n\n /**\n * @group groupD8\n * @param {GD8Symmetry} ind - sprite rotation angle.\n * @returns {GD8Symmetry} The Y-component of the U-axis\n * after rotating the axes.\n */\n uY: (ind: GD8Symmetry): GD8Symmetry => uy[ind],\n\n /**\n * @group groupD8\n * @param {GD8Symmetry} ind - sprite rotation angle.\n * @returns {GD8Symmetry} The X-component of the V-axis\n * after rotating the axes.\n */\n vX: (ind: GD8Symmetry): GD8Symmetry => vx[ind],\n\n /**\n * @group groupD8\n * @param {GD8Symmetry} ind - sprite rotation angle.\n * @returns {GD8Symmetry} The Y-component of the V-axis\n * after rotating the axes.\n */\n vY: (ind: GD8Symmetry): GD8Symmetry => vy[ind],\n\n /**\n * @group groupD8\n * @param {GD8Symmetry} rotation - symmetry whose opposite\n * is needed. Only rotations have opposite symmetries while\n * reflections don't.\n * @returns {GD8Symmetry} The opposite symmetry of `rotation`\n */\n inv: (rotation: GD8Symmetry): GD8Symmetry =>\n {\n if (rotation & 8)// true only if between 8 & 15 (reflections)\n {\n return rotation & 15;// or rotation % 16\n }\n\n return (-rotation) & 7;// or (8 - rotation) % 8\n },\n\n /**\n * Composes the two D8 operations.\n *\n * Taking `^` as reflection:\n *\n * | | E=0 | S=2 | W=4 | N=6 | E^=8 | S^=10 | W^=12 | N^=14 |\n * |-------|-----|-----|-----|-----|------|-------|-------|-------|\n * | E=0 | E | S | W | N | E^ | S^ | W^ | N^ |\n * | S=2 | S | W | N | E | S^ | W^ | N^ | E^ |\n * | W=4 | W | N | E | S | W^ | N^ | E^ | S^ |\n * | N=6 | N | E | S | W | N^ | E^ | S^ | W^ |\n * | E^=8 | E^ | N^ | W^ | S^ | E | N | W | S |\n * | S^=10 | S^ | E^ | N^ | W^ | S | E | N | W |\n * | W^=12 | W^ | S^ | E^ | N^ | W | S | E | N |\n * | N^=14 | N^ | W^ | S^ | E^ | N | W | S | E |\n *\n * [This is a Cayley table]{@link https://en.wikipedia.org/wiki/Cayley_table}\n * @group groupD8\n * @param {GD8Symmetry} rotationSecond - Second operation, which\n * is the row in the above cayley table.\n * @param {GD8Symmetry} rotationFirst - First operation, which\n * is the column in the above cayley table.\n * @returns {GD8Symmetry} Composed operation\n */\n add: (rotationSecond: GD8Symmetry, rotationFirst: GD8Symmetry): GD8Symmetry => (\n rotationCayley[rotationSecond][rotationFirst]\n ),\n\n /**\n * Reverse of `add`.\n * @group groupD8\n * @param {GD8Symmetry} rotationSecond - Second operation\n * @param {GD8Symmetry} rotationFirst - First operation\n * @returns {GD8Symmetry} Result\n */\n sub: (rotationSecond: GD8Symmetry, rotationFirst: GD8Symmetry): GD8Symmetry => (\n rotationCayley[rotationSecond][groupD8.inv(rotationFirst)]\n ),\n\n /**\n * Adds 180 degrees to rotation, which is a commutative\n * operation.\n * @group groupD8\n * @param {number} rotation - The number to rotate.\n * @returns {number} Rotated number\n */\n rotate180: (rotation: number): number => rotation ^ 4,\n\n /**\n * Checks if the rotation angle is vertical, i.e. south\n * or north. It doesn't work for reflections.\n * @group groupD8\n * @param {GD8Symmetry} rotation - The number to check.\n * @returns {boolean} Whether or not the direction is vertical\n */\n isVertical: (rotation: GD8Symmetry): boolean => (rotation & 3) === 2, // rotation % 4 === 2\n\n /**\n * Approximates the vector `V(dx,dy)` into one of the\n * eight directions provided by `groupD8`.\n * @group groupD8\n * @param {number} dx - X-component of the vector\n * @param {number} dy - Y-component of the vector\n * @returns {GD8Symmetry} Approximation of the vector into\n * one of the eight symmetries.\n */\n byDirection: (dx: number, dy: number): GD8Symmetry =>\n {\n if (Math.abs(dx) * 2 <= Math.abs(dy))\n {\n if (dy >= 0)\n {\n return groupD8.S;\n }\n\n return groupD8.N;\n }\n else if (Math.abs(dy) * 2 <= Math.abs(dx))\n {\n if (dx > 0)\n {\n return groupD8.E;\n }\n\n return groupD8.W;\n }\n else if (dy > 0)\n {\n if (dx > 0)\n {\n return groupD8.SE;\n }\n\n return groupD8.SW;\n }\n else if (dx > 0)\n {\n return groupD8.NE;\n }\n\n return groupD8.NW;\n },\n\n /**\n * Helps sprite to compensate texture packer rotation.\n * @group groupD8\n * @param {Matrix} matrix - sprite world matrix\n * @param {GD8Symmetry} rotation - The rotation factor to use.\n * @param {number} tx - sprite anchoring\n * @param {number} ty - sprite anchoring\n */\n matrixAppendRotationInv: (matrix: Matrix, rotation: GD8Symmetry, tx = 0, ty = 0): void =>\n {\n // Packer used \"rotation\", we use \"inv(rotation)\"\n const mat: Matrix = rotationMatrices[groupD8.inv(rotation)];\n\n mat.tx = tx;\n mat.ty = ty;\n matrix.append(mat);\n },\n\n /**\n * Transforms rectangle coordinates based on texture packer rotation.\n * Used when texture atlas pages are rotated and coordinates need to be adjusted.\n * @group groupD8\n * @param {RectangleLike} rect - Rectangle with original coordinates to transform\n * @param {RectangleLike} sourceFrame - Source texture frame (includes offset and dimensions)\n * @param {GD8Symmetry} rotation - The groupD8 rotation value\n * @param {Rectangle} out - Rectangle to store the result\n * @returns {Rectangle} Transformed coordinates (includes source frame offset)\n */\n transformRectCoords: (\n rect: RectangleLike,\n sourceFrame: RectangleLike,\n rotation: GD8Symmetry,\n out: Rectangle\n ): Rectangle =>\n {\n const { x, y, width, height } = rect;\n const { x: frameX, y: frameY, width: frameWidth, height: frameHeight } = sourceFrame;\n\n if (rotation === groupD8.E)\n {\n // No rotation\n out.set(x + frameX, y + frameY, width, height);\n\n return out;\n }\n else if (rotation === groupD8.S)\n {\n // 90° clockwise rotation\n return out.set(\n (frameWidth - y - height) + frameX,\n x + frameY,\n height,\n width\n );\n }\n else if (rotation === groupD8.W)\n {\n // 180° rotation\n return out.set(\n (frameWidth - x - width) + frameX,\n (frameHeight - y - height) + frameY,\n width,\n height\n );\n }\n else if (rotation === groupD8.N)\n {\n // 270° clockwise rotation (90° counter-clockwise)\n return out.set(\n y + frameX,\n (frameHeight - x - width) + frameY,\n height,\n width\n );\n }\n\n // For other rotations (diagonal and reflections), fall back to no rotation\n // These are less common in typical texture atlases\n return out.set(x + frameX, y + frameY, width, height);\n },\n};\n", "// import { SHAPES } from '../const';\nimport { Point } from '../point/Point';\n\nimport type { Bounds } from '../../scene/container/bounds/Bounds';\nimport type { Matrix } from '../matrix/Matrix';\nimport type { SHAPE_PRIMITIVE } from '../misc/const';\nimport type { ShapePrimitive } from './ShapePrimitive';\n\nconst tempPoints = [new Point(), new Point(), new Point(), new Point()];\n\n// eslint-disable-next-line max-len\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type, requireExport/require-export-jsdoc, requireMemberAPI/require-member-api-doc\nexport interface Rectangle extends PixiMixins.Rectangle { }\n\n/**\n * The `Rectangle` object represents a rectangular area defined by its position and dimensions.\n * Used for hit testing, bounds calculation, and general geometric operations.\n * @example\n * ```ts\n * // Basic rectangle creation\n * const rect = new Rectangle(100, 100, 200, 150);\n *\n * // Use as container bounds\n * container.hitArea = new Rectangle(0, 0, 100, 100);\n *\n * // Check point containment\n * const isInside = rect.contains(mouseX, mouseY);\n *\n * // Manipulate dimensions\n * rect.width *= 2;\n * rect.height += 50;\n * ```\n * @remarks\n * - Position defined by top-left corner (x,y)\n * - Dimensions defined by width and height\n * - Supports point and rectangle containment\n * - Common in UI and layout calculations\n * @see {@link Circle} For circular shapes\n * @see {@link Polygon} For complex shapes\n * @see {@link RoundedRectangle} For rounded corners\n * @category maths\n * @standard\n */\nexport class Rectangle implements ShapePrimitive\n{\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @example\n * ```ts\n * // Check shape type\n * const shape = new Rectangle(0, 0, 100, 100);\n * console.log(shape.type); // 'rectangle'\n *\n * // Use in type guards\n * if (shape.type === 'rectangle') {\n * console.log(shape.width, shape.height);\n * }\n * ```\n * @readonly\n * @default 'rectangle'\n * @see {@link SHAPE_PRIMITIVE} For all shape types\n */\n public readonly type: SHAPE_PRIMITIVE = 'rectangle';\n\n /**\n * The X coordinate of the upper-left corner of the rectangle\n * @example\n * ```ts\n * // Basic x position\n * const rect = new Rectangle();\n * rect.x = 100;\n * ```\n * @default 0\n */\n public x: number;\n\n /**\n * The Y coordinate of the upper-left corner of the rectangle\n * @example\n * ```ts\n * // Basic y position\n * const rect = new Rectangle();\n * rect.y = 100;\n * ```\n * @default 0\n */\n public y: number;\n\n /**\n * The overall width of this rectangle\n * @example\n * ```ts\n * // Basic width setting\n * const rect = new Rectangle();\n * rect.width = 200;\n * ```\n * @default 0\n */\n public width: number;\n\n /**\n * The overall height of this rectangle\n * @example\n * ```ts\n * // Basic height setting\n * const rect = new Rectangle();\n * rect.height = 150;\n * ```\n * @default 0\n */\n public height: number;\n\n /**\n * @param x - The X coordinate of the upper-left corner of the rectangle\n * @param y - The Y coordinate of the upper-left corner of the rectangle\n * @param width - The overall width of the rectangle\n * @param height - The overall height of the rectangle\n */\n constructor(x: string | number = 0, y: string | number = 0, width: string | number = 0, height: string | number = 0)\n {\n this.x = Number(x);\n this.y = Number(y);\n this.width = Number(width);\n this.height = Number(height);\n }\n\n /**\n * Returns the left edge (x-coordinate) of the rectangle.\n * @example\n * ```ts\n * // Get left edge position\n * const rect = new Rectangle(100, 100, 200, 150);\n * console.log(rect.left); // 100\n *\n * // Use in alignment calculations\n * sprite.x = rect.left + padding;\n *\n * // Compare positions\n * if (point.x > rect.left) {\n * console.log('Point is right of rectangle');\n * }\n * ```\n * @readonly\n * @returns The x-coordinate of the left edge\n * @see {@link Rectangle.right} For right edge position\n * @see {@link Rectangle.x} For direct x-coordinate access\n */\n get left(): number\n {\n return this.x;\n }\n\n /**\n * Returns the right edge (x + width) of the rectangle.\n * @example\n * ```ts\n * // Get right edge position\n * const rect = new Rectangle(100, 100, 200, 150);\n * console.log(rect.right); // 300\n *\n * // Align to right edge\n * sprite.x = rect.right - sprite.width;\n *\n * // Check boundaries\n * if (point.x < rect.right) {\n * console.log('Point is inside right bound');\n * }\n * ```\n * @readonly\n * @returns The x-coordinate of the right edge\n * @see {@link Rectangle.left} For left edge position\n * @see {@link Rectangle.width} For width value\n */\n get right(): number\n {\n return this.x + this.width;\n }\n\n /**\n * Returns the top edge (y-coordinate) of the rectangle.\n * @example\n * ```ts\n * // Get top edge position\n * const rect = new Rectangle(100, 100, 200, 150);\n * console.log(rect.top); // 100\n *\n * // Position above rectangle\n * sprite.y = rect.top - sprite.height;\n *\n * // Check vertical position\n * if (point.y > rect.top) {\n * console.log('Point is below top edge');\n * }\n * ```\n * @readonly\n * @returns The y-coordinate of the top edge\n * @see {@link Rectangle.bottom} For bottom edge position\n * @see {@link Rectangle.y} For direct y-coordinate access\n */\n get top(): number\n {\n return this.y;\n }\n\n /**\n * Returns the bottom edge (y + height) of the rectangle.\n * @example\n * ```ts\n * // Get bottom edge position\n * const rect = new Rectangle(100, 100, 200, 150);\n * console.log(rect.bottom); // 250\n *\n * // Stack below rectangle\n * sprite.y = rect.bottom + margin;\n *\n * // Check vertical bounds\n * if (point.y < rect.bottom) {\n * console.log('Point is above bottom edge');\n * }\n * ```\n * @readonly\n * @returns The y-coordinate of the bottom edge\n * @see {@link Rectangle.top} For top edge position\n * @see {@link Rectangle.height} For height value\n */\n get bottom(): number\n {\n return this.y + this.height;\n }\n\n /**\n * Determines whether the Rectangle is empty (has no area).\n * @example\n * ```ts\n * // Check zero dimensions\n * const rect = new Rectangle(100, 100, 0, 50);\n * console.log(rect.isEmpty()); // true\n * ```\n * @returns True if the rectangle has no area\n * @see {@link Rectangle.width} For width value\n * @see {@link Rectangle.height} For height value\n */\n public isEmpty(): boolean\n {\n return this.left === this.right || this.top === this.bottom;\n }\n\n /**\n * A constant empty rectangle. This is a new object every time the property is accessed.\n * @example\n * ```ts\n * // Get fresh empty rectangle\n * const empty = Rectangle.EMPTY;\n * console.log(empty.isEmpty()); // true\n * ```\n * @returns A new empty rectangle instance\n * @see {@link Rectangle.isEmpty} For empty state testing\n */\n static get EMPTY(): Rectangle\n {\n return new Rectangle(0, 0, 0, 0);\n }\n\n /**\n * Creates a clone of this Rectangle\n * @example\n * ```ts\n * // Basic cloning\n * const original = new Rectangle(100, 100, 200, 150);\n * const copy = original.clone();\n *\n * // Clone and modify\n * const modified = original.clone();\n * modified.width *= 2;\n * modified.height += 50;\n *\n * // Verify independence\n * console.log(original.width); // 200\n * console.log(modified.width); // 400\n * ```\n * @returns A copy of the rectangle\n * @see {@link Rectangle.copyFrom} For copying into existing rectangle\n * @see {@link Rectangle.copyTo} For copying to another rectangle\n */\n public clone(): Rectangle\n {\n return new Rectangle(this.x, this.y, this.width, this.height);\n }\n\n /**\n * Converts a Bounds object to a Rectangle object.\n * @example\n * ```ts\n * // Convert bounds to rectangle\n * const bounds = container.getBounds();\n * const rect = new Rectangle().copyFromBounds(bounds);\n * ```\n * @param bounds - The bounds to copy and convert to a rectangle\n * @returns Returns itself\n * @see {@link Bounds} For bounds object structure\n * @see {@link Rectangle.getBounds} For getting rectangle bounds\n */\n public copyFromBounds(bounds: Bounds): this\n {\n this.x = bounds.minX;\n this.y = bounds.minY;\n this.width = bounds.maxX - bounds.minX;\n this.height = bounds.maxY - bounds.minY;\n\n return this;\n }\n\n /**\n * Copies another rectangle to this one.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Rectangle(100, 100, 200, 150);\n * const target = new Rectangle();\n * target.copyFrom(source);\n *\n * // Chain with other operations\n * const rect = new Rectangle()\n * .copyFrom(source)\n * .pad(10);\n * ```\n * @param rectangle - The rectangle to copy from\n * @returns Returns itself\n * @see {@link Rectangle.copyTo} For copying to another rectangle\n * @see {@link Rectangle.clone} For creating new rectangle copy\n */\n public copyFrom(rectangle: Rectangle): Rectangle\n {\n this.x = rectangle.x;\n this.y = rectangle.y;\n this.width = rectangle.width;\n this.height = rectangle.height;\n\n return this;\n }\n\n /**\n * Copies this rectangle to another one.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Rectangle(100, 100, 200, 150);\n * const target = new Rectangle();\n * source.copyTo(target);\n *\n * // Chain with other operations\n * const result = source\n * .copyTo(new Rectangle())\n * .getBounds();\n * ```\n * @param rectangle - The rectangle to copy to\n * @returns Returns given parameter\n * @see {@link Rectangle.copyFrom} For copying from another rectangle\n * @see {@link Rectangle.clone} For creating new rectangle copy\n */\n public copyTo(rectangle: Rectangle): Rectangle\n {\n rectangle.copyFrom(this);\n\n return rectangle;\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this Rectangle\n * @example\n * ```ts\n * // Basic containment check\n * const rect = new Rectangle(100, 100, 200, 150);\n * const isInside = rect.contains(150, 125); // true\n * // Check edge cases\n * console.log(rect.contains(100, 100)); // true (on edge)\n * console.log(rect.contains(300, 250)); // false (outside)\n * ```\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @returns Whether the x/y coordinates are within this Rectangle\n * @see {@link Rectangle.containsRect} For rectangle containment\n * @see {@link Rectangle.strokeContains} For checking stroke intersection\n */\n public contains(x: number, y: number): boolean\n {\n if (this.width <= 0 || this.height <= 0)\n {\n return false;\n }\n\n if (x >= this.x && x < this.x + this.width)\n {\n if (y >= this.y && y < this.y + this.height)\n {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this rectangle including the stroke.\n * @example\n * ```ts\n * // Basic stroke check\n * const rect = new Rectangle(100, 100, 200, 150);\n * const isOnStroke = rect.strokeContains(150, 100, 4); // 4px line width\n *\n * // Check with different alignments\n * const innerStroke = rect.strokeContains(150, 100, 4, 1); // Inside\n * const centerStroke = rect.strokeContains(150, 100, 4, 0.5); // Centered\n * const outerStroke = rect.strokeContains(150, 100, 4, 0); // Outside\n * ```\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @param strokeWidth - The width of the line to check\n * @param alignment - The alignment of the stroke (1 = inner, 0.5 = centered, 0 = outer)\n * @returns Whether the x/y coordinates are within this rectangle's stroke\n * @see {@link Rectangle.contains} For checking fill containment\n * @see {@link Rectangle.getBounds} For getting stroke bounds\n */\n public strokeContains(x: number, y: number, strokeWidth: number, alignment: number = 0.5): boolean\n {\n const { width, height } = this;\n\n if (width <= 0 || height <= 0) return false;\n\n const _x = this.x;\n const _y = this.y;\n\n const strokeWidthOuter = strokeWidth * (1 - alignment);\n const strokeWidthInner = strokeWidth - strokeWidthOuter;\n\n const outerLeft = _x - strokeWidthOuter;\n const outerRight = _x + width + strokeWidthOuter;\n const outerTop = _y - strokeWidthOuter;\n const outerBottom = _y + height + strokeWidthOuter;\n\n const innerLeft = _x + strokeWidthInner;\n const innerRight = _x + width - strokeWidthInner;\n const innerTop = _y + strokeWidthInner;\n const innerBottom = _y + height - strokeWidthInner;\n\n return (x >= outerLeft && x <= outerRight && y >= outerTop && y <= outerBottom)\n && !(x > innerLeft && x < innerRight && y > innerTop && y < innerBottom);\n }\n /**\n * Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.\n * Returns true only if the area of the intersection is >0, this means that Rectangles\n * sharing a side are not overlapping. Another side effect is that an arealess rectangle\n * (width or height equal to zero) can't intersect any other rectangle.\n * @param {Rectangle} other - The Rectangle to intersect with `this`.\n * @param {Matrix} transform - The transformation matrix of `other`.\n * @returns {boolean} A value of `true` if the transformed `other` Rectangle intersects with `this`; otherwise `false`.\n */\n /**\n * Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.\n *\n * Returns true only if the area of the intersection is greater than 0.\n * This means that rectangles sharing only a side are not considered intersecting.\n * @example\n * ```ts\n * // Basic intersection check\n * const rect1 = new Rectangle(0, 0, 100, 100);\n * const rect2 = new Rectangle(50, 50, 100, 100);\n * console.log(rect1.intersects(rect2)); // true\n *\n * // With transformation matrix\n * const matrix = new Matrix();\n * matrix.rotate(Math.PI / 4); // 45 degrees\n * console.log(rect1.intersects(rect2, matrix)); // Checks with rotation\n *\n * // Edge cases\n * const zeroWidth = new Rectangle(0, 0, 0, 100);\n * console.log(rect1.intersects(zeroWidth)); // false (no area)\n * ```\n * @remarks\n * - Returns true only if intersection area is > 0\n * - Rectangles sharing only a side are not intersecting\n * - Zero-area rectangles cannot intersect anything\n * - Supports optional transformation matrix\n * @param other - The Rectangle to intersect with `this`\n * @param transform - Optional transformation matrix of `other`\n * @returns True if the transformed `other` Rectangle intersects with `this`\n * @see {@link Rectangle.containsRect} For containment testing\n * @see {@link Rectangle.contains} For point testing\n */\n public intersects(other: Rectangle, transform?: Matrix): boolean\n {\n if (!transform)\n {\n const x0 = this.x < other.x ? other.x : this.x;\n const x1 = this.right > other.right ? other.right : this.right;\n\n if (x1 <= x0)\n {\n return false;\n }\n\n const y0 = this.y < other.y ? other.y : this.y;\n const y1 = this.bottom > other.bottom ? other.bottom : this.bottom;\n\n return y1 > y0;\n }\n\n const x0 = this.left;\n const x1 = this.right;\n const y0 = this.top;\n const y1 = this.bottom;\n\n if (x1 <= x0 || y1 <= y0)\n {\n return false;\n }\n\n const lt = tempPoints[0].set(other.left, other.top);\n const lb = tempPoints[1].set(other.left, other.bottom);\n const rt = tempPoints[2].set(other.right, other.top);\n const rb = tempPoints[3].set(other.right, other.bottom);\n\n if (rt.x <= lt.x || lb.y <= lt.y)\n {\n return false;\n }\n\n const s = Math.sign((transform.a * transform.d) - (transform.b * transform.c));\n\n if (s === 0)\n {\n return false;\n }\n\n transform.apply(lt, lt);\n transform.apply(lb, lb);\n transform.apply(rt, rt);\n transform.apply(rb, rb);\n\n if (Math.max(lt.x, lb.x, rt.x, rb.x) <= x0\n || Math.min(lt.x, lb.x, rt.x, rb.x) >= x1\n || Math.max(lt.y, lb.y, rt.y, rb.y) <= y0\n || Math.min(lt.y, lb.y, rt.y, rb.y) >= y1)\n {\n return false;\n }\n\n const nx = s * (lb.y - lt.y);\n const ny = s * (lt.x - lb.x);\n const n00 = (nx * x0) + (ny * y0);\n const n10 = (nx * x1) + (ny * y0);\n const n01 = (nx * x0) + (ny * y1);\n const n11 = (nx * x1) + (ny * y1);\n\n if (Math.max(n00, n10, n01, n11) <= (nx * lt.x) + (ny * lt.y)\n || Math.min(n00, n10, n01, n11) >= (nx * rb.x) + (ny * rb.y))\n {\n return false;\n }\n\n const mx = s * (lt.y - rt.y);\n const my = s * (rt.x - lt.x);\n const m00 = (mx * x0) + (my * y0);\n const m10 = (mx * x1) + (my * y0);\n const m01 = (mx * x0) + (my * y1);\n const m11 = (mx * x1) + (my * y1);\n\n if (Math.max(m00, m10, m01, m11) <= (mx * lt.x) + (my * lt.y)\n || Math.min(m00, m10, m01, m11) >= (mx * rb.x) + (my * rb.y))\n {\n return false;\n }\n\n return true;\n }\n\n /**\n * Pads the rectangle making it grow in all directions.\n *\n * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.\n * @example\n * ```ts\n * // Basic padding\n * const rect = new Rectangle(100, 100, 200, 150);\n * rect.pad(10); // Adds 10px padding on all sides\n *\n * // Different horizontal and vertical padding\n * const uiRect = new Rectangle(0, 0, 100, 50);\n * uiRect.pad(20, 10); // 20px horizontal, 10px vertical\n * ```\n * @remarks\n * - Adjusts x/y by subtracting padding\n * - Increases width/height by padding * 2\n * - Common in UI layout calculations\n * - Chainable with other methods\n * @param paddingX - The horizontal padding amount\n * @param paddingY - The vertical padding amount\n * @returns Returns itself\n * @see {@link Rectangle.enlarge} For growing to include another rectangle\n * @see {@link Rectangle.fit} For shrinking to fit within another rectangle\n */\n public pad(paddingX = 0, paddingY = paddingX): this\n {\n this.x -= paddingX;\n this.y -= paddingY;\n\n this.width += paddingX * 2;\n this.height += paddingY * 2;\n\n return this;\n }\n\n /**\n * Fits this rectangle around the passed one.\n * @example\n * ```ts\n * // Basic fitting\n * const container = new Rectangle(0, 0, 100, 100);\n * const content = new Rectangle(25, 25, 200, 200);\n * content.fit(container); // Clips to container bounds\n * ```\n * @param rectangle - The rectangle to fit around\n * @returns Returns itself\n * @see {@link Rectangle.enlarge} For growing to include another rectangle\n * @see {@link Rectangle.pad} For adding padding around the rectangle\n */\n public fit(rectangle: Rectangle): this\n {\n const x1 = Math.max(this.x, rectangle.x);\n const x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width);\n const y1 = Math.max(this.y, rectangle.y);\n const y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height);\n\n this.x = x1;\n this.width = Math.max(x2 - x1, 0);\n this.y = y1;\n this.height = Math.max(y2 - y1, 0);\n\n return this;\n }\n\n /**\n * Enlarges rectangle so that its corners lie on a grid defined by resolution.\n * @example\n * ```ts\n * // Basic grid alignment\n * const rect = new Rectangle(10.2, 10.6, 100.8, 100.4);\n * rect.ceil(); // Aligns to whole pixels\n *\n * // Custom resolution grid\n * const uiRect = new Rectangle(5.3, 5.7, 50.2, 50.8);\n * uiRect.ceil(0.5); // Aligns to half pixels\n *\n * // Use with precision value\n * const preciseRect = new Rectangle(20.001, 20.999, 100.001, 100.999);\n * preciseRect.ceil(1, 0.01); // Handles small decimal variations\n * ```\n * @param resolution - The grid size to align to (1 = whole pixels)\n * @param eps - Small number to prevent floating point errors\n * @returns Returns itself\n * @see {@link Rectangle.fit} For constraining to bounds\n * @see {@link Rectangle.enlarge} For growing dimensions\n */\n public ceil(resolution = 1, eps = 0.001): this\n {\n const x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution;\n const y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution;\n\n this.x = Math.floor((this.x + eps) * resolution) / resolution;\n this.y = Math.floor((this.y + eps) * resolution) / resolution;\n\n this.width = x2 - this.x;\n this.height = y2 - this.y;\n\n return this;\n }\n\n /**\n * Scales the rectangle's dimensions and position by the specified factors.\n * @example\n * ```ts\n * const rect = new Rectangle(50, 50, 100, 100);\n *\n * // Scale uniformly\n * rect.scale(0.5, 0.5);\n * // rect is now: x=25, y=25, width=50, height=50\n *\n * // non-uniformly\n * rect.scale(0.5, 1);\n * // rect is now: x=25, y=50, width=50, height=100\n * ```\n * @param x - The factor by which to scale the horizontal properties (x, width).\n * @param y - The factor by which to scale the vertical properties (y, height).\n * @returns Returns itself\n */\n public scale(x: number, y: number = x): this\n {\n this.x *= x;\n this.y *= y;\n this.width *= x;\n this.height *= y;\n\n return this;\n }\n\n /**\n * Enlarges this rectangle to include the passed rectangle.\n * @example\n * ```ts\n * // Basic enlargement\n * const rect = new Rectangle(50, 50, 100, 100);\n * const other = new Rectangle(0, 0, 200, 75);\n * rect.enlarge(other);\n * // rect is now: x=0, y=0, width=200, height=150\n *\n * // Use for bounding box calculation\n * const bounds = new Rectangle();\n * objects.forEach((obj) => {\n * bounds.enlarge(obj.getBounds());\n * });\n * ```\n * @param rectangle - The rectangle to include\n * @returns Returns itself\n * @see {@link Rectangle.fit} For shrinking to fit within another rectangle\n * @see {@link Rectangle.pad} For adding padding around the rectangle\n */\n public enlarge(rectangle: Rectangle): this\n {\n const x1 = Math.min(this.x, rectangle.x);\n const x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width);\n const y1 = Math.min(this.y, rectangle.y);\n const y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height);\n\n this.x = x1;\n this.width = x2 - x1;\n this.y = y1;\n this.height = y2 - y1;\n\n return this;\n }\n\n /**\n * Returns the framing rectangle of the rectangle as a Rectangle object\n * @example\n * ```ts\n * // Basic bounds retrieval\n * const rect = new Rectangle(100, 100, 200, 150);\n * const bounds = rect.getBounds();\n *\n * // Reuse existing rectangle\n * const out = new Rectangle();\n * rect.getBounds(out);\n * ```\n * @param out - Optional rectangle to store the result\n * @returns The framing rectangle\n * @see {@link Rectangle.copyFrom} For direct copying\n * @see {@link Rectangle.clone} For creating new copy\n */\n public getBounds(out?: Rectangle): Rectangle\n {\n out ||= new Rectangle();\n out.copyFrom(this);\n\n return out;\n }\n\n /**\n * Determines whether another Rectangle is fully contained within this Rectangle.\n *\n * Rectangles that occupy the same space are considered to be containing each other.\n *\n * Rectangles without area (width or height equal to zero) can't contain anything,\n * not even other arealess rectangles.\n * @example\n * ```ts\n * // Check if one rectangle contains another\n * const container = new Rectangle(0, 0, 100, 100);\n * const inner = new Rectangle(25, 25, 50, 50);\n *\n * console.log(container.containsRect(inner)); // true\n *\n * // Check overlapping rectangles\n * const partial = new Rectangle(75, 75, 50, 50);\n * console.log(container.containsRect(partial)); // false\n *\n * // Zero-area rectangles\n * const empty = new Rectangle(0, 0, 0, 100);\n * console.log(container.containsRect(empty)); // false\n * ```\n * @param other - The Rectangle to check for containment\n * @returns True if other is fully contained within this Rectangle\n * @see {@link Rectangle.contains} For point containment\n * @see {@link Rectangle.intersects} For overlap testing\n */\n public containsRect(other: Rectangle): boolean\n {\n if (this.width <= 0 || this.height <= 0) return false;\n\n const x1 = other.x;\n const y1 = other.y;\n const x2 = other.x + other.width;\n const y2 = other.y + other.height;\n\n return x1 >= this.x && x1 < this.x + this.width\n && y1 >= this.y && y1 < this.y + this.height\n && x2 >= this.x && x2 < this.x + this.width\n && y2 >= this.y && y2 < this.y + this.height;\n }\n\n /**\n * Sets the position and dimensions of the rectangle.\n * @example\n * ```ts\n * // Basic usage\n * const rect = new Rectangle();\n * rect.set(100, 100, 200, 150);\n *\n * // Chain with other operations\n * const bounds = new Rectangle()\n * .set(0, 0, 100, 100)\n * .pad(10);\n * ```\n * @param x - The X coordinate of the upper-left corner of the rectangle\n * @param y - The Y coordinate of the upper-left corner of the rectangle\n * @param width - The overall width of the rectangle\n * @param height - The overall height of the rectangle\n * @returns Returns itself for method chaining\n * @see {@link Rectangle.copyFrom} For copying from another rectangle\n * @see {@link Rectangle.clone} For creating a new copy\n */\n public set(x: number, y: number, width: number, height: number): this\n {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n\n return this;\n }\n\n // #if _DEBUG\n public toString(): string\n {\n return `[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`;\n }\n // #endif\n}\n", "/** @internal */\nexport const NOOP = () =>\n{\n // empty!\n};\n", "import { Matrix } from '../../../../maths/matrix/Matrix';\n\nimport type { Texture } from './Texture';\n\nconst tempMat = new Matrix();\n\n/**\n * Class controls uv mapping from Texture normal space to BaseTexture normal space.\n *\n * Takes `trim` and `rotate` into account. May contain clamp settings for Meshes and TilingSprite.\n *\n * Can be used in Texture `uvMatrix` field, or separately, you can use different clamp settings on the same texture.\n * If you want to add support for texture region of certain feature or filter, that's what you're looking for.\n *\n * Takes track of Texture changes through `_lastTextureID` private field.\n * Use `update()` method call to track it from outside.\n * @see Texture\n * @see Mesh\n * @see TilingSprite\n * @category rendering\n * @advanced\n */\nexport class TextureMatrix\n{\n /**\n * Matrix operation that converts texture region coords to texture coords\n * @readonly\n */\n public mapCoord: Matrix;\n\n /**\n * Changes frame clamping\n * Works with TilingSprite and Mesh\n * Change to 1.5 if you texture has repeated right and bottom lines, that leads to smoother borders\n * @default 0\n */\n public clampOffset: number;\n\n /**\n * Changes frame clamping\n * Works with TilingSprite and Mesh\n * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n * @default 0.5\n */\n public clampMargin: number;\n\n /**\n * Clamp region for normalized coords, left-top pixel center in xy , bottom-right in zw.\n * Calculated based on clampOffset.\n */\n public readonly uClampFrame: Float32Array;\n\n /** Normalized clamp offset. Calculated based on clampOffset. */\n public readonly uClampOffset: Float32Array;\n\n /**\n * Tracks Texture frame changes.\n * @ignore\n */\n public _updateID: number;\n\n /**\n * Tracks Texture frame changes.\n * @protected\n */\n protected _textureID: number;\n\n protected _texture: Texture;\n\n /**\n * If texture size is the same as baseTexture.\n * @default false\n * @readonly\n */\n public isSimple: boolean;\n\n /**\n * @param texture - observed texture\n * @param clampMargin - Changes frame clamping, 0.5 by default. Use -0.5 for extra border.\n */\n constructor(texture: Texture, clampMargin?: number)\n {\n this.mapCoord = new Matrix();\n this.uClampFrame = new Float32Array(4);\n this.uClampOffset = new Float32Array(2);\n this._textureID = -1;\n this._updateID = 0;\n\n this.clampOffset = 0;\n\n if ((typeof clampMargin === 'undefined'))\n {\n this.clampMargin = (texture.width < 10) ? 0 : 0.5;\n }\n else\n {\n this.clampMargin = clampMargin;\n }\n\n this.isSimple = false;\n\n this.texture = texture;\n }\n\n /** Texture property. */\n get texture(): Texture\n {\n return this._texture;\n }\n\n set texture(value: Texture)\n {\n if (this.texture === value) return;\n\n this._texture?.removeListener('update', this.update, this);\n this._texture = value;\n this._texture.addListener('update', this.update, this);\n\n this.update();\n }\n\n /**\n * Multiplies uvs array to transform\n * @param uvs - mesh uvs\n * @param [out=uvs] - output\n * @returns - output\n */\n public multiplyUvs(uvs: Float32Array, out?: Float32Array): Float32Array\n {\n if (out === undefined)\n {\n out = uvs;\n }\n\n const mat = this.mapCoord;\n\n for (let i = 0; i < uvs.length; i += 2)\n {\n const x = uvs[i];\n const y = uvs[i + 1];\n\n out[i] = (x * mat.a) + (y * mat.c) + mat.tx;\n out[i + 1] = (x * mat.b) + (y * mat.d) + mat.ty;\n }\n\n return out;\n }\n\n /**\n * Updates matrices if texture was changed\n * @returns - whether or not it was updated\n */\n public update(): boolean\n {\n const tex = this._texture;\n\n this._updateID++;\n\n const uvs = tex.uvs;\n\n this.mapCoord.set(uvs.x1 - uvs.x0, uvs.y1 - uvs.y0, uvs.x3 - uvs.x0, uvs.y3 - uvs.y0, uvs.x0, uvs.y0);\n\n const orig = tex.orig;\n const trim = tex.trim;\n\n if (trim)\n {\n tempMat.set(\n orig.width / trim.width,\n 0, 0, orig.height / trim.height,\n -trim.x / trim.width,\n -trim.y / trim.height\n );\n\n this.mapCoord.append(tempMat);\n }\n\n const texBase = tex.source;\n const frame = this.uClampFrame;\n const margin = this.clampMargin / texBase._resolution;\n const offset = this.clampOffset / texBase._resolution;\n\n frame[0] = (tex.frame.x + margin + offset) / texBase.width;\n frame[1] = (tex.frame.y + margin + offset) / texBase.height;\n frame[2] = (tex.frame.x + tex.frame.width - margin + offset) / texBase.width;\n frame[3] = (tex.frame.y + tex.frame.height - margin + offset) / texBase.height;\n\n this.uClampOffset[0] = this.clampOffset / texBase.pixelWidth;\n this.uClampOffset[1] = this.clampOffset / texBase.pixelHeight;\n\n this.isSimple = tex.frame.width === texBase.width\n && tex.frame.height === texBase.height\n && tex.rotate === 0;\n\n return true;\n }\n}\n", "import EventEmitter from 'eventemitter3';\nimport { groupD8 } from '../../../../maths/matrix/groupD8';\nimport { Rectangle } from '../../../../maths/shapes/Rectangle';\nimport { uid } from '../../../../utils/data/uid';\nimport { deprecation, v8_0_0 } from '../../../../utils/logging/deprecation';\nimport { NOOP } from '../../../../utils/misc/NOOP';\nimport { BufferImageSource } from './sources/BufferImageSource';\nimport { TextureSource } from './sources/TextureSource';\nimport { TextureMatrix } from './TextureMatrix';\n\nimport type { TextureResourceOrOptions } from './utils/textureFrom';\n\n/**\n * Stores the width of the non-scalable borders, for example when used with {@link NineSlicePlane} texture.\n * @category rendering\n * @advanced\n */\nexport interface TextureBorders\n{\n /** left border in pixels */\n left: number;\n /** top border in pixels */\n top: number;\n /** right border in pixels */\n right: number;\n /** bottom border in pixels */\n bottom: number;\n}\n\n/**\n * The UVs data structure for a texture.\n * @category rendering\n * @advanced\n */\nexport type UVs = {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n x3: number;\n y3: number;\n};\n\n/**\n * The options that can be passed to a new Texture\n * @category rendering\n * @standard\n */\nexport interface TextureOptions<TextureSourceType extends TextureSource = TextureSource>\n{\n /** the underlying texture data that this texture will use */\n source?: TextureSourceType;\n /** optional label, for debugging */\n label?: string;\n /** The rectangle frame of the texture to show */\n frame?: Rectangle;\n /** The area of original texture */\n orig?: Rectangle;\n /** Trimmed rectangle of original texture */\n trim?: Rectangle;\n /** Default anchor point used for sprite placement / rotation */\n defaultAnchor?: { x: number; y: number };\n /** Default borders used for 9-slice scaling {@link NineSlicePlane}*/\n defaultBorders?: TextureBorders;\n /** indicates how the texture was rotated by texture packer. See {@link groupD8} */\n rotate?: number;\n /**\n * Set to true if you plan on modifying this texture's frame, UVs, or swapping its source at runtime.\n * This is false by default as it improves performance. Generally, it's recommended to create new\n * textures and swap those rather than modifying an existing texture's properties unless you are\n * working with a dynamic frames.\n * Not setting this to true when modifying the texture can lead to visual artifacts.\n *\n * If this is false and you modify the texture, you can manually update the sprite's texture by calling\n * `sprite.onViewUpdate()`.\n */\n dynamic?: boolean;\n}\n\n/**\n * A texture that can be bound to a shader as it has a texture source.\n * @category rendering\n * @advanced\n */\nexport interface BindableTexture\n{\n source: TextureSource;\n}\n\n/**\n * A texture source can be a string, an image, a video, a canvas, or a texture resource.\n * @category rendering\n * @advanced\n * @see {@link TextureSource}\n * @see {@link TextureResourceOrOptions}\n * @see {@link Texture.from}\n */\nexport type TextureSourceLike = TextureSource | TextureResourceOrOptions | string;\n\n/**\n * A texture stores the information that represents an image or part of an image.\n *\n * A texture must have a loaded resource passed to it to work. It does not contain any\n * loading mechanisms.\n *\n * The Assets class can be used to load a texture from a file. This is the recommended\n * way as it will handle the loading and caching for you.\n *\n * ```js\n *\n * const texture = await Assets.load('assets/image.png');\n *\n * // once Assets has loaded the image it will be available via the from method\n * const sameTexture = Texture.from('assets/image.png');\n * // another way to access the texture once loaded\n * const sameAgainTexture = Assets.get('assets/image.png');\n *\n * const sprite1 = new Sprite(texture);\n *\n * ```\n *\n * It cannot be added to the display list directly; instead use it as the texture for a Sprite.\n * If no frame is provided for a texture, then the whole image is used.\n *\n * You can directly create a texture from an image and then reuse it multiple times like this :\n *\n * ```js\n * import { Sprite, Texture } from 'pixi.js';\n *\n * const texture = await Assets.load('assets/image.png');\n * const sprite1 = new Sprite(texture);\n * const sprite2 = new Sprite(texture);\n * ```\n *\n * If you didn't pass the texture frame to constructor, it enables `noFrame` mode:\n * it subscribes on baseTexture events, it automatically resizes at the same time as baseTexture.\n * @category rendering\n * @class\n * @standard\n */\nexport class Texture<TextureSourceType extends TextureSource = TextureSource> extends EventEmitter<{\n update: Texture\n destroy: Texture\n}> implements BindableTexture\n{\n /**\n * Helper function that creates a returns Texture based on the source you provide.\n * The source should be loaded and ready to go. If not its best to grab the asset using Assets.\n * @param id - String or Source to create texture from\n * @param skipCache - Skip adding the texture to the cache\n * @returns The texture based on the Id provided\n */\n public static from: (id: TextureSourceLike, skipCache?: boolean) => Texture;\n\n /** label used for debugging */\n public label?: string;\n /** unique id for this texture */\n public readonly uid: number = uid('texture');\n /**\n * Has the texture been destroyed?\n * @readonly\n */\n public destroyed: boolean;\n\n /** @internal */\n public _source: TextureSourceType;\n\n /**\n * Indicates whether the texture is rotated inside the atlas\n * set to 2 to compensate for texture packer rotation\n * set to 6 to compensate for spine packer rotation\n * can be used to rotate or mirror sprites\n * See {@link groupD8} for explanation\n */\n public readonly rotate: number;\n /** A uvs object based on the given frame and the texture source */\n public readonly uvs: UVs = { x0: 0, y0: 0, x1: 0, y1: 0, x2: 0, y2: 0, x3: 0, y3: 0 };\n /**\n * Anchor point that is used as default if sprite is created with this texture.\n * Changing the `defaultAnchor` at a later point of time will not update Sprite's anchor point.\n * @default {0,0}\n */\n public readonly defaultAnchor?: { x: number; y: number };\n /**\n * Default width of the non-scalable border that is used if 9-slice plane is created with this texture.\n * @since 7.2.0\n * @see NineSliceSprite\n */\n public readonly defaultBorders?: TextureBorders;\n /**\n * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,\n * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)\n */\n public readonly frame = new Rectangle();\n /** This is the area of original texture, before it was put in atlas. */\n public readonly orig: Rectangle;\n /**\n * This is the trimmed area of original texture, before it was put in atlas\n * Please call `updateUvs()` after you change coordinates of `trim` manually.\n */\n public readonly trim: Rectangle;\n\n /**\n * Does this Texture have any frame data assigned to it?\n *\n * This mode is enabled automatically if no frame was passed inside constructor.\n *\n * In this mode texture is subscribed to baseTexture events, and fires `update` on any change.\n *\n * Beware, after loading or resize of baseTexture event can fired two times!\n * If you want more control, subscribe on baseTexture itself.\n * @example\n * texture.on('update', () => {});\n */\n public noFrame = false;\n\n /**\n * Set to true if you plan on modifying the uvs of this texture.\n * When this is the case, sprites and other objects using the texture will\n * make sure to listen for changes to the uvs and update their vertices accordingly.\n */\n public dynamic = false;\n\n private _textureMatrix: TextureMatrix;\n\n /** is it a texture? yes! used for type checking */\n public readonly isTexture = true;\n\n /**\n * @param {TextureOptions} options - Options for the texture\n */\n constructor({\n source,\n label,\n frame,\n orig,\n trim,\n defaultAnchor,\n defaultBorders,\n rotate,\n dynamic\n }: TextureOptions<TextureSourceType> = {})\n {\n super();\n\n this.label = label;\n this.source = (source?.source ?? new TextureSource()) as TextureSourceType;\n\n this.noFrame = !frame;\n\n if (frame)\n {\n this.frame.copyFrom(frame);\n }\n else\n {\n const { width, height } = this._source;\n\n this.frame.width = width;\n this.frame.height = height;\n }\n\n this.orig = orig || this.frame;\n this.trim = trim;\n\n this.rotate = rotate ?? 0;\n this.defaultAnchor = defaultAnchor;\n this.defaultBorders = defaultBorders;\n\n this.destroyed = false;\n this.dynamic = dynamic || false;\n\n this.updateUvs();\n }\n\n set source(value: TextureSourceType)\n {\n if (this._source)\n {\n this._source.off('resize', this.update, this);\n }\n\n this._source = value;\n\n value.on('resize', this.update, this);\n\n this.emit('update', this);\n }\n\n /** the underlying source of the texture (equivalent of baseTexture in v7) */\n get source(): TextureSourceType\n {\n return this._source;\n }\n\n /** returns a TextureMatrix instance for this texture. By default, that object is not created because its heavy. */\n get textureMatrix()\n {\n if (!this._textureMatrix)\n {\n this._textureMatrix = new TextureMatrix(this);\n }\n\n return this._textureMatrix;\n }\n\n /** The width of the Texture in pixels. */\n get width(): number\n {\n return this.orig.width;\n }\n\n /** The height of the Texture in pixels. */\n get height(): number\n {\n return this.orig.height;\n }\n\n /** Call this function when you have modified the frame of this texture. */\n public updateUvs()\n {\n const { uvs, frame } = this;\n const { width, height } = this._source;\n\n const nX = frame.x / width;\n const nY = frame.y / height;\n\n const nW = frame.width / width;\n const nH = frame.height / height;\n\n let rotate = this.rotate;\n\n if (rotate)\n {\n // width and height div 2 div baseFrame size\n const w2 = nW / 2;\n const h2 = nH / 2;\n\n // coordinates of center\n const cX = nX + w2;\n const cY = nY + h2;\n\n rotate = groupD8.add(rotate, groupD8.NW); // NW is top-left corner\n uvs.x0 = cX + (w2 * groupD8.uX(rotate));\n uvs.y0 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2); // rotate 90 degrees clockwise\n uvs.x1 = cX + (w2 * groupD8.uX(rotate));\n uvs.y1 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2);\n uvs.x2 = cX + (w2 * groupD8.uX(rotate));\n uvs.y2 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2);\n uvs.x3 = cX + (w2 * groupD8.uX(rotate));\n uvs.y3 = cY + (h2 * groupD8.uY(rotate));\n }\n\n else\n {\n uvs.x0 = nX;\n uvs.y0 = nY;\n uvs.x1 = nX + nW;\n uvs.y1 = nY;\n uvs.x2 = nX + nW;\n uvs.y2 = nY + nH;\n uvs.x3 = nX;\n uvs.y3 = nY + nH;\n }\n }\n\n /**\n * Destroys this texture\n * @param destroySource - Destroy the source when the texture is destroyed.\n */\n public destroy(destroySource = false)\n {\n if (this._source)\n {\n this._source.off('resize', this.update, this);\n\n if (destroySource)\n {\n this._source.destroy();\n this._source = null;\n }\n }\n\n this._textureMatrix = null;\n this.destroyed = true;\n this.emit('destroy', this);\n this.removeAllListeners();\n }\n\n /**\n * Call this if you have modified the `texture outside` of the constructor.\n *\n * If you have modified this texture's source, you must separately call `texture.source.update()` to see those changes.\n */\n public update(): void\n {\n if (this.noFrame)\n {\n this.frame.width = this._source.width;\n this.frame.height = this._source.height;\n }\n\n this.updateUvs();\n this.emit('update', this);\n }\n\n /** @deprecated since 8.0.0 */\n get baseTexture(): TextureSource\n {\n // #if _DEBUG\n deprecation(v8_0_0, 'Texture.baseTexture is now Texture.source');\n // #endif\n\n return this._source;\n }\n\n /** an Empty Texture used internally by the engine */\n public static EMPTY: Texture;\n /** a White texture used internally by the engine */\n public static WHITE: Texture<BufferImageSource>;\n}\n\nTexture.EMPTY = new Texture({\n label: 'EMPTY',\n source: new TextureSource({\n label: 'EMPTY',\n })\n});\n\nTexture.EMPTY.destroy = NOOP;\n\nTexture.WHITE = new Texture({\n source: new BufferImageSource({\n resource: new Uint8Array([255, 255, 255, 255]),\n width: 1,\n height: 1,\n alphaMode: 'premultiply-alpha-on-upload',\n label: 'WHITE',\n }),\n label: 'WHITE',\n});\n\nTexture.WHITE.destroy = NOOP;\n", "import type { Rectangle } from '../maths/shapes/Rectangle';\n\n/**\n * The CullingMixin interface provides properties and methods for managing culling behavior\n * of a display object. Culling is the process of determining whether an object should be rendered\n * based on its visibility within the current view or frame.\n *\n * Key Features:\n * - Custom culling areas for better performance\n * - Per-object culling control\n * - Child culling management\n * @example\n * ```ts\n * // Enable culling for a container\n * const container = new Container();\n * container.cullable = true;\n *\n * // Set custom cull area for better performance\n * container.cullArea = new Rectangle(0, 0, 800, 600);\n *\n * // Disable child culling for static scenes\n * container.cullableChildren = false;\n * ```\n * @category scene\n * @standard\n */\nexport interface CullingMixinConstructor\n{\n /**\n * Custom shape used for culling calculations instead of object bounds.\n * Defined in local space coordinates relative to the object.\n * > [!NOTE]\n * > Setting this to a custom Rectangle allows you to define a specific area for culling,\n * > which can improve performance by avoiding expensive bounds calculations.\n * @example\n * ```ts\n * const container = new Container();\n *\n * // Define custom culling boundary\n * container.cullArea = new Rectangle(0, 0, 800, 600);\n *\n * // Reset to use object bounds\n * container.cullArea = null;\n * ```\n * @remarks\n * - Improves performance by avoiding bounds calculations\n * - Useful for containers with many children\n * - Set to null to use object bounds\n * @default null\n */\n cullArea: Rectangle;\n\n /**\n * Controls whether this object should be culled when out of view.\n * When true, the object will not be rendered if its bounds are outside the visible area.\n * @example\n * ```ts\n * const sprite = new Sprite(texture);\n *\n * // Enable culling\n * sprite.cullable = true;\n *\n * // Force object to always render\n * sprite.cullable = false;\n * ```\n * @remarks\n * - Does not affect transform updates\n * - Applies to this object only\n * - Children follow their own cullable setting\n * @default false\n */\n cullable: boolean;\n\n /**\n * Controls whether children of this container can be culled.\n * When false, skips recursive culling checks for better performance.\n * @example\n * ```ts\n * const container = new Container();\n *\n * // Enable container culling\n * container.cullable = true;\n *\n * // Disable child culling for performance\n * container.cullableChildren = false;\n *\n * // Children will always render if container is visible\n * container.addChild(sprite1, sprite2, sprite3);\n * ```\n * @remarks\n * - Improves performance for static scenes\n * - Useful when children are always within container bounds\n * - Parent culling still applies\n * @default true\n */\n cullableChildren: boolean;\n}\n\n/** @internal */\nexport const cullingMixin: CullingMixinConstructor = {\n cullArea: null,\n cullable: false,\n cullableChildren: true,\n};\n", "import type { PointData } from './PointData';\nimport type { PointLike } from './PointLike';\n\n// eslint-disable-next-line max-len\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type, requireExport/require-export-jsdoc, requireMemberAPI/require-member-api-doc\nexport interface ObservablePoint extends PixiMixins.ObservablePoint { }\n\n/**\n * Observer used to listen for observable point changes.\n * Provides callback mechanism for point value updates.\n * @example\n * ```ts\n * // Basic observer implementation\n * const observer: Observer<ObservablePoint> = {\n * _onUpdate: (point) => {\n * console.log(`Point updated to (${point.x}, ${point.y})`);\n * }\n * };\n *\n * // Create observable point with observer\n * const point = new ObservablePoint(observer, 100, 100);\n *\n * // Observer will be notified on changes\n * point.x = 200; // Logs: Point updated to (200, 100)\n * ```\n * @remarks\n * - Used internally by ObservablePoint\n * - Triggered on x/y changes\n * - Can track multiple points\n * - Useful for change detection\n * @typeParam T - The type of point being observed\n * @see {@link ObservablePoint} The observable point class\n * @see {@link PointLike} For point interface\n * @category maths\n * @standard\n */\nexport interface Observer<T>\n{\n /**\n * Callback to call when the point has updated.\n * Triggered whenever x or y coordinates change.\n * @param point - The point that was updated\n */\n _onUpdate: (point?: T) => void;\n}\n\n/**\n * The ObservablePoint object represents a location in a two-dimensional coordinate system.\n * Triggers a callback when its position changes.\n *\n * The x and y properties represent the position on the horizontal and vertical axes, respectively.\n * @example\n * ```ts\n * // Basic observable point usage\n * const point = new ObservablePoint(\n * { _onUpdate: (p) => console.log(`Updated to (${p.x}, ${p.y})`) },\n * 100, 100\n * );\n *\n * // Update triggers callback\n * point.x = 200; // Logs: Updated to (200, 100)\n * point.y = 300; // Logs: Updated to (200, 300)\n *\n * // Set both coordinates\n * point.set(50, 50); // Logs: Updated to (50, 50)\n * ```\n * @see {@link Point} For non-observable version\n * @see {@link Observer} For observer interface\n * @see {@link PointLike} For point interface\n * @category maths\n * @standard\n */\nexport class ObservablePoint implements PointLike\n{\n /** @ignore */\n public _x: number;\n /** @ignore */\n public _y: number;\n\n /** This object used to call the `onUpdate` callback when the point changes. */\n private readonly _observer: Observer<ObservablePoint>;\n\n /**\n * Creates a new `ObservablePoint`\n * @param observer - Observer to pass to listen for change events.\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n constructor(observer: Observer<ObservablePoint>, x?: number, y?: number)\n {\n this._x = x || 0;\n this._y = y || 0;\n\n this._observer = observer;\n }\n\n /**\n * Creates a clone of this point.\n * @example\n * ```ts\n * // Basic cloning\n * const point = new ObservablePoint(observer, 100, 200);\n * const copy = point.clone();\n *\n * // Clone with new observer\n * const newObserver = {\n * _onUpdate: (p) => console.log(`Clone updated: (${p.x}, ${p.y})`)\n * };\n * const watched = point.clone(newObserver);\n *\n * // Verify independence\n * watched.set(300, 400); // Only triggers new observer\n * ```\n * @param observer - Optional observer to pass to the new observable point\n * @returns A copy of this observable point\n * @see {@link ObservablePoint.copyFrom} For copying into existing point\n * @see {@link Observer} For observer interface details\n */\n public clone(observer?: Observer<ObservablePoint>): ObservablePoint\n {\n return new ObservablePoint(observer ?? this._observer, this._x, this._y);\n }\n\n /**\n * Sets the point to a new x and y position.\n *\n * If y is omitted, both x and y will be set to x.\n * @example\n * ```ts\n * // Basic position setting\n * const point = new ObservablePoint(observer);\n * point.set(100, 200);\n *\n * // Set both x and y to same value\n * point.set(50); // x=50, y=50\n * ```\n * @param x - Position on the x axis\n * @param y - Position on the y axis, defaults to x\n * @returns The point instance itself\n * @see {@link ObservablePoint.copyFrom} For copying from another point\n * @see {@link ObservablePoint.equals} For comparing positions\n */\n public set(x = 0, y = x): this\n {\n if (this._x !== x || this._y !== y)\n {\n this._x = x;\n this._y = y;\n this._observer._onUpdate(this);\n }\n\n return this;\n }\n\n /**\n * Copies x and y from the given point into this point.\n * @example\n * ```ts\n * // Basic copying\n * const source = new ObservablePoint(observer, 100, 200);\n * const target = new ObservablePoint();\n * target.copyFrom(source);\n *\n * // Copy and chain operations\n * const point = new ObservablePoint()\n * .copyFrom(source)\n * .set(x + 50, y + 50);\n *\n * // Copy from any PointData\n * const data = { x: 10, y: 20 };\n * point.copyFrom(data);\n * ```\n * @param p - The point to copy from\n * @returns The point instance itself\n * @see {@link ObservablePoint.copyTo} For copying to another point\n * @see {@link ObservablePoint.clone} For creating new point copy\n */\n public copyFrom(p: PointData): this\n {\n if (this._x !== p.x || this._y !== p.y)\n {\n this._x = p.x;\n this._y = p.y;\n this._observer._onUpdate(this);\n }\n\n return this;\n }\n\n /**\n * Copies this point's x and y into the given point.\n * @example\n * ```ts\n * // Basic copying\n * const source = new ObservablePoint(100, 200);\n * const target = new ObservablePoint();\n * source.copyTo(target);\n * ```\n * @param p - The point to copy to. Can be any type that is or extends `PointLike`\n * @returns The point (`p`) with values updated\n * @see {@link ObservablePoint.copyFrom} For copying from another point\n * @see {@link ObservablePoint.clone} For creating new point copy\n */\n public copyTo<T extends PointLike>(p: T): T\n {\n p.set(this._x, this._y);\n\n return p;\n }\n\n /**\n * Checks if another point is equal to this point.\n *\n * Compares x and y values using strict equality.\n * @example\n * ```ts\n * // Basic equality check\n * const p1 = new ObservablePoint(100, 200);\n * const p2 = new ObservablePoint(100, 200);\n * console.log(p1.equals(p2)); // true\n *\n * // Compare with PointData\n * const data = { x: 100, y: 200 };\n * console.log(p1.equals(data)); // true\n *\n * // Check different points\n * const p3 = new ObservablePoint(200, 300);\n * console.log(p1.equals(p3)); // false\n * ```\n * @param p - The point to check\n * @returns `true` if both `x` and `y` are equal\n * @see {@link ObservablePoint.copyFrom} For making points equal\n * @see {@link PointData} For point data interface\n */\n public equals(p: PointData): boolean\n {\n return (p.x === this._x) && (p.y === this._y);\n }\n\n // #if _DEBUG\n public toString(): string\n {\n return `[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`;\n }\n // #endif\n\n /**\n * Position of the observable point on the x axis.\n * Triggers observer callback when value changes.\n * @example\n * ```ts\n * // Basic x position\n * const point = new ObservablePoint(observer);\n * point.x = 100; // Triggers observer\n *\n * // Use in calculations\n * const width = rightPoint.x - leftPoint.x;\n * ```\n * @default 0\n */\n get x(): number\n {\n return this._x;\n }\n\n set x(value: number)\n {\n if (this._x !== value)\n {\n this._x = value;\n this._observer._onUpdate(this);\n }\n }\n\n /**\n * Position of the observable point on the y axis.\n * Triggers observer callback when value changes.\n * @example\n * ```ts\n * // Basic y position\n * const point = new ObservablePoint(observer);\n * point.y = 200; // Triggers observer\n *\n * // Use in calculations\n * const height = bottomPoint.y - topPoint.y;\n * ```\n * @default 0\n */\n get y(): number\n {\n return this._y;\n }\n\n set y(value: number)\n {\n if (this._y !== value)\n {\n this._y = value;\n this._observer._onUpdate(this);\n }\n }\n}\n", "import { deprecation } from '../../../utils/logging/deprecation';\n\nimport type { Container } from '../Container';\nimport type { CacheAsTextureOptions } from '../RenderGroup';\n\n/** @ignore */\nexport interface CacheAsTextureMixinConstructor\n{\n cacheAsTexture?: (val: boolean | CacheAsTextureOptions) => void;\n}\n\n/**\n * The CacheAsTextureMixin interface provides methods and properties for caching a container as a texture.\n * This can improve rendering performance for complex static containers by allowing them to be rendered as a single texture.\n * It includes methods to enable or disable caching, update the cached texture, and check\n * 1if the container is currently cached.\n * @category scene\n * @advanced\n */\nexport interface CacheAsTextureMixin extends Required<CacheAsTextureMixinConstructor>\n{\n /**\n * Caches this container as a texture. This allows the container to be rendered as a single texture,\n * which can improve performance for complex static containers.\n * @example\n * ```ts\n * // Basic caching\n * container.cacheAsTexture(true);\n *\n * // With custom options\n * container.cacheAsTexture({\n * resolution: 2,\n * antialias: true,\n * });\n *\n * // Disable caching\n * container.cacheAsTexture(false);\n *\n * // Cache a complex UI\n * const ui = new Container();\n * // Add multiple children...\n * ui.cacheAsTexture(true);\n * ui.updateCacheTexture(); // Update if contents change\n * ```\n * @param val - If true, enables caching with default options.\n * If false, disables caching.\n * Can also pass options object to configure caching behavior.\n * @see {@link Container#updateCacheTexture} For updating cached content\n * @see {@link Container#isCachedAsTexture} For checking cache state\n */\n cacheAsTexture: (val: boolean | CacheAsTextureOptions) => void;\n\n /**\n * Updates the cached texture of this container. This will flag the container's cached texture\n * to be redrawn on the next render.\n * @example\n * ```ts\n * // Basic update after changes\n * container.updateCacheTexture();\n * ```\n */\n updateCacheTexture: () => void;\n\n /**\n * Legacy property for backwards compatibility with PixiJS v7 and below.\n * Use `cacheAsTexture` instead.\n * @deprecated since 8.0.0\n */\n cacheAsBitmap: boolean;\n\n /**\n * Whether this container is currently cached as a texture.\n * @example\n * ```ts\n * // Check cache state\n * if (container.isCachedAsTexture) {\n * console.log('Container is cached');\n * }\n * ```\n * @readonly\n * @see {@link Container#cacheAsTexture} For enabling caching\n * @see {@link Container#updateCacheTexture} For updating cache\n */\n readonly isCachedAsTexture: boolean;\n}\n\n/** @internal */\nexport const cacheAsTextureMixin: Partial<Container> = {\n get isCachedAsTexture(): boolean\n {\n return !!this.renderGroup?.isCachedAsTexture;\n },\n\n cacheAsTexture(val: boolean | CacheAsTextureOptions): void\n {\n if (typeof val === 'boolean' && val === false)\n {\n this.disableRenderGroup();\n }\n else\n {\n this.enableRenderGroup();\n this.renderGroup.enableCacheAsTexture(val === true ? {} : val);\n }\n },\n\n updateCacheTexture(): void\n {\n this.renderGroup?.updateCacheTexture();\n },\n\n get cacheAsBitmap(): boolean\n {\n return this.isCachedAsTexture;\n },\n\n set cacheAsBitmap(val: boolean)\n {\n // #if _DEBUG\n deprecation('v8.6.0', 'cacheAsBitmap is deprecated, use cacheAsTexture instead.');\n // #endif\n this.cacheAsTexture(val);\n },\n} as Container;\n", "/**\n * Remove items from a javascript array without generating garbage\n * @function removeItems\n * @category utils\n * @internal\n * @param {Array<any>} arr - Array to remove elements from\n * @param {number} startIdx - starting index\n * @param {number} removeCount - how many to remove\n */\nexport function removeItems(arr: any[], startIdx: number, removeCount: number): void\n{\n const length = arr.length;\n let i;\n\n if (startIdx >= length || removeCount === 0)\n {\n return;\n }\n\n removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount);\n\n const len = length - removeCount;\n\n for (i = startIdx; i < len; ++i)\n {\n arr[i] = arr[i + removeCount];\n }\n\n arr.length = len;\n}\n", "import { removeItems } from '../../../utils/data/removeItems';\nimport { deprecation, v8_0_0 } from '../../../utils/logging/deprecation';\n\nimport type { Container, ContainerChild } from '../Container';\n\n/**\n * Mixin interface for containers that allows them to manage children.\n * It provides methods for adding, removing, and manipulating child containers.\n * @category scene\n * @advanced\n */\nexport interface ChildrenHelperMixin<C = ContainerChild>\n{\n /** @internal */\n allowChildren: boolean;\n addChild<U extends C[]>(...children: U): U[0];\n removeChild<U extends C[]>(...children: U): U[0];\n /**\n * Removes all children from this container that are within the begin and end indexes.\n * @example\n * ```ts\n * // Remove all children\n * container.removeChildren();\n *\n * // Remove first 3 children\n * const removed = container.removeChildren(0, 3);\n * console.log('Removed:', removed.length); // 3\n *\n * // Remove children from index 2 onwards\n * container.removeChildren(2);\n *\n * // Remove specific range\n * const middle = container.removeChildren(1, 4);\n * ```\n * @param {number} beginIndex - The beginning position\n * @param {number} endIndex - The ending position. Default is container size\n * @returns List of removed children\n * @throws {RangeError} If begin/end indexes are invalid\n * @see {@link Container#addChild} For adding children\n * @see {@link Container#removeChild} For removing specific children\n */\n removeChildren(beginIndex?: number, endIndex?: number): C[];\n /**\n * Removes a child from the specified index position.\n * @example\n * ```ts\n * // Remove first child\n * const removed = container.removeChildAt(0);\n *\n * // type safe access\n * const sprite = container.removeChildAt<Sprite>(1);\n *\n * // With error handling\n * try {\n * const child = container.removeChildAt(10);\n * } catch (e) {\n * console.warn('Index out of bounds');\n * }\n * ```\n * @param {number} index - The index to remove the child from\n * @returns The child that was removed\n * @throws {Error} If index is out of bounds\n * @see {@link Container#removeChild} For removing specific children\n * @see {@link Container#removeChildren} For removing multiple children\n */\n removeChildAt<U extends C>(index: number): U;\n /**\n * Returns the child at the specified index.\n * @example\n * ```ts\n * // Get first child\n * const first = container.getChildAt(0);\n *\n * // Type-safe access\n * const sprite = container.getChildAt<Sprite>(1);\n *\n * // With error handling\n * try {\n * const child = container.getChildAt(10);\n * } catch (e) {\n * console.warn('Index out of bounds');\n * }\n * ```\n * @param {number} index - The index to get the child from\n * @returns The child at the given index\n * @throws {Error} If index is out of bounds\n * @see {@link Container#children} For direct array access\n * @see {@link Container#getChildByLabel} For name-based lookup\n */\n getChildAt<U extends C>(index: number): U;\n /**\n * Changes the position of an existing child in the container.\n * @example\n * ```ts\n * // Basic index change\n * container.setChildIndex(sprite, 0); // Move to front\n * container.setChildIndex(sprite, container.children.length - 1); // Move to back\n *\n * // With error handling\n * try {\n * container.setChildIndex(sprite, 5);\n * } catch (e) {\n * console.warn('Invalid index or child not found');\n * }\n * ```\n * @param {Container}child - The child Container instance to reposition\n * @param {number}index - The resulting index number for the child\n * @throws {Error} If index is out of bounds\n * @throws {Error} If child is not in container\n * @see {@link Container#getChildIndex} For getting current index\n * @see {@link Container#swapChildren} For swapping positions\n */\n setChildIndex(child: C, index: number): void;\n /**\n * Returns the index position of a child Container instance.\n * @example\n * ```ts\n * // Basic index lookup\n * const index = container.getChildIndex(sprite);\n * console.log(`Sprite is at index ${index}`);\n *\n * // With error handling\n * try {\n * const index = container.getChildIndex(sprite);\n * } catch (e) {\n * console.warn('Child not found in container');\n * }\n * ```\n * @param {Container} child - The Container instance to identify\n * @returns The index position of the child container\n * @throws {Error} If child is not in this container\n * @see {@link Container#setChildIndex} For changing index\n * @see {@link Container#children} For direct array access\n */\n getChildIndex(child: C): number;\n /**\n * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown.\n * If the child is already in this container, it will be moved to the specified index.\n * @example\n * ```ts\n * // Add at specific index\n * container.addChildAt(sprite, 0); // Add to front\n *\n * // Move existing child\n * const index = container.children.length - 1;\n * container.addChildAt(existingChild, index); // Move to back\n *\n * // With error handling\n * try {\n * container.addChildAt(sprite, 1000);\n * } catch (e) {\n * console.warn('Index out of bounds');\n * }\n * ```\n * @param {Container} child - The child to add\n * @param {number} index - The index where the child will be placed\n * @returns The child that was added\n * @throws {Error} If index is out of bounds\n * @see {@link Container#addChild} For adding to the end\n * @see {@link Container#setChildIndex} For moving existing children\n */\n addChildAt<U extends C>(child: U, index: number): U;\n /**\n * Swaps the position of 2 Containers within this container.\n * @example\n * ```ts\n * // Basic swap\n * container.swapChildren(sprite1, sprite2);\n *\n * // With error handling\n * try {\n * container.swapChildren(sprite1, sprite2);\n * } catch (e) {\n * console.warn('One or both children not found in container');\n * }\n * ```\n * @remarks\n * - Updates render groups\n * - No effect if same child\n * - Triggers container changes\n * - Common in z-ordering\n * @param {Container} child - First container to swap\n * @param {Container} child2 - Second container to swap\n * @throws {Error} If either child is not in container\n * @see {@link Container#setChildIndex} For direct index placement\n * @see {@link Container#getChildIndex} For getting current positions\n */\n swapChildren<U extends C>(child: U, child2: U): void;\n /**\n * Remove the Container from its parent Container. If the Container has no parent, do nothing.\n * @example\n * ```ts\n * // Basic removal\n * sprite.removeFromParent();\n *\n * // With validation\n * if (sprite.parent) {\n * sprite.removeFromParent();\n * }\n * ```\n * @see {@link Container#addChild} For adding to a new parent\n * @see {@link Container#removeChild} For parent removing children\n */\n removeFromParent(): void;\n /**\n * Reparent a child or multiple children to this container while preserving their world transform.\n * This ensures that the visual position and rotation of the children remain the same even when changing parents.\n * @example\n * ```ts\n * // Basic reparenting\n * const sprite = new Sprite(texture);\n * oldContainer.addChild(sprite);\n * // Move to new parent, keeping visual position\n * newContainer.reparentChild(sprite);\n *\n * // Reparent multiple children\n * const batch = [sprite1, sprite2, sprite3];\n * newContainer.reparentChild(...batch);\n * ```\n * @param {Container} child - The child or children to reparent\n * @returns The first child that was reparented\n * @see {@link Container#reparentChildAt} For index-specific reparenting\n * @see {@link Container#addChild} For simple parenting\n */\n reparentChild<U extends C[]>(...child: U): U[0];\n /**\n * Reparent the child to this container at the specified index while preserving its world transform.\n * This ensures that the visual position and rotation of the child remain the same even when changing parents.\n * @example\n * ```ts\n * // Basic index-specific reparenting\n * const sprite = new Sprite(texture);\n * oldContainer.addChild(sprite);\n * // Move to new parent at index 0 (front)\n * newContainer.reparentChildAt(sprite, 0);\n * ```\n * @param {Container} child - The child to reparent\n * @param {number} index - The index to reparent the child to\n * @returns The reparented child\n * @throws {Error} If index is out of bounds\n * @see {@link Container#reparentChild} For appending reparented children\n * @see {@link Container#addChildAt} For simple indexed parenting\n */\n reparentChildAt<U extends C>(child: U, index: number): U;\n /**\n * Replace a child in the container with a new child. Copying the local transform from the old child to the new one.\n * @param {Container} oldChild - The child to replace.\n * @param {Container} newChild - The new child to add.\n */\n replaceChild<U extends C, T extends C>(oldChild: U, newChild: T): void;\n}\n\n/** @internal */\nexport const childrenHelperMixin: ChildrenHelperMixin<ContainerChild> = {\n\n allowChildren: true,\n\n removeChildren(beginIndex = 0, endIndex?: number): ContainerChild[]\n {\n const end = endIndex ?? this.children.length;\n const range = end - beginIndex;\n const removed: ContainerChild[] = [];\n\n if (range > 0 && range <= end)\n {\n for (let i = end - 1; i >= beginIndex; i--)\n {\n const child = this.children[i];\n\n if (!child) continue;\n removed.push(child);\n child.parent = null;\n }\n\n removeItems(this.children, beginIndex, end);\n\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n if (renderGroup)\n {\n renderGroup.removeChildren(removed);\n }\n\n for (let i = 0; i < removed.length; ++i)\n {\n const child = removed[i];\n\n child.parentRenderLayer?.detach(child);\n\n this.emit('childRemoved', child, this, i);\n removed[i].emit('removed', this);\n }\n\n if (removed.length > 0)\n {\n this._didViewChangeTick++;\n }\n\n return removed;\n }\n else if (range === 0 && this.children.length === 0)\n {\n return removed;\n }\n\n throw new RangeError('removeChildren: numeric values are outside the acceptable range.');\n },\n\n removeChildAt<U extends ContainerChild>(index: number): U\n {\n const child = this.getChildAt<U>(index);\n\n return this.removeChild(child);\n },\n\n getChildAt<U extends ContainerChild>(index: number): U\n {\n if (index < 0 || index >= this.children.length)\n {\n throw new Error(`getChildAt: Index (${index}) does not exist.`);\n }\n\n return this.children[index] as U;\n },\n\n setChildIndex(child: ContainerChild, index: number): void\n {\n if (index < 0 || index >= this.children.length)\n {\n throw new Error(`The index ${index} supplied is out of bounds ${this.children.length}`);\n }\n\n this.getChildIndex(child); // check if child exists\n this.addChildAt(child, index);\n },\n\n getChildIndex(child: ContainerChild): number\n {\n const index = this.children.indexOf(child);\n\n if (index === -1)\n {\n throw new Error('The supplied Container must be a child of the caller');\n }\n\n return index;\n },\n\n addChildAt<U extends ContainerChild>(child: U, index: number): U\n {\n // #if _DEBUG\n if (!this.allowChildren)\n {\n deprecation(v8_0_0, 'addChildAt: Only Containers will be allowed to add children in v8.0.0');\n }\n // #endif\n\n const { children } = this;\n\n if (index < 0 || index > children.length)\n {\n throw new Error(`${child}addChildAt: The index ${index} supplied is out of bounds ${children.length}`);\n }\n\n // TODO - check if child is already in the list?\n // we should be able to optimise this!\n\n if (child.parent)\n {\n const currentIndex = child.parent.children.indexOf(child);\n\n // If this child is in the container and in the same position, do nothing\n if (child.parent === this && currentIndex === index)\n {\n return child;\n }\n\n if (currentIndex !== -1)\n {\n child.parent.children.splice(currentIndex, 1);\n }\n }\n\n if (index === children.length)\n {\n children.push(child);\n }\n else\n {\n children.splice(index, 0, child);\n }\n\n child.parent = this;\n child.didChange = true;\n child._updateFlags = 0b1111;\n\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n if (renderGroup)\n {\n renderGroup.addChild(child);\n }\n\n if (this.sortableChildren) this.sortDirty = true;\n\n this.emit('childAdded', child, this, index);\n child.emit('added', this);\n\n return child;\n },\n\n swapChildren<U extends ContainerChild>(child: U, child2: U): void\n {\n if (child === child2)\n {\n return;\n }\n\n const index1 = this.getChildIndex(child);\n const index2 = this.getChildIndex(child2);\n\n this.children[index1] = child2;\n this.children[index2] = child;\n\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n if (renderGroup)\n {\n renderGroup.structureDidChange = true;\n }\n\n this._didContainerChangeTick++;\n },\n\n removeFromParent()\n {\n this.parent?.removeChild(this);\n },\n\n reparentChild<U extends ContainerChild[]>(...child: U): U[0]\n {\n if (child.length === 1)\n {\n return this.reparentChildAt(child[0], this.children.length);\n }\n\n child.forEach((c) => this.reparentChildAt(c, this.children.length));\n\n return child[0];\n },\n\n reparentChildAt<U extends ContainerChild>(child: U, index: number): U\n {\n if (child.parent === this)\n {\n this.setChildIndex(child, index);\n\n return child;\n }\n\n const childMat = child.worldTransform.clone();\n\n child.removeFromParent();\n this.addChildAt(child, index);\n\n const newMatrix = this.worldTransform.clone();\n\n newMatrix.invert();\n childMat.prepend(newMatrix);\n\n child.setFromMatrix(childMat);\n\n return child;\n },\n\n replaceChild<U extends ContainerChild, T extends ContainerChild>(oldChild: U, newChild: T)\n {\n oldChild.updateLocalTransform();\n this.addChildAt(newChild, this.getChildIndex(oldChild));\n\n newChild.setFromMatrix(oldChild.localTransform);\n newChild.updateLocalTransform();\n this.removeChild(oldChild);\n },\n} as Container;\n", "import { type InstructionSet } from '../../../rendering/renderers/shared/instructions/InstructionSet';\nimport { type InstructionPipe } from '../../../rendering/renderers/shared/instructions/RenderPipe';\nimport { type Renderer, type RenderPipes } from '../../../rendering/renderers/types';\nimport { type RenderLayer } from '../../layers/RenderLayer';\n\nimport type { Container } from '../Container';\n\n/**\n * The CollectRenderablesMixin interface defines methods for collecting renderable objects\n * from a container and its children. These methods add the renderables to an instruction set,\n * which is used by the renderer to process and display the scene.\n * @category scene\n * @internal\n */\nexport interface CollectRenderablesMixin\n{\n /**\n * Collects all renderables from the container and its children, adding them to the instruction set.\n * This method decides whether to use a simple or advanced collection method based on the container's properties.\n * @param {InstructionSet} instructionSet - The set of instructions to which the renderables will be added.\n * @param {Renderer} renderer - The renderer responsible for rendering the scene.\n * @param {RenderLayer} currentLayer - The current render layer being processed.\n * @internal\n */\n collectRenderables(instructionSet: InstructionSet, renderer: Renderer, currentLayer: RenderLayer): void;\n\n /**\n * Collects renderables using a simple method, suitable for containers marked as simple.\n * This method iterates over the container's children and adds their renderables to the instruction set.\n * @param {InstructionSet} instructionSet - The set of instructions to which the renderables will be added.\n * @param {Renderer} renderer - The renderer responsible for rendering the scene.\n * @param {RenderLayer} currentLayer - The current render layer being processed.\n * @internal\n */\n collectRenderablesSimple(instructionSet: InstructionSet, renderer: Renderer, currentLayer: RenderLayer): void;\n\n /**\n * Collects renderables using an advanced method, suitable for containers with complex processing needs.\n * This method handles additional effects and transformations that may be applied to the renderables.\n * @param {InstructionSet} instructionSet - The set of instructions to which the renderables will be added.\n * @param {Renderer} renderer - The renderer responsible for rendering the scene.\n * @param {RenderLayer} currentLayer - The current render layer being processed.\n * @internal\n */\n collectRenderablesWithEffects(\n instructionSet: InstructionSet,\n renderer: Renderer,\n currentLayer: RenderLayer,\n ): void;\n}\n\n/**\n * The collectRenderablesMixin provides implementations for the methods defined in the CollectRenderablesMixin interface.\n * It includes logic to determine the appropriate method for collecting renderables based on the container's properties.\n * @internal\n */\nexport const collectRenderablesMixin: Partial<Container> = {\n collectRenderables(instructionSet: InstructionSet, renderer: Renderer, currentLayer: RenderLayer): void\n {\n // Skip processing if the container is not in the current render layer or is not fully visible.\n if ((this.parentRenderLayer && this.parentRenderLayer !== currentLayer)\n || this.globalDisplayStatus < 0b111 || !this.includeInBuild) return;\n\n // Sort children if the container has sortable children.\n if (this.sortableChildren)\n {\n this.sortChildren();\n }\n\n // Choose the appropriate method for collecting renderables based on the container's properties.\n if (this.isSimple)\n {\n this.collectRenderablesSimple(instructionSet, renderer, currentLayer);\n }\n else if (this.renderGroup)\n {\n renderer.renderPipes.renderGroup.addRenderGroup(this.renderGroup, instructionSet);\n }\n else\n {\n this.collectRenderablesWithEffects(instructionSet, renderer, currentLayer);\n }\n },\n collectRenderablesSimple(\n instructionSet: InstructionSet,\n renderer: Renderer,\n currentLayer: RenderLayer,\n ): void\n {\n const children = this.children;\n const length = children.length;\n\n // Iterate over each child and collect their renderables.\n for (let i = 0; i < length; i++)\n {\n children[i].collectRenderables(instructionSet, renderer, currentLayer);\n }\n },\n collectRenderablesWithEffects(\n instructionSet: InstructionSet,\n renderer: Renderer,\n currentLayer: RenderLayer,\n ): void\n {\n const { renderPipes } = renderer;\n\n // Apply each effect to the renderables before collecting them.\n for (let i = 0; i < this.effects.length; i++)\n {\n const effect = this.effects[i];\n const pipe = renderPipes[effect.pipe as keyof RenderPipes] as InstructionPipe<any>;\n\n pipe.push(effect, this, instructionSet);\n }\n\n // Collect renderables using the simple method after applying effects.\n this.collectRenderablesSimple(instructionSet, renderer, currentLayer);\n\n // Remove effects from the renderables after collection, processing in reverse order.\n for (let i = this.effects.length - 1; i >= 0; i--)\n {\n const effect = this.effects[i];\n const pipe = renderPipes[effect.pipe as keyof RenderPipes] as InstructionPipe<any>;\n\n pipe.pop(effect, this, instructionSet);\n }\n }\n} as Container;\n", "import type { Rectangle } from '../maths/shapes/Rectangle';\nimport type { Effect } from '../scene/container/Effect';\nimport type { Filter } from './Filter';\n\n/**\n * A filter effect is an effect that can be applied to a container that involves applying special pixel effects\n * to that container as it is rendered. Used internally when the filters property is modified on a container.\n * @internal\n */\nexport class FilterEffect implements Effect\n{\n /** read only filters array - to modify, set it again! */\n public filters: readonly Filter[];\n /**\n * If specified, rather than calculating the bounds of the container that the filter\n * will apply to, we use this rect instead. This is a local rect - so will have the containers transform\n * applied to it\n */\n public filterArea?: Rectangle;\n\n /** the pipe that knows how to handle this effect */\n public pipe = 'filter';\n /** the priority of this effect */\n public priority = 1;\n\n public destroy(): void\n {\n for (let i = 0; i < this.filters.length; i++)\n {\n this.filters[i].destroy();\n }\n\n this.filters = null;\n this.filterArea = null;\n }\n}\n", "import { FilterEffect } from '../../../filters/FilterEffect';\nimport { MaskEffectManager } from '../../../rendering/mask/MaskEffectManager';\n\nimport type { Filter } from '../../../filters/Filter';\nimport type { Rectangle } from '../../../maths/shapes/Rectangle';\nimport type { MaskEffect } from '../../../rendering/mask/MaskEffectManager';\nimport type { Container } from '../Container';\nimport type { Effect } from '../Effect';\n\n/** @ignore */\nexport interface EffectsMixinConstructor\n{\n /**\n * The mask to apply, which can be a Container or null.\n *\n * If null, it clears the existing mask.\n * @example\n * ```ts\n * // Set a mask\n * sprite.setMask({\n * mask: graphics,\n * inverse: false,\n * });\n */\n mask?: Mask;\n setMask?: (options: Partial<MaskOptionsAndMask>) => void;\n /**\n * Sets the filters for the displayObject.\n * Filters are visual effects that can be applied to any display object and its children.\n *\n * > [!IMPORTANT] This is a WebGL/WebGPU only feature and will be ignored by the canvas renderer.\n * @example\n * ```ts\n * new Container({\n * filters: [new BlurFilter(2), new ColorMatrixFilter()],\n * });\n * ```\n * @see {@link Filter} For filter base class\n */\n filters?: Filter | readonly Filter[];\n}\n\n/**\n * The Mask type represents different ways to mask a display object.\n * - A number represents a mask ID.\n * - A Container represents a mask object, such as a Graphics or Sprite.\n * - null indicates that no mask is applied.\n * @example\n * ```ts\n * // Using a Container as a mask\n * const maskContainer: Mask = new Graphics();\n * // Using a mask ID\n * const maskId: Mask = 123;\n * // No mask applied\n * const noMask: Mask = null;\n * ```\n * @category scene\n * @standard\n */\nexport type Mask = number | Container | null;\n\n/**\n * Options for configuring mask behavior on a display object.\n * @example\n * ```ts\n * // Basic mask inversion\n * sprite.setMask({\n * mask: graphics,\n * inverse: true\n * });\n * ```\n * @see {@link Container#setMask} For applying masks with options\n * @see {@link Container#mask} For basic masking\n * @category scene\n * @standard\n */\nexport interface MaskOptions\n{\n /**\n * Whether the mask should be inverted.\n * When true, the masked area becomes transparent and the unmasked area becomes visible.\n * @default false\n * @example\n * ```ts\n * // Invert the mask\n * sprite.setMask({\n * mask: graphics,\n * inverse: true\n * });\n * ```\n */\n inverse: boolean;\n}\n\n/**\n * MaskOptionsAndMask combines MaskOptions with a Mask for configuring masking behavior.\n * Used when setting up complex masking effects with additional options.\n * @example\n * ```ts\n * sprite.setMask({\n * mask: graphics,\n * inverse: true,\n * });\n *\n * // Clear existing mask\n * sprite.setMask({\n * mask: null,\n * inverse: false,\n * });\n * ```\n * @category scene\n * @standard\n * @see {@link Container#setMask} For applying masks\n * @see {@link MaskOptions} For base options\n */\nexport interface MaskOptionsAndMask extends MaskOptions\n{\n /**\n * The mask to apply, which can be a Container or null.\n *\n * If null, it clears the existing mask.\n * @example\n * ```ts\n * // Set a mask\n * sprite.setMask({\n * mask: graphics,\n * inverse: false,\n * });\n */\n mask: Mask;\n}\n\n/**\n * The EffectsMixin interface provides methods and properties for managing effects\n * such as masks and filters on a display object.\n * It allows for adding, removing, and configuring effects, as well as setting a mask for the display object.\n * @category scene\n * @advanced\n */\nexport interface EffectsMixin extends Required<EffectsMixinConstructor>\n{\n /** @private */\n _maskEffect?: MaskEffect;\n /** @private */\n _maskOptions?: MaskOptions;\n /** @private */\n _filterEffect?: FilterEffect,\n /** @private */\n _markStructureAsChanged(): void;\n\n /**\n * The area the filter is applied to. This is used as an optimization to define a specific region\n * for filter effects instead of calculating the display object bounds each frame.\n *\n * > [!NOTE]\n * > Setting this to a custom Rectangle allows you to define a specific area for filter effects,\n * > which can improve performance by avoiding expensive bounds calculations.\n * @example\n * ```ts\n * // Set specific filter area\n * container.filterArea = new Rectangle(0, 0, 100, 100);\n *\n * // Optimize filter region\n * const screen = app.screen;\n * container.filterArea = new Rectangle(\n * screen.x,\n * screen.y,\n * screen.width,\n * screen.height\n * );\n * ```\n * @see {@link Container#filters} For applying filters\n * @see {@link Rectangle} For area definition\n */\n filterArea?: Rectangle,\n /**\n * todo Needs docs\n * @advanced\n */\n effects?: Effect[];\n /**\n * todo Needs docs.\n * @param {Effect} effect - The effect to add.\n * @ignore\n */\n addEffect(effect: Effect): void;\n /**\n * todo Needs docs.\n * @param {Effect} effect - The effect to remove.\n * @ignore\n */\n removeEffect(effect: Effect): void;\n /**\n * Used to set mask and control mask options on a display object.\n * Allows for more detailed control over masking behavior compared to the mask property.\n * @example\n * ```ts\n * import { Graphics, Sprite } from 'pixi.js';\n *\n * // Create a circular mask\n * const graphics = new Graphics()\n * .beginFill(0xFF3300)\n * .drawCircle(100, 100, 50)\n * .endFill();\n *\n * // Apply mask with options\n * sprite.setMask({\n * mask: graphics,\n * inverse: true, // Create a hole effect\n * });\n *\n * // Clear existing mask\n * sprite.setMask({ mask: null });\n * ```\n * @param {Partial<MaskOptionsAndMask>} options - Configuration options for the mask\n * @see {@link Container#mask} For simple masking\n * @see {@link MaskOptionsAndMask} For full options API\n */\n setMask(options: Partial<MaskOptionsAndMask>): void;\n /**\n * Sets a mask for the displayObject. A mask is an object that limits the visibility of an\n * object to the shape of the mask applied to it.\n *\n * > [!IMPORTANT] In PixiJS a regular mask must be a {@link Graphics} or a {@link Sprite} object.\n * > This allows for much faster masking in canvas as it utilities shape clipping.\n * > Furthermore, a mask of an object must be in the subtree of its parent.\n * > Otherwise, `getLocalBounds` may calculate incorrect bounds, which makes the container's width and height wrong.\n *\n * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.\n * @example\n * ```ts\n * // Apply mask to sprite\n * const sprite = new Sprite(texture);\n * sprite.mask = graphics;\n *\n * // Remove mask\n * sprite.mask = null;\n * ```\n * @see {@link Graphics} For creating mask shapes\n * @see {@link Sprite} For texture-based masks\n * @see {@link Container#setMask} For advanced mask options\n */\n mask: Mask;\n /**\n * Sets the filters for the displayObject.\n * Filters are visual effects that can be applied to any display object and its children.\n *\n * > [!IMPORTANT] This is a WebGL/WebGPU only feature and will be ignored by the canvas renderer.\n * @example\n * ```ts\n * // Add a single filter\n * sprite.filters = new BlurFilter(2);\n *\n * // Apply multiple filters\n * container.filters = [\n * new BlurFilter(2),\n * new ColorMatrixFilter(),\n * ];\n *\n * // Remove filters\n * sprite.filters = null;\n * ```\n * @see {@link Filter} For filter base class\n */\n set filters(value: Filter | Filter[] | null | undefined);\n get filters(): readonly Filter[];\n}\n\n/** @internal */\nexport const effectsMixin: Partial<Container> = {\n _maskEffect: null,\n _maskOptions: {\n inverse: false,\n },\n _filterEffect: null,\n\n effects: [],\n\n _markStructureAsChanged()\n {\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n if (renderGroup)\n {\n renderGroup.structureDidChange = true;\n }\n },\n\n addEffect(effect: Effect)\n {\n const index = this.effects.indexOf(effect);\n\n if (index !== -1) return; // already exists!\n\n this.effects.push(effect);\n\n this.effects.sort((a, b) => a.priority - b.priority);\n\n this._markStructureAsChanged();\n\n // if (this.renderGroup)\n // {\n // this.renderGroup.structureDidChange = true;\n // }\n\n this._updateIsSimple();\n },\n\n removeEffect(effect: Effect)\n {\n const index = this.effects.indexOf(effect);\n\n if (index === -1) return; // already exists!\n\n this.effects.splice(index, 1);\n\n this._markStructureAsChanged();\n\n this._updateIsSimple();\n },\n\n set mask(value: Mask)\n {\n const effect = this._maskEffect;\n\n if (effect?.mask === value) return;\n\n if (effect)\n {\n this.removeEffect(effect);\n\n MaskEffectManager.returnMaskEffect(effect);\n\n this._maskEffect = null;\n }\n\n if (value === null || value === undefined) return;\n\n this._maskEffect = MaskEffectManager.getMaskEffect(value);\n\n this.addEffect(this._maskEffect);\n },\n get mask(): unknown\n {\n return this._maskEffect?.mask;\n },\n\n setMask(options: Partial<MaskOptionsAndMask>)\n {\n this._maskOptions = {\n ...this._maskOptions,\n ...options,\n };\n\n if (options.mask)\n {\n this.mask = options.mask;\n }\n\n this._markStructureAsChanged();\n },\n\n set filters(value: Filter | readonly Filter[] | null | undefined)\n {\n if (!Array.isArray(value) && value) value = ([value] as Filter[]);\n\n const effect = this._filterEffect ||= new FilterEffect();\n\n // Ignore the Filter type\n value = value as Filter[] | null | undefined;\n\n const hasFilters = value?.length > 0;\n const hadFilters = effect.filters?.length > 0;\n\n const didChange = hasFilters !== hadFilters;\n\n // Clone the filters array so we don't freeze the user-input\n value = Array.isArray(value) ? value.slice(0) : value;\n\n // Ensure filters are immutable via filters getter\n effect.filters = Object.freeze(value);\n\n if (didChange)\n {\n if (hasFilters)\n {\n this.addEffect(effect);\n }\n else\n {\n this.removeEffect(effect);\n\n // sets the empty array...\n effect.filters = value ?? null;\n }\n }\n },\n get filters(): readonly Filter[]\n {\n return this._filterEffect?.filters;\n },\n\n set filterArea(value: Rectangle)\n {\n this._filterEffect ||= new FilterEffect();\n\n this._filterEffect.filterArea = value;\n },\n get filterArea(): Rectangle\n {\n return this._filterEffect?.filterArea;\n },\n\n} as Container;\n", "import { deprecation, v8_0_0 } from '../../../utils/logging/deprecation';\n\nimport type { Container } from '../Container';\n\n/** @ignore */\nexport interface FindMixinConstructor\n{\n /**\n * The instance label of the object.\n * @default null\n */\n label?: string;\n}\n\n/**\n * The FindMixin interface provides methods for finding children within a container by their label.\n * It allows for searching for a single child or multiple children with a specific label,\n * either directly or recursively through the container's hierarchy.\n * @category scene\n * @advanced\n */\nexport interface FindMixin extends Required<FindMixinConstructor>\n{\n /**\n * The instance name of the object.\n * @deprecated since 8.0.0\n * @see Container#label\n * @default null\n */\n name: string;\n /**\n * @deprecated since 8.0.0\n * @param {string} label - Instance name.\n * @param {boolean}[deep=false] - Whether to search recursively\n * @returns {Container} The child with the specified name.\n * @see Container#getChildByLabel\n */\n getChildByName(label: RegExp | string, deep?: boolean): Container | null;\n /**\n * Returns the first child in the container with the specified label.\n * Recursive searches are done in a pre-order traversal.\n * @example\n * ```ts\n * // Basic label search\n * const child = container.getChildByLabel('player');\n *\n * // Search with regular expression\n * const enemy = container.getChildByLabel(/enemy-\\d+/);\n *\n * // Deep search through children\n * const deepChild = container.getChildByLabel('powerup', true);\n * ```\n * @param {RegExp|string} label - Instance label to search for\n * @param {boolean} deep - Whether to search recursively through children\n * @returns The first child with the specified label, or null if none found\n * @see {@link Container#getChildrenByLabel} For finding all matches\n * @see {@link Container#label} For setting labels\n */\n getChildByLabel(label: RegExp | string, deep?: boolean): Container | null;\n /**\n * Returns all children in the container with the specified label.\n * Recursive searches are done in a pre-order traversal.\n * @example\n * ```ts\n * // Basic label search\n * const enemies = container.getChildrenByLabel('enemy');\n * // Search with regular expression\n * const powerups = container.getChildrenByLabel(/powerup-\\d+/);\n * // Deep search with collection\n * const buttons = [];\n * container.getChildrenByLabel('button', true, buttons);\n * ```\n * @param {string|RegExp} label - Instance label to search for\n * @param {boolean}[deep=false] - Whether to search recursively through children\n * @param {Container[]} [out=[]] - Optional array to store matching children in\n * @returns An array of children with the specified label\n * @see {@link Container#getChildByLabel} For finding first match\n * @see {@link Container#label} For setting labels\n */\n getChildrenByLabel(label: RegExp | string, deep?: boolean, out?: Container[]): Container[];\n}\n\n/** @internal */\nexport const findMixin: Partial<Container> = {\n label: null,\n\n get name(): string\n {\n // #if _DEBUG\n deprecation(v8_0_0, 'Container.name property has been removed, use Container.label instead');\n // #endif\n\n return this.label;\n },\n set name(value: string)\n {\n // #if _DEBUG\n deprecation(v8_0_0, 'Container.name property has been removed, use Container.label instead');\n // #endif\n\n this.label = value;\n },\n\n getChildByName(name: string, deep = false): Container | null\n {\n return this.getChildByLabel(name, deep);\n },\n\n getChildByLabel(label: string | RegExp, deep = false): Container | null\n {\n const children = this.children;\n\n for (let i = 0; i < children.length; i++)\n {\n const child = children[i];\n\n if (child.label === label || (label instanceof RegExp && label.test(child.label))) return child;\n }\n\n if (deep)\n {\n for (let i = 0; i < children.length; i++)\n {\n const child = children[i];\n const found = child.getChildByLabel(label, true);\n\n if (found)\n {\n return found;\n }\n }\n }\n\n return null;\n },\n\n getChildrenByLabel(label: string | RegExp, deep = false, out = []): Container[]\n {\n const children = this.children;\n\n for (let i = 0; i < children.length; i++)\n {\n const child = children[i];\n\n if (child.label === label || (label instanceof RegExp && label.test(child.label)))\n {\n out.push(child);\n }\n }\n\n if (deep)\n {\n for (let i = 0; i < children.length; i++)\n {\n children[i].getChildrenByLabel(label, true, out);\n }\n }\n\n return out;\n },\n} as Container;\n", "import { Matrix } from '../../../maths/matrix/Matrix';\nimport { Rectangle } from '../../../maths/shapes/Rectangle';\n\n/**\n * A simple axis-aligned bounding box (AABB) data structure used to define rectangular boundaries.\n * Provides a clearer alternative to array-based bounds representation [minX, minY, maxX, maxY].\n * @example\n * ```ts\n * // Create bounds data\n * const bounds: BoundsData = {\n * minX: 0,\n * minY: 0,\n * maxX: 100,\n * maxY: 100\n * };\n *\n * // Calculate dimensions\n * const width = bounds.maxX - bounds.minX;\n * const height = bounds.maxY - bounds.minY;\n *\n * // Check if point is inside\n * const isInside = (x: number, y: number) =>\n * x >= bounds.minX && x <= bounds.maxX &&\n * y >= bounds.minY && y <= bounds.maxY;\n * ```\n * @see {@link Bounds} For full bounds implementation\n * @see {@link Container#getBounds} For getting bounds\n * @category rendering\n * @standard\n */\nexport interface BoundsData\n{\n /** The minimum X coordinate of the bounds */\n minX: number;\n /** The minimum Y coordinate of the bounds */\n minY: number;\n /** The maximum X coordinate of the bounds */\n maxX: number;\n /** The maximum Y coordinate of the bounds */\n maxY: number;\n}\n\nconst defaultMatrix = new Matrix();\n\n// TODO optimisations\n// 1 - get rectangle could use a dirty flag, rather than setting the data each time is called\n// 2- getFrame ALWAYS assumes a matrix, could be optimised to avoid the matrix calculation if not needed\n\n/**\n * A representation of an axis-aligned bounding box (AABB) used for efficient collision detection and culling.\n * Stores minimum and maximum coordinates to define a rectangular boundary.\n * @example\n * ```ts\n * // Create bounds\n * const bounds = new Bounds();\n *\n * // Add a rectangular frame\n * bounds.addFrame(0, 0, 100, 100);\n * console.log(bounds.width, bounds.height); // 100, 100\n *\n * // Transform bounds\n * const matrix = new Matrix()\n * .translate(50, 50)\n * .rotate(Math.PI / 4);\n * bounds.applyMatrix(matrix);\n *\n * // Check point intersection\n * if (bounds.containsPoint(75, 75)) {\n * console.log('Point is inside bounds!');\n * }\n * ```\n * @category rendering\n * @standard\n */\nexport class Bounds\n{\n /**\n * The minimum X coordinate of the bounds.\n * Represents the leftmost edge of the bounding box.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * // Set left edge\n * bounds.minX = 100;\n * ```\n * @default Infinity\n */\n public minX = Infinity;\n\n /**\n * The minimum Y coordinate of the bounds.\n * Represents the topmost edge of the bounding box.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * // Set top edge\n * bounds.minY = 100;\n * ```\n * @default Infinity\n */\n public minY = Infinity;\n\n /**\n * The maximum X coordinate of the bounds.\n * Represents the rightmost edge of the bounding box.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * // Set right edge\n * bounds.maxX = 200;\n * // Get width\n * const width = bounds.maxX - bounds.minX;\n * ```\n * @default -Infinity\n */\n public maxX = -Infinity;\n\n /**\n * The maximum Y coordinate of the bounds.\n * Represents the bottommost edge of the bounding box.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * // Set bottom edge\n * bounds.maxY = 200;\n * // Get height\n * const height = bounds.maxY - bounds.minY;\n * ```\n * @default -Infinity\n */\n public maxY = -Infinity;\n\n /**\n * The transformation matrix applied to this bounds object.\n * Used when calculating bounds with transforms.\n * @example\n * ```ts\n * const bounds = new Bounds();\n *\n * // Apply translation matrix\n * bounds.matrix = new Matrix()\n * .translate(100, 100);\n *\n * // Combine transformations\n * bounds.matrix = new Matrix()\n * .translate(50, 50)\n * .rotate(Math.PI / 4)\n * .scale(2, 2);\n *\n * // Use in bounds calculations\n * bounds.addFrame(0, 0, 100, 100); // Uses current matrix\n * bounds.addFrame(0, 0, 100, 100, customMatrix); // Override matrix\n * ```\n * @advanced\n */\n public matrix = defaultMatrix;\n\n private _rectangle: Rectangle;\n\n /**\n * Creates a new Bounds object.\n * @param minX - The minimum X coordinate of the bounds.\n * @param minY - The minimum Y coordinate of the bounds.\n * @param maxX - The maximum X coordinate of the bounds.\n * @param maxY - The maximum Y coordinate of the bounds.\n */\n constructor(minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity)\n {\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n\n /**\n * Checks if bounds are empty, meaning either width or height is zero or negative.\n * Empty bounds occur when min values exceed max values on either axis.\n * @example\n * ```ts\n * const bounds = new Bounds();\n *\n * // Check if newly created bounds are empty\n * console.log(bounds.isEmpty()); // true, default bounds are empty\n *\n * // Add frame and check again\n * bounds.addFrame(0, 0, 100, 100);\n * console.log(bounds.isEmpty()); // false, bounds now have area\n *\n * // Clear bounds\n * bounds.clear();\n * console.log(bounds.isEmpty()); // true, bounds are empty again\n * ```\n * @returns True if bounds are empty (have no area)\n * @see {@link Bounds#clear} For resetting bounds\n * @see {@link Bounds#isValid} For checking validity\n */\n public isEmpty(): boolean\n {\n return this.minX > this.maxX || this.minY > this.maxY;\n }\n\n /**\n * The bounding rectangle representation of these bounds.\n * Lazily creates and updates a Rectangle instance based on the current bounds.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n *\n * // Get rectangle representation\n * const rect = bounds.rectangle;\n * console.log(rect.x, rect.y, rect.width, rect.height);\n *\n * // Use for hit testing\n * if (bounds.rectangle.contains(mouseX, mouseY)) {\n * console.log('Mouse is inside bounds!');\n * }\n * ```\n * @see {@link Rectangle} For rectangle methods\n * @see {@link Bounds.isEmpty} For bounds validation\n */\n get rectangle(): Rectangle\n {\n if (!this._rectangle)\n {\n this._rectangle = new Rectangle();\n }\n\n const rectangle = this._rectangle;\n\n if (this.minX > this.maxX || this.minY > this.maxY)\n {\n rectangle.x = 0;\n rectangle.y = 0;\n rectangle.width = 0;\n rectangle.height = 0;\n }\n else\n {\n rectangle.copyFromBounds(this);\n }\n\n return rectangle;\n }\n\n /**\n * Clears the bounds and resets all coordinates to their default values.\n * Resets the transformation matrix back to identity.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * console.log(bounds.isEmpty()); // false\n * // Clear the bounds\n * bounds.clear();\n * console.log(bounds.isEmpty()); // true\n * ```\n * @returns This bounds object for chaining\n */\n public clear(): this\n {\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = -Infinity;\n this.maxY = -Infinity;\n\n this.matrix = defaultMatrix;\n\n return this;\n }\n\n /**\n * Sets the bounds directly using coordinate values.\n * Provides a way to set all bounds values at once.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * bounds.set(0, 0, 100, 100);\n * ```\n * @param x0 - Left X coordinate of frame\n * @param y0 - Top Y coordinate of frame\n * @param x1 - Right X coordinate of frame\n * @param y1 - Bottom Y coordinate of frame\n * @see {@link Bounds#addFrame} For matrix-aware bounds setting\n * @see {@link Bounds#clear} For resetting bounds\n */\n public set(x0: number, y0: number, x1: number, y1: number)\n {\n this.minX = x0;\n this.minY = y0;\n this.maxX = x1;\n this.maxY = y1;\n }\n\n /**\n * Adds a rectangular frame to the bounds, optionally transformed by a matrix.\n * Updates the bounds to encompass the new frame coordinates.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * bounds.addFrame(0, 0, 100, 100);\n *\n * // Add transformed frame\n * const matrix = new Matrix()\n * .translate(50, 50)\n * .rotate(Math.PI / 4);\n * bounds.addFrame(0, 0, 100, 100, matrix);\n * ```\n * @param x0 - Left X coordinate of frame\n * @param y0 - Top Y coordinate of frame\n * @param x1 - Right X coordinate of frame\n * @param y1 - Bottom Y coordinate of frame\n * @param matrix - Optional transformation matrix\n * @see {@link Bounds#addRect} For adding Rectangle objects\n * @see {@link Bounds#addBounds} For adding other Bounds\n */\n public addFrame(x0: number, y0: number, x1: number, y1: number, matrix?: Matrix): void\n {\n matrix ||= this.matrix;\n\n const a = matrix.a;\n const b = matrix.b;\n const c = matrix.c;\n const d = matrix.d;\n const tx = matrix.tx;\n const ty = matrix.ty;\n\n let minX = this.minX;\n let minY = this.minY;\n let maxX = this.maxX;\n let maxY = this.maxY;\n\n let x = (a * x0) + (c * y0) + tx;\n let y = (b * x0) + (d * y0) + ty;\n\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n\n x = (a * x1) + (c * y0) + tx;\n y = (b * x1) + (d * y0) + ty;\n\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n\n x = (a * x0) + (c * y1) + tx;\n y = (b * x0) + (d * y1) + ty;\n\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n\n x = (a * x1) + (c * y1) + tx;\n y = (b * x1) + (d * y1) + ty;\n\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n\n /**\n * Adds a rectangle to the bounds, optionally transformed by a matrix.\n * Updates the bounds to encompass the given rectangle.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * // Add simple rectangle\n * const rect = new Rectangle(0, 0, 100, 100);\n * bounds.addRect(rect);\n *\n * // Add transformed rectangle\n * const matrix = new Matrix()\n * .translate(50, 50)\n * .rotate(Math.PI / 4);\n * bounds.addRect(rect, matrix);\n * ```\n * @param rect - The rectangle to be added\n * @param matrix - Optional transformation matrix\n * @see {@link Bounds#addFrame} For adding raw coordinates\n * @see {@link Bounds#addBounds} For adding other bounds\n */\n public addRect(rect: Rectangle, matrix?: Matrix)\n {\n this.addFrame(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, matrix);\n }\n\n /**\n * Adds another bounds object to this one, optionally transformed by a matrix.\n * Expands the bounds to include the given bounds' area.\n * @example\n * ```ts\n * const bounds = new Bounds();\n *\n * // Add child bounds\n * const childBounds = sprite.getBounds();\n * bounds.addBounds(childBounds);\n *\n * // Add transformed bounds\n * const matrix = new Matrix()\n * .scale(2, 2);\n * bounds.addBounds(childBounds, matrix);\n * ```\n * @param bounds - The bounds to be added\n * @param matrix - Optional transformation matrix\n * @see {@link Bounds#addFrame} For adding raw coordinates\n * @see {@link Bounds#addRect} For adding rectangles\n */\n public addBounds(bounds: BoundsData, matrix?: Matrix)\n {\n this.addFrame(bounds.minX, bounds.minY, bounds.maxX, bounds.maxY, matrix);\n }\n\n /**\n * Adds other Bounds as a mask, creating an intersection of the two bounds.\n * Only keeps the overlapping region between current bounds and mask bounds.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Create mask bounds\n * const mask = new Bounds();\n * mask.addFrame(50, 50, 150, 150);\n * // Apply mask - results in bounds of (50,50,100,100)\n * bounds.addBoundsMask(mask);\n * ```\n * @param mask - The Bounds to use as a mask\n * @see {@link Bounds#addBounds} For union operation\n * @see {@link Bounds#fit} For fitting to rectangle\n */\n public addBoundsMask(mask: Bounds): void\n {\n this.minX = this.minX > mask.minX ? this.minX : mask.minX;\n this.minY = this.minY > mask.minY ? this.minY : mask.minY;\n this.maxX = this.maxX < mask.maxX ? this.maxX : mask.maxX;\n this.maxY = this.maxY < mask.maxY ? this.maxY : mask.maxY;\n }\n\n /**\n * Applies a transformation matrix to the bounds, updating its coordinates.\n * Transforms all corners of the bounds using the given matrix.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Apply translation\n * const translateMatrix = new Matrix()\n * .translate(50, 50);\n * bounds.applyMatrix(translateMatrix);\n * ```\n * @param matrix - The matrix to apply to the bounds\n * @see {@link Matrix} For matrix operations\n * @see {@link Bounds#addFrame} For adding transformed frames\n */\n public applyMatrix(matrix: Matrix): void\n {\n const minX = this.minX;\n const minY = this.minY;\n const maxX = this.maxX;\n const maxY = this.maxY;\n\n // multiple bounds by matrix\n const { a, b, c, d, tx, ty } = matrix;\n\n let x = (a * minX) + (c * minY) + tx;\n let y = (b * minX) + (d * minY) + ty;\n\n this.minX = x;\n this.minY = y;\n this.maxX = x;\n this.maxY = y;\n\n x = (a * maxX) + (c * minY) + tx;\n y = (b * maxX) + (d * minY) + ty;\n this.minX = x < this.minX ? x : this.minX;\n this.minY = y < this.minY ? y : this.minY;\n this.maxX = x > this.maxX ? x : this.maxX;\n this.maxY = y > this.maxY ? y : this.maxY;\n\n x = (a * minX) + (c * maxY) + tx;\n y = (b * minX) + (d * maxY) + ty;\n this.minX = x < this.minX ? x : this.minX;\n this.minY = y < this.minY ? y : this.minY;\n this.maxX = x > this.maxX ? x : this.maxX;\n this.maxY = y > this.maxY ? y : this.maxY;\n\n x = (a * maxX) + (c * maxY) + tx;\n y = (b * maxX) + (d * maxY) + ty;\n this.minX = x < this.minX ? x : this.minX;\n this.minY = y < this.minY ? y : this.minY;\n this.maxX = x > this.maxX ? x : this.maxX;\n this.maxY = y > this.maxY ? y : this.maxY;\n }\n\n /**\n * Resizes the bounds object to fit within the given rectangle.\n * Clips the bounds if they extend beyond the rectangle's edges.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 200, 200);\n * // Fit within viewport\n * const viewport = new Rectangle(50, 50, 100, 100);\n * bounds.fit(viewport);\n * // bounds are now (50, 50, 150, 150)\n * ```\n * @param rect - The rectangle to fit within\n * @returns This bounds object for chaining\n * @see {@link Bounds#addBoundsMask} For intersection\n * @see {@link Bounds#pad} For expanding bounds\n */\n public fit(rect: Rectangle): this\n {\n if (this.minX < rect.left) this.minX = rect.left;\n if (this.maxX > rect.right) this.maxX = rect.right;\n\n if (this.minY < rect.top) this.minY = rect.top;\n if (this.maxY > rect.bottom) this.maxY = rect.bottom;\n\n return this;\n }\n\n /**\n * Resizes the bounds object to include the given bounds.\n * Similar to fit() but works with raw coordinate values instead of a Rectangle.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 200, 200);\n * // Fit to specific coordinates\n * bounds.fitBounds(50, 150, 50, 150);\n * // bounds are now (50, 50, 150, 150)\n * ```\n * @param left - The left value of the bounds\n * @param right - The right value of the bounds\n * @param top - The top value of the bounds\n * @param bottom - The bottom value of the bounds\n * @returns This bounds object for chaining\n * @see {@link Bounds#fit} For fitting to Rectangle\n * @see {@link Bounds#addBoundsMask} For intersection\n */\n public fitBounds(left: number, right: number, top: number, bottom: number): this\n {\n if (this.minX < left) this.minX = left;\n if (this.maxX > right) this.maxX = right;\n\n if (this.minY < top) this.minY = top;\n if (this.maxY > bottom) this.maxY = bottom;\n\n return this;\n }\n\n /**\n * Pads bounds object, making it grow in all directions.\n * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n *\n * // Add equal padding\n * bounds.pad(10);\n * // bounds are now (-10, -10, 110, 110)\n *\n * // Add different padding for x and y\n * bounds.pad(20, 10);\n * // bounds are now (-30, -20, 130, 120)\n * ```\n * @param paddingX - The horizontal padding amount\n * @param paddingY - The vertical padding amount\n * @returns This bounds object for chaining\n * @see {@link Bounds#fit} For constraining bounds\n * @see {@link Bounds#scale} For uniform scaling\n */\n public pad(paddingX: number, paddingY: number = paddingX): this\n {\n this.minX -= paddingX;\n this.maxX += paddingX;\n\n this.minY -= paddingY;\n this.maxY += paddingY;\n\n return this;\n }\n\n /**\n * Ceils the bounds by rounding up max values and rounding down min values.\n * Useful for pixel-perfect calculations and avoiding fractional pixels.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * bounds.set(10.2, 10.9, 50.1, 50.8);\n *\n * // Round to whole pixels\n * bounds.ceil();\n * // bounds are now (10, 10, 51, 51)\n * ```\n * @returns This bounds object for chaining\n * @see {@link Bounds#scale} For size adjustments\n * @see {@link Bounds#fit} For constraining bounds\n */\n public ceil(): this\n {\n this.minX = Math.floor(this.minX);\n this.minY = Math.floor(this.minY);\n this.maxX = Math.ceil(this.maxX);\n this.maxY = Math.ceil(this.maxY);\n\n return this;\n }\n\n /**\n * Creates a new Bounds instance with the same values.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n *\n * // Create a copy\n * const copy = bounds.clone();\n *\n * // Original and copy are independent\n * bounds.pad(10);\n * console.log(copy.width === bounds.width); // false\n * ```\n * @returns A new Bounds instance with the same values\n * @see {@link Bounds#copyFrom} For reusing existing bounds\n */\n public clone(): Bounds\n {\n return new Bounds(this.minX, this.minY, this.maxX, this.maxY);\n }\n\n /**\n * Scales the bounds by the given values, adjusting all edges proportionally.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n *\n * // Scale uniformly\n * bounds.scale(2);\n * // bounds are now (0, 0, 200, 200)\n *\n * // Scale non-uniformly\n * bounds.scale(0.5, 2);\n * // bounds are now (0, 0, 100, 400)\n * ```\n * @param x - The X value to scale by\n * @param y - The Y value to scale by (defaults to x)\n * @returns This bounds object for chaining\n * @see {@link Bounds#pad} For adding padding\n * @see {@link Bounds#fit} For constraining size\n */\n public scale(x: number, y: number = x): this\n {\n this.minX *= x;\n this.minY *= y;\n this.maxX *= x;\n this.maxY *= y;\n\n return this;\n }\n\n /**\n * The x position of the bounds in local space.\n * Setting this value will move the bounds while maintaining its width.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Get x position\n * console.log(bounds.x); // 0\n *\n * // Move bounds horizontally\n * bounds.x = 50;\n * console.log(bounds.minX, bounds.maxX); // 50, 150\n *\n * // Width stays the same\n * console.log(bounds.width); // Still 100\n * ```\n */\n get x(): number\n {\n return this.minX;\n }\n set x(value: number)\n {\n const width = this.maxX - this.minX;\n\n this.minX = value;\n this.maxX = value + width;\n }\n\n /**\n * The y position of the bounds in local space.\n * Setting this value will move the bounds while maintaining its height.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Get y position\n * console.log(bounds.y); // 0\n *\n * // Move bounds vertically\n * bounds.y = 50;\n * console.log(bounds.minY, bounds.maxY); // 50, 150\n *\n * // Height stays the same\n * console.log(bounds.height); // Still 100\n * ```\n */\n get y(): number\n {\n return this.minY;\n }\n\n set y(value: number)\n {\n const height = this.maxY - this.minY;\n\n this.minY = value;\n this.maxY = value + height;\n }\n\n /**\n * The width value of the bounds.\n * Represents the distance between minX and maxX coordinates.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Get width\n * console.log(bounds.width); // 100\n * // Resize width\n * bounds.width = 200;\n * console.log(bounds.maxX - bounds.minX); // 200\n * ```\n */\n get width(): number\n {\n return this.maxX - this.minX;\n }\n\n set width(value: number)\n {\n this.maxX = this.minX + value;\n }\n\n /**\n * The height value of the bounds.\n * Represents the distance between minY and maxY coordinates.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Get height\n * console.log(bounds.height); // 100\n * // Resize height\n * bounds.height = 150;\n * console.log(bounds.maxY - bounds.minY); // 150\n * ```\n */\n get height(): number\n {\n return this.maxY - this.minY;\n }\n\n set height(value: number)\n {\n this.maxY = this.minY + value;\n }\n\n /**\n * The left edge coordinate of the bounds.\n * Alias for minX.\n * @example\n * ```ts\n * const bounds = new Bounds(50, 0, 150, 100);\n * console.log(bounds.left); // 50\n * console.log(bounds.left === bounds.minX); // true\n * ```\n * @readonly\n */\n get left(): number\n {\n return this.minX;\n }\n\n /**\n * The right edge coordinate of the bounds.\n * Alias for maxX.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * console.log(bounds.right); // 100\n * console.log(bounds.right === bounds.maxX); // true\n * ```\n * @readonly\n */\n get right(): number\n {\n return this.maxX;\n }\n\n /**\n * The top edge coordinate of the bounds.\n * Alias for minY.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 25, 100, 125);\n * console.log(bounds.top); // 25\n * console.log(bounds.top === bounds.minY); // true\n * ```\n * @readonly\n */\n get top(): number\n {\n return this.minY;\n }\n\n /**\n * The bottom edge coordinate of the bounds.\n * Alias for maxY.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 200);\n * console.log(bounds.bottom); // 200\n * console.log(bounds.bottom === bounds.maxY); // true\n * ```\n * @readonly\n */\n get bottom(): number\n {\n return this.maxY;\n }\n\n /**\n * Whether the bounds has positive width and height.\n * Checks if both dimensions are greater than zero.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Check if bounds are positive\n * console.log(bounds.isPositive); // true\n *\n * // Negative bounds\n * bounds.maxX = bounds.minX;\n * console.log(bounds.isPositive); // false, width is 0\n * ```\n * @readonly\n * @see {@link Bounds#isEmpty} For checking empty state\n * @see {@link Bounds#isValid} For checking validity\n */\n get isPositive(): boolean\n {\n return (this.maxX - this.minX > 0) && (this.maxY - this.minY > 0);\n }\n\n /**\n * Whether the bounds has valid coordinates.\n * Checks if the bounds has been initialized with real values.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * console.log(bounds.isValid); // false, default state\n *\n * // Set valid bounds\n * bounds.addFrame(0, 0, 100, 100);\n * console.log(bounds.isValid); // true\n * ```\n * @readonly\n * @see {@link Bounds#isEmpty} For checking empty state\n * @see {@link Bounds#isPositive} For checking dimensions\n */\n get isValid(): boolean\n {\n return (this.minX + this.minY !== Infinity);\n }\n\n /**\n * Adds vertices from a Float32Array to the bounds, optionally transformed by a matrix.\n * Used for efficiently updating bounds from raw vertex data.\n * @example\n * ```ts\n * const bounds = new Bounds();\n *\n * // Add vertices from geometry\n * const vertices = new Float32Array([\n * 0, 0, // Vertex 1\n * 100, 0, // Vertex 2\n * 100, 100 // Vertex 3\n * ]);\n * bounds.addVertexData(vertices, 0, 6);\n *\n * // Add transformed vertices\n * const matrix = new Matrix()\n * .translate(50, 50)\n * .rotate(Math.PI / 4);\n * bounds.addVertexData(vertices, 0, 6, matrix);\n *\n * // Add subset of vertices\n * bounds.addVertexData(vertices, 2, 4); // Only second vertex\n * ```\n * @param vertexData - The array of vertices to add\n * @param beginOffset - Starting index in the vertex array\n * @param endOffset - Ending index in the vertex array (excluded)\n * @param matrix - Optional transformation matrix\n * @see {@link Bounds#addFrame} For adding rectangular frames\n * @see {@link Matrix} For transformation details\n */\n public addVertexData(vertexData: Float32Array, beginOffset: number, endOffset: number, matrix?: Matrix): void\n {\n let minX = this.minX;\n let minY = this.minY;\n let maxX = this.maxX;\n let maxY = this.maxY;\n\n matrix ||= this.matrix;\n\n const a = matrix.a;\n const b = matrix.b;\n const c = matrix.c;\n const d = matrix.d;\n const tx = matrix.tx;\n const ty = matrix.ty;\n\n for (let i = beginOffset; i < endOffset; i += 2)\n {\n const localX = vertexData[i];\n const localY = vertexData[i + 1];\n\n const x = (a * localX) + (c * localY) + tx;\n const y = (b * localX) + (d * localY) + ty;\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n }\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n\n /**\n * Checks if a point is contained within the bounds.\n * Returns true if the point's coordinates fall within the bounds' area.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Basic point check\n * console.log(bounds.containsPoint(50, 50)); // true\n * console.log(bounds.containsPoint(150, 150)); // false\n *\n * // Check edges\n * console.log(bounds.containsPoint(0, 0)); // true, includes edges\n * console.log(bounds.containsPoint(100, 100)); // true, includes edges\n * ```\n * @param x - x coordinate to check\n * @param y - y coordinate to check\n * @returns True if the point is inside the bounds\n * @see {@link Bounds#isPositive} For valid bounds check\n * @see {@link Bounds#rectangle} For Rectangle representation\n */\n public containsPoint(x: number, y: number): boolean\n {\n if (this.minX <= x && this.minY <= y && this.maxX >= x && this.maxY >= y)\n {\n return true;\n }\n\n return false;\n }\n\n /**\n * Returns a string representation of the bounds.\n * Useful for debugging and logging bounds information.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * console.log(bounds.toString()); // \"[pixi.js:Bounds minX=0 minY=0 maxX=100 maxY=100 width=100 height=100]\"\n * ```\n * @returns A string describing the bounds\n * @see {@link Bounds#copyFrom} For copying bounds\n * @see {@link Bounds#clone} For creating a new instance\n */\n public toString(): string\n {\n // eslint-disable-next-line max-len\n return `[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`;\n }\n\n /**\n * Copies the bounds from another bounds object.\n * Useful for reusing bounds objects and avoiding allocations.\n * @example\n * ```ts\n * const sourceBounds = new Bounds(0, 0, 100, 100);\n * // Copy bounds\n * const targetBounds = new Bounds();\n * targetBounds.copyFrom(sourceBounds);\n * ```\n * @param bounds - The bounds to copy from\n * @returns This bounds object for chaining\n * @see {@link Bounds#clone} For creating new instances\n */\n public copyFrom(bounds: Bounds): this\n {\n this.minX = bounds.minX;\n this.minY = bounds.minY;\n this.maxX = bounds.maxX;\n this.maxY = bounds.maxY;\n\n return this;\n }\n}\n\n", "import { Matrix } from '../../../../maths/matrix/Matrix';\nimport { BigPool } from '../../../../utils/pool/PoolGroup';\nimport { Bounds } from '../Bounds';\n\nimport type { PoolItem } from '../../../../utils/pool/Pool';\n\ntype MatrixPoolItem = Matrix & PoolItem;\ntype BoundsPoolItem = Bounds & PoolItem;\n/** @internal */\nexport const matrixPool = BigPool.getPool<MatrixPoolItem>(Matrix);\n/** @internal */\nexport const boundsPool = BigPool.getPool<BoundsPoolItem>(Bounds);\n", "import { Matrix } from '../../../maths/matrix/Matrix';\nimport { type Renderable } from '../../../rendering/renderers/shared/Renderable';\nimport { type RenderLayer } from '../../layers/RenderLayer';\nimport { Bounds } from '../bounds/Bounds';\nimport { boundsPool } from '../bounds/utils/matrixAndBoundsPool';\n\nimport type { Container } from '../Container';\n\nconst tempMatrix = new Matrix();\n\n/**\n * Interface for the GetFastGlobalBoundsMixin, which provides methods to compute\n * an approximate global bounding box for a container and its children.\n * @category scene\n * @advanced\n */\nexport interface GetFastGlobalBoundsMixin\n{\n /**\n * Computes an approximate global bounding box for the container and its children.\n * This method is optimized for speed by using axis-aligned bounding boxes (AABBs),\n * and uses the last render results from when it updated the transforms. This function does not update them.\n * which may result in slightly larger bounds but never smaller than the actual bounds.\n *\n * for accurate (but less performant) results use `container.getGlobalBounds`\n * @param {boolean} [factorRenderLayers] - A flag indicating whether to consider render layers in the calculation.\n * @param {Bounds} [bounds] - The output bounds object to store the result. If not provided, a new one is created.\n * @returns {Bounds} The computed bounds.\n * @advanced\n */\n getFastGlobalBounds(factorRenderLayers?: boolean, bounds?: Bounds): Bounds;\n\n /**\n * Recursively calculates the global bounds for the container and its children.\n * This method is used internally by getFastGlobalBounds to traverse the scene graph.\n * @param {boolean} factorRenderLayers - A flag indicating whether to consider render layers in the calculation.\n * @param {Bounds} bounds - The bounds object to update with the calculated values.\n * @param {RenderLayer} currentLayer - The current render layer being processed.\n * @internal\n */\n _getGlobalBoundsRecursive(\n factorRenderLayers: boolean,\n bounds: Bounds,\n currentLayer: RenderLayer,\n ): void;\n}\n\n/**\n * Mixin providing the implementation of the GetFastGlobalBoundsMixin interface.\n * It includes methods to compute and recursively calculate global bounds for containers.\n * @internal\n */\nexport const getFastGlobalBoundsMixin: Partial<Container> = {\n getFastGlobalBounds(factorRenderLayers?: boolean, bounds?: Bounds): Bounds\n {\n bounds ||= new Bounds();\n\n // Initialize the bounds for fresh calculations.\n bounds.clear();\n\n // Calculate bounds recursively, starting from the current container.\n this._getGlobalBoundsRecursive(!!factorRenderLayers, bounds, this.parentRenderLayer);\n\n // Validate the calculated bounds, resetting if invalid.\n if (!bounds.isValid)\n {\n bounds.set(0, 0, 0, 0);\n }\n\n // Apply the world transformation to the bounds.\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n bounds.applyMatrix(renderGroup.worldTransform);\n\n return bounds;\n },\n\n _getGlobalBoundsRecursive(\n factorRenderLayers: boolean,\n bounds: Bounds,\n currentLayer: RenderLayer,\n )\n {\n let localBounds = bounds;\n\n // Skip if the container is not in the current render layer when factoring render layers.\n if (factorRenderLayers && this.parentRenderLayer && this.parentRenderLayer !== currentLayer) return;\n\n // Skip if the container is not fully visible or not measurable.\n if (this.localDisplayStatus !== 0b111 || (!this.measurable))\n {\n return;\n }\n\n // Determine if effects need to be managed, requiring separate bounds handling.\n const manageEffects = !!this.effects.length;\n\n // Use a temporary bounds object if the container is a render group or has effects.\n if (this.renderGroup || manageEffects)\n {\n localBounds = boundsPool.get().clear();\n }\n\n // Add the container's own bounds area to the bounds if it exists.\n if (this.boundsArea)\n {\n bounds.addRect(this.boundsArea, this.worldTransform);\n }\n else\n {\n // If the container is renderable, add its bounds to the local bounds.\n if (this.renderPipeId)\n {\n const viewBounds = (this as Renderable).bounds;\n\n localBounds.addFrame(\n viewBounds.minX,\n viewBounds.minY,\n viewBounds.maxX,\n viewBounds.maxY,\n this.groupTransform\n );\n }\n\n // Recursively process each child to include their bounds.\n const children = this.children;\n\n for (let i = 0; i < children.length; i++)\n {\n children[i]._getGlobalBoundsRecursive(factorRenderLayers, localBounds, currentLayer);\n }\n }\n\n // If effects are managed, apply them to the bounds.\n if (manageEffects)\n {\n let advanced = false;\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n // Apply each effect that modifies bounds.\n for (let i = 0; i < this.effects.length; i++)\n {\n if (this.effects[i].addBounds)\n {\n if (!advanced)\n {\n advanced = true;\n localBounds.applyMatrix(renderGroup.worldTransform);\n }\n this.effects[i].addBounds(localBounds, true);\n }\n }\n\n // Adjust bounds back to the local coordinate space if advanced bounds were calculated.\n if (advanced)\n {\n localBounds.applyMatrix(renderGroup.worldTransform.copyTo(tempMatrix).invert());\n }\n\n // Add the local bounds to the final bounds and return the temporary bounds object.\n bounds.addBounds(localBounds);\n boundsPool.return(localBounds);\n }\n else if (this.renderGroup)\n {\n // If the container is a render group, add its local bounds to the final bounds.\n bounds.addBounds(localBounds, this.relativeGroupTransform);\n boundsPool.return(localBounds);\n }\n }\n\n} as Container;\n", "import { Matrix } from '../../../maths/matrix/Matrix';\nimport { boundsPool, matrixPool } from './utils/matrixAndBoundsPool';\n\nimport type { Renderable } from '../../../rendering/renderers/shared/Renderable';\nimport type { Container } from '../Container';\nimport type { Bounds } from './Bounds';\n\n/**\n * Gets the global bounds of a container, including all its children\n * @param target - The target container to get the bounds from\n * @param skipUpdateTransform - If true, the transform will not be updated before calculating bounds.\n * @param bounds - The output bounds object.\n * @returns The bounds.\n * @internal\n */\nexport function getGlobalBounds(target: Container, skipUpdateTransform: boolean, bounds: Bounds): Bounds\n{\n bounds.clear();\n\n let parentTransform;\n let pooledMatrix;\n\n if (target.parent)\n {\n if (!skipUpdateTransform)\n {\n pooledMatrix = matrixPool.get().identity();\n parentTransform = updateTransformBackwards(target, pooledMatrix);\n }\n else\n {\n parentTransform = target.parent.worldTransform;\n }\n }\n else\n {\n parentTransform = Matrix.IDENTITY;\n }\n\n // then collect them...\n\n _getGlobalBounds(target, bounds, parentTransform, skipUpdateTransform);\n\n if (pooledMatrix)\n {\n matrixPool.return(pooledMatrix);\n }\n\n if (!bounds.isValid)\n {\n bounds.set(0, 0, 0, 0);\n }\n\n return bounds;\n}\n\nfunction _getGlobalBounds(\n target: Container,\n bounds: Bounds,\n parentTransform: Matrix,\n skipUpdateTransform: boolean,\n): void\n{\n if (!target.visible || !target.measurable) return;\n\n let worldTransform: Matrix;\n\n if (!skipUpdateTransform)\n {\n target.updateLocalTransform();\n\n worldTransform = matrixPool.get();\n\n worldTransform.appendFrom(target.localTransform, parentTransform);\n }\n else\n {\n worldTransform = target.worldTransform;\n }\n\n const parentBounds = bounds;\n const preserveBounds = !!target.effects.length;\n\n if (preserveBounds)\n {\n bounds = boundsPool.get().clear();\n }\n\n if (target.boundsArea)\n {\n bounds.addRect(target.boundsArea, worldTransform);\n }\n else\n {\n const renderableBounds = (target as Renderable).bounds;\n\n if (renderableBounds && !renderableBounds.isEmpty())\n {\n // save a copy\n bounds.matrix = worldTransform;\n bounds.addBounds(renderableBounds);\n }\n\n for (let i = 0; i < target.children.length; i++)\n {\n _getGlobalBounds(target.children[i], bounds, worldTransform, skipUpdateTransform);\n }\n }\n\n if (preserveBounds)\n {\n for (let i = 0; i < target.effects.length; i++)\n {\n target.effects[i].addBounds?.(bounds);\n }\n\n parentBounds.addBounds(bounds, Matrix.IDENTITY);\n\n boundsPool.return(bounds);\n }\n\n if (!skipUpdateTransform)\n {\n matrixPool.return(worldTransform);\n }\n}\n\n/**\n * @param target\n * @param parentTransform\n * @internal\n */\nexport function updateTransformBackwards(target: Container, parentTransform: Matrix)\n{\n const parent = target.parent;\n\n if (parent)\n {\n updateTransformBackwards(parent, parentTransform);\n\n parent.updateLocalTransform();\n\n parentTransform.append(parent.localTransform);\n }\n\n return parentTransform;\n}\n", "/**\n * @param color1\n * @param color2\n * @internal\n */\nexport function multiplyHexColors(color1: number, color2: number): number\n{\n if (color1 === 0xFFFFFF || !color2) return color2;\n if (color2 === 0xFFFFFF || !color1) return color1;\n\n const r1 = (color1 >> 16) & 0xFF;\n const g1 = (color1 >> 8) & 0xFF;\n const b1 = color1 & 0xFF;\n\n const r2 = (color2 >> 16) & 0xFF;\n const g2 = (color2 >> 8) & 0xFF;\n const b2 = color2 & 0xFF;\n\n const r = ((r1 * r2) / 255) | 0;\n const g = ((g1 * g2) / 255) | 0;\n const b = ((b1 * b2) / 255) | 0;\n\n return (r << 16) + (g << 8) + b;\n}\n", "import { multiplyHexColors } from './multiplyHexColors';\n\nconst WHITE_BGR = 0xFFFFFF;\n\n/**\n * @param localBGRColor\n * @param parentBGRColor\n * @internal\n */\nexport function multiplyColors(localBGRColor: number, parentBGRColor: number)\n{\n if (localBGRColor === WHITE_BGR)\n {\n return parentBGRColor;\n }\n\n if (parentBGRColor === WHITE_BGR)\n {\n return localBGRColor;\n }\n\n return multiplyHexColors(localBGRColor, parentBGRColor);\n}\n", "import { Matrix } from '../../../maths/matrix/Matrix';\nimport { updateTransformBackwards } from '../bounds/getGlobalBounds';\nimport { matrixPool } from '../bounds/utils/matrixAndBoundsPool';\nimport { multiplyColors } from '../utils/multiplyColors';\n\nimport type { Container } from '../Container';\n\n/**\n * Converts a color from BGR format to RGB format.\n * @param color - The color in BGR format (0xBBGGRR).\n * @returns The color in RGB format (0xRRGGBB).\n * @category utils\n * @internal\n */\nexport function bgr2rgb(color: number): number\n{\n return ((color & 0xFF) << 16) + (color & 0xFF00) + ((color >> 16) & 0xFF);\n}\n\n/**\n * Interface for a mixin that provides methods to retrieve global properties of a container.\n * This mixin allows you to get the global alpha, transform matrix, and tint color of a container,\n * taking into account its parent containers and render groups.\n * It includes methods to optimize performance by using cached values when available.\n * @category scene\n * @advanced\n */\nexport interface GetGlobalMixin\n{\n /**\n * Returns the global (compound) alpha of the container within the scene.\n * @param {boolean} skipUpdate - Performance optimization flag:\n * - If false (default): Recalculates the entire alpha chain through parents for accuracy\n * - If true: Uses cached worldAlpha from the last render pass for better performance\n * @returns The resulting alpha value (between 0 and 1)\n * @example\n * ```ts\n * // Accurate but slower - recalculates entire alpha chain\n * const preciseAlpha = container.getGlobalAlpha();\n *\n * // Faster but may be outdated - uses cached alpha\n * const cachedAlpha = container.getGlobalAlpha(true);\n * ```\n */\n getGlobalAlpha(skipUpdate?: boolean): number;\n /**\n * Returns the global transform matrix of the container within the scene.\n * @param {Matrix} matrix - Optional matrix to store the result. If not provided, a new Matrix will be created.\n * @param {boolean} skipUpdate - Performance optimization flag:\n * - If false (default): Recalculates the entire transform chain for accuracy\n * - If true: Uses cached worldTransform from the last render pass for better performance\n * @returns The resulting transformation matrix (either the input matrix or a new one)\n * @example\n * ```ts\n * // Accurate but slower - recalculates entire transform chain\n * const preciseTransform = container.getGlobalTransform();\n *\n * // Faster but may be outdated - uses cached transform\n * const cachedTransform = container.getGlobalTransform(undefined, true);\n *\n * // Reuse existing matrix\n * const existingMatrix = new Matrix();\n * container.getGlobalTransform(existingMatrix);\n * ```\n */\n getGlobalTransform(matrix?: Matrix, skipUpdate?: boolean): Matrix;\n /**\n * Returns the global (compound) tint color of the container within the scene.\n * @param {boolean} skipUpdate - Performance optimization flag:\n * - If false (default): Recalculates the entire tint chain through parents for accuracy\n * - If true: Uses cached worldColor from the last render pass for better performance\n * @returns The resulting tint color as a 24-bit RGB number (0xRRGGBB)\n * @example\n * ```ts\n * // Accurate but slower - recalculates entire tint chain\n * const preciseTint = container.getGlobalTint();\n *\n * // Faster but may be outdated - uses cached tint\n * const cachedTint = container.getGlobalTint(true);\n * ```\n */\n getGlobalTint(skipUpdate?: boolean): number;\n}\n\n/** @internal */\nexport const getGlobalMixin: Partial<Container> = {\n getGlobalAlpha(skipUpdate?: boolean): number\n {\n if (skipUpdate)\n {\n if (this.renderGroup)\n {\n return this.renderGroup.worldAlpha;\n }\n\n if (this.parentRenderGroup)\n {\n return this.parentRenderGroup.worldAlpha * this.alpha;\n }\n\n return this.alpha;\n }\n\n let alpha = this.alpha;\n let current = this.parent;\n\n while (current)\n {\n alpha *= current.alpha;\n current = current.parent;\n }\n\n return alpha;\n },\n getGlobalTransform(matrix = new Matrix(), skipUpdate?: boolean): Matrix\n {\n if (skipUpdate)\n {\n return matrix.copyFrom(this.worldTransform);\n }\n\n this.updateLocalTransform();\n\n const parentTransform = updateTransformBackwards(this, matrixPool.get().identity());\n\n matrix.appendFrom(this.localTransform, parentTransform);\n matrixPool.return(parentTransform);\n\n return matrix;\n },\n getGlobalTint(skipUpdate?: boolean): number\n {\n if (skipUpdate)\n {\n if (this.renderGroup)\n {\n return bgr2rgb(this.renderGroup.worldColor);\n }\n\n if (this.parentRenderGroup)\n {\n return bgr2rgb(\n multiplyColors(this.localColor, this.parentRenderGroup.worldColor)\n );\n }\n\n return this.tint;\n }\n\n let color = this.localColor;\n let parent = this.parent;\n\n while (parent)\n {\n color = multiplyColors(color, parent.localColor);\n parent = parent.parent;\n }\n\n return bgr2rgb(color);\n }\n\n} as Container;\n", "import { Matrix } from '../../../maths/matrix/Matrix';\nimport { boundsPool, matrixPool } from './utils/matrixAndBoundsPool';\n\nimport type { Renderable } from '../../../rendering/renderers/shared/Renderable';\nimport type { Container } from '../Container';\nimport type { Bounds } from './Bounds';\n\n/**\n * @param target\n * @param bounds\n * @param relativeMatrix\n * @internal\n */\nexport function getLocalBounds(target: Container, bounds: Bounds, relativeMatrix?: Matrix): Bounds\n{\n bounds.clear();\n\n relativeMatrix ||= Matrix.IDENTITY;\n\n _getLocalBounds(target, bounds, relativeMatrix, target, true);\n\n if (!bounds.isValid)\n {\n bounds.set(0, 0, 0, 0);\n }\n\n return bounds;\n}\n\nfunction _getLocalBounds(\n target: Container,\n bounds: Bounds,\n parentTransform: Matrix,\n rootContainer: Container,\n isRoot: boolean\n): void\n{\n let relativeTransform: Matrix;\n\n if (!isRoot)\n {\n if (!target.visible || !target.measurable) return;\n\n target.updateLocalTransform();\n\n const localTransform = target.localTransform;\n\n relativeTransform = matrixPool.get();\n relativeTransform.appendFrom(localTransform, parentTransform);\n }\n else\n {\n relativeTransform = matrixPool.get();\n relativeTransform = parentTransform.copyTo(relativeTransform);\n }\n\n const parentBounds = bounds;\n const preserveBounds = !!target.effects.length;\n\n if (preserveBounds)\n {\n bounds = boundsPool.get().clear();\n }\n\n if (target.boundsArea)\n {\n bounds.addRect(target.boundsArea, relativeTransform);\n }\n else\n {\n if (target.renderPipeId)\n {\n bounds.matrix = relativeTransform;\n bounds.addBounds((target as Renderable).bounds);\n }\n\n const children = target.children;\n\n for (let i = 0; i < children.length; i++)\n {\n _getLocalBounds(children[i], bounds, relativeTransform, rootContainer, false);\n }\n }\n\n if (preserveBounds)\n {\n for (let i = 0; i < target.effects.length; i++)\n {\n target.effects[i].addLocalBounds?.(bounds, rootContainer);\n }\n\n // TODO - make a add transformed bounds?\n parentBounds.addBounds(bounds, Matrix.IDENTITY);\n\n boundsPool.return(bounds);\n }\n\n matrixPool.return(relativeTransform);\n}\n\n", "import type { Container } from '../Container';\n\n/**\n * This function will crawl through the container essentially check if the children have changed.\n *\n * This function checkChildrenDidChange recursively checks if any child in a Container\n * or its children has changed. It does this by comparing a generated changeId for each\n * child against a stored value in previousData.\n * The changeId is a combination of the child's uid and _didChangeId, bitwise manipulated for uniqueness.\n * If a change is detected, it updates previousData and sets didChange to true.\n * The function returns a boolean indicating if any change was detected in the entire hierarchy of children.\n * @param container - the container to check for changes\n * @param previousData - the previous data from the last check made\n * @param previousData.data - the data array\n * @param previousData.index - the index of the data array\n * @param previousData.didChange - did the data change\n * @internal\n */\nexport function checkChildrenDidChange(\n container: Container,\n previousData: {\n data: number[];\n index: number;\n didChange: boolean;\n })\n{\n const children = container.children;\n\n for (let i = 0; i < children.length; i++)\n {\n const child = children[i];\n\n const uid = child.uid;\n const didChange = ((child._didViewChangeTick & 0xffff) << 16) | (child._didContainerChangeTick & 0xffff);\n\n const index = previousData.index;\n\n if (previousData.data[index] !== uid || previousData.data[index + 1] !== didChange)\n {\n previousData.data[previousData.index] = uid;\n previousData.data[previousData.index + 1] = didChange;\n\n previousData.didChange = true;\n }\n\n previousData.index = index + 2;\n\n if (child.children.length)\n {\n checkChildrenDidChange(child, previousData);\n }\n }\n\n return previousData.didChange;\n}\n", "import { Matrix } from '../../../maths/matrix/Matrix';\nimport { Bounds } from '../bounds/Bounds';\nimport { getGlobalBounds } from '../bounds/getGlobalBounds';\nimport { getLocalBounds } from '../bounds/getLocalBounds';\nimport { checkChildrenDidChange } from '../utils/checkChildrenDidChange';\n\nimport type { Size } from '../../../maths/misc/Size';\nimport type { Container } from '../Container';\n\n/**\n * A utility type that makes all properties of T optional except for the specified keys K.\n * @category utils\n * @internal\n */\nexport type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\n/** @ignore */\nexport interface MeasureMixinConstructor\n{\n /**\n * The width of the display object, in pixels.\n * @example\n * ```ts\n * new Container({ width: 100});\n * ```\n * @default 0\n */\n width?: number;\n /**\n * The height of the display object, in pixels.\n * @example\n * ```ts\n * new Container({ height: 100});\n * ```\n * @default 0\n */\n height?: number;\n}\n/**\n * The MeasureMixin interface provides methods for measuring and manipulating the size and bounds of a display object.\n * It includes methods to get and set the size of the object, retrieve its local bounds,\n * and calculate its global bounds.\n * @category scene\n * @advanced\n */\nexport interface MeasureMixin extends Required<MeasureMixinConstructor>\n{\n getSize(out?: Size): Size;\n setSize(width: number, height?: number): void;\n setSize(value: Optional<Size, 'height'>): void;\n /**\n * Retrieves the local bounds of the container as a Bounds object.\n * Uses cached values when possible for better performance.\n * @example\n * ```ts\n * // Basic bounds check\n * const bounds = container.getLocalBounds();\n * console.log(`Width: ${bounds.width}, Height: ${bounds.height}`);\n * // subsequent calls will reuse the cached bounds\n * const cachedBounds = container.getLocalBounds();\n * console.log(bounds === cachedBounds); // true\n * ```\n * @returns The bounding area\n * @see {@link Container#getBounds} For world space bounds\n * @see {@link Bounds} For bounds properties\n */\n getLocalBounds(): Bounds;\n /**\n * Calculates and returns the (world) bounds of the display object as a Rectangle.\n * Takes into account transforms and child bounds.\n * @example\n * ```ts\n * // Basic bounds calculation\n * const bounds = sprite.getBounds();\n * console.log(`World bounds: ${bounds.x}, ${bounds.y}, ${bounds.width}, ${bounds.height}`);\n *\n * // Reuse bounds object for performance\n * const recycleBounds = new Bounds();\n * sprite.getBounds(false, recycleBounds);\n *\n * // Skip update for performance\n * const fastBounds = sprite.getBounds(true);\n * ```\n * @remarks\n * - Includes transform calculations\n * - Updates scene graph by default\n * - Can reuse bounds objects\n * - Common in hit testing\n * @param {boolean} skipUpdate - Setting to `true` will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost.\n * @param {Bounds} bounds - Optional bounds to store the result of the bounds calculation\n * @returns The minimum axis-aligned rectangle in world space that fits around this object\n * @see {@link Container#getLocalBounds} For untransformed bounds\n * @see {@link Bounds} For bounds properties\n */\n getBounds(skipUpdate?: boolean, bounds?: Bounds): Bounds;\n /** @private */\n _localBoundsCacheData: LocalBoundsCacheData;\n /** @private */\n _localBoundsCacheId: number;\n /** @private */\n _setWidth(width: number, localWidth: number): void;\n /** @private */\n _setHeight(height: number, localHeight: number): void;\n}\n\ninterface LocalBoundsCacheData\n{\n data: number[];\n index: number;\n didChange: boolean;\n localBounds: Bounds;\n}\n\nconst tempMatrix = new Matrix();\n\n/** @internal */\nexport const measureMixin: Partial<Container> = {\n\n _localBoundsCacheId: -1,\n _localBoundsCacheData: null,\n\n _setWidth(value: number, localWidth: number)\n {\n const sign = Math.sign(this.scale.x) || 1;\n\n if (localWidth !== 0)\n {\n this.scale.x = (value / localWidth) * sign;\n }\n else\n {\n this.scale.x = sign;\n }\n },\n\n _setHeight(value: number, localHeight: number)\n {\n const sign = Math.sign(this.scale.y) || 1;\n\n if (localHeight !== 0)\n {\n this.scale.y = (value / localHeight) * sign;\n }\n else\n {\n this.scale.y = sign;\n }\n },\n\n getLocalBounds(): Bounds\n {\n if (!this._localBoundsCacheData)\n {\n this._localBoundsCacheData = {\n data: [],\n index: 1,\n didChange: false,\n localBounds: new Bounds()\n };\n }\n\n const localBoundsCacheData = this._localBoundsCacheData;\n\n localBoundsCacheData.index = 1;\n localBoundsCacheData.didChange = false;\n\n if (localBoundsCacheData.data[0] !== this._didViewChangeTick)\n {\n localBoundsCacheData.didChange = true;\n localBoundsCacheData.data[0] = this._didViewChangeTick;\n }\n\n checkChildrenDidChange(this, localBoundsCacheData);\n\n if (localBoundsCacheData.didChange)\n {\n getLocalBounds(this, localBoundsCacheData.localBounds, tempMatrix);\n }\n\n return localBoundsCacheData.localBounds;\n },\n\n getBounds(skipUpdate?: boolean, bounds?: Bounds): Bounds\n {\n return getGlobalBounds(this, skipUpdate, bounds || new Bounds());\n },\n} as Container;\n", "import type { Renderer } from '../../../rendering/renderers/types';\nimport type { Container } from '../Container';\n\n/** @internal */\nexport interface OnRenderMixinConstructor\n{\n /**\n * This callback is used when the container is rendered. It runs every frame during the render process,\n * making it ideal for per-frame updates and animations.\n *\n * > [!NOTE] In v7 many users used `updateTransform` for this, however the way v8 renders objects is different\n * > and \"updateTransform\" is no longer called every frame\n * @example\n * ```ts\n * // Basic rotation animation\n * const container = new Container();\n * container.onRender = () => {\n * container.rotation += 0.01;\n * };\n *\n * // Cleanup when done\n * container.onRender = null; // Removes callback\n * ```\n * @param renderer - The renderer instance\n * @see {@link Renderer} For renderer capabilities\n */\n onRender?: ((renderer: Renderer) => void) | null;\n}\n\n/**\n * The OnRenderMixin interface provides a way to define a callback that is executed\n * every time the container is rendered. This is useful for adding custom rendering logic\n * or animations that need to be updated each frame.\n * @category scene\n * @advanced\n */\nexport interface OnRenderMixin extends Required<OnRenderMixinConstructor>\n{\n /** @private */\n _onRender: ((renderer: Renderer) => void) | null;\n}\n\n/** @internal */\nexport const onRenderMixin: Partial<Container> = {\n _onRender: null,\n\n set onRender(func: (renderer: Renderer) => void)\n {\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n if (!func)\n {\n if (this._onRender)\n {\n renderGroup?.removeOnRender(this);\n }\n\n this._onRender = null;\n\n return;\n }\n\n if (!this._onRender)\n {\n renderGroup?.addOnRender(this);\n }\n\n this._onRender = func;\n },\n\n get onRender(): (renderer: Renderer) => void\n {\n return this._onRender;\n }\n} as Container;\n", "import type { Container } from '../Container';\n\n/** @ignore */\nexport interface SortMixinConstructor\n{\n /**\n * The zIndex of the container.\n *\n * Controls the rendering order of children within their parent container.\n *\n * A higher value will mean it will be moved towards the front of the rendering order.\n * @example\n * ```ts\n * // Add in any order\n * container.addChild(character, background, foreground);\n *\n * // Adjust rendering order\n * background.zIndex = 0;\n * character.zIndex = 1;\n * foreground.zIndex = 2;\n * ```\n * @see {@link Container#sortableChildren} For enabling sorting\n * @see {@link Container#sortChildren} For manual sorting\n * @default 0\n */\n zIndex?: number;\n /**\n * Should children be sorted by zIndex at the next render call.\n *\n * Will get automatically set to true if a new child is added, or if a child's zIndex changes.\n * @default false\n * @internal\n */\n sortDirty?: boolean;\n /**\n * If set to true, the container will sort its children by `zIndex` value\n * when the next render is called, or manually if `sortChildren()` is called.\n *\n * This actually changes the order of elements in the array of children,\n * so it will affect the rendering order.\n *\n * > [!NOTE] Also be aware of that this may not work nicely with the `addChildAt()` function,\n * > as the `zIndex` sorting may cause the child to automatically sorted to another position.\n * @example\n * ```ts\n * container.sortableChildren = true;\n * ```\n * @default false\n */\n sortableChildren?: boolean;\n}\n\n/**\n * The SortMixin interface provides methods and properties for sorting children of a container\n * based on their `zIndex` values. It allows for automatic sorting of children when their `zIndex`\n * changes or when new children are added. The mixin includes properties to manage sorting state\n * and methods to sort children explicitly.\n * @category scene\n * @advanced\n */\nexport interface SortMixin extends Required<SortMixinConstructor>\n{\n /** @internal */\n _zIndex: number;\n /**\n * Sorts children by zIndex value. Only sorts if container is marked as dirty.\n * @example\n * ```ts\n * // Basic sorting\n * particles.zIndex = 2; // Will mark as dirty\n * container.sortChildren();\n * ```\n * @see {@link Container#sortableChildren} For enabling automatic sorting\n * @see {@link Container#zIndex} For setting child order\n */\n sortChildren: () => void;\n /** @internal */\n depthOfChildModified: () => void;\n}\n\n/** @internal */\nexport const sortMixin: Partial<Container> = {\n _zIndex: 0,\n sortDirty: false,\n sortableChildren: false,\n\n get zIndex()\n {\n return this._zIndex;\n },\n\n set zIndex(value: number)\n {\n if (this._zIndex === value) return;\n\n this._zIndex = value;\n\n this.depthOfChildModified();\n },\n\n depthOfChildModified()\n {\n if (this.parent)\n {\n this.parent.sortableChildren = true;\n this.parent.sortDirty = true;\n }\n\n if (this.parentRenderGroup)\n {\n this.parentRenderGroup.structureDidChange = true;\n }\n },\n\n sortChildren()\n {\n if (!this.sortDirty) return;\n\n this.sortDirty = false;\n\n this.children.sort(sortChildren);\n },\n} as Container;\n\nfunction sortChildren(a: Container, b: Container): number\n{\n return a._zIndex - b._zIndex;\n}\n", "import { Point } from '../../../maths/point/Point';\nimport { matrixPool } from '../bounds/utils/matrixAndBoundsPool';\n\nimport type { PointData } from '../../../maths/point/PointData';\nimport type { Container } from '../Container';\n\n/**\n * Interface for a mixin that provides methods to convert between local and global coordinates.\n * This mixin allows you to get the global position of a container,\n * convert a point from local to global coordinates,\n * and convert a point from global to local coordinates.\n *\n * It includes methods to optimize performance by using cached matrices when available.\n * @category scene\n * @advanced\n */\nexport interface ToLocalGlobalMixin\n{\n /**\n * Returns the global position of the container, taking into account the container hierarchy.\n * @example\n * ```ts\n * // Basic position check\n * const globalPos = sprite.getGlobalPosition();\n * console.log(`Global: (${globalPos.x}, ${globalPos.y})`);\n *\n * // Reuse point object\n * const point = new Point();\n * sprite.getGlobalPosition(point);\n *\n * // Skip transform update for performance\n * const fastPos = container.getGlobalPosition(undefined, true);\n * ```\n * @param {Point} point - The optional point to write the global value to\n * @param {boolean} skipUpdate - Should we skip the update transform\n * @returns The updated point\n * @see {@link Container#toGlobal} For converting specific points\n * @see {@link Container#toLocal} For converting to local space\n */\n getGlobalPosition(point?: Point, skipUpdate?: boolean): Point;\n /**\n * Calculates the global position of a point relative to this container.\n * Takes into account the container hierarchy and transforms.\n * @example\n * ```ts\n * // Basic point conversion\n * const localPoint = { x: 10, y: 20 };\n * const globalPoint = container.toGlobal(localPoint);\n *\n * // With point reuse\n * const reusePoint = new Point();\n * container.toGlobal(localPoint, reusePoint);\n *\n * // Performance optimization\n * const fastPoint = container.toGlobal(\n * { x: 50, y: 50 },\n * undefined,\n * true // Skip transform update\n * );\n * ```\n * @param {PointData} position - The local point to convert\n * @param {P} point - Optional point to store the result\n * @param {boolean} skipUpdate - Whether to skip transform updates\n * @returns The global position\n * @see {@link Container#toLocal} For reverse conversion\n * @see {@link Container#getGlobalPosition} For container position\n */\n toGlobal<P extends PointData = Point>(position: PointData, point?: P, skipUpdate?: boolean): P;\n /**\n * Calculates the local position of the container relative to another point.\n * Converts coordinates from any coordinate space to this container's local coordinate space.\n * @example\n * ```ts\n * // Basic coordinate conversion\n * const worldPoint = { x: 100, y: 100 };\n * const localPos = container.toLocal(worldPoint);\n *\n * // Convert from another container\n * const fromSprite = new Sprite(texture);\n * fromSprite.position.set(50, 50);\n * const pointInSprite = { x: 10, y: 10 };\n * const localPoint = container.toLocal(pointInSprite, fromSprite);\n *\n * // With point reuse for performance\n * const reusePoint = new Point();\n * container.toLocal(worldPoint, undefined, reusePoint);\n *\n * // Skip transform update for static objects\n * const fastLocal = container.toLocal(\n * worldPoint,\n * undefined,\n * undefined,\n * true\n * );\n * ```\n * @param {PointData} position - The world origin to calculate from\n * @param {Container} from - The Container to calculate the global position from\n * @param {P} point - A Point object in which to store the value\n * @param {boolean} skipUpdate - Should we skip the update transform\n * @returns A point object representing the position in local space\n * @see {@link Container#toGlobal} For reverse conversion\n * @see {@link Container#getGlobalPosition} For container position\n */\n toLocal<P extends PointData = Point>(position: PointData, from?: Container, point?: P, skipUpdate?: boolean): P;\n}\n\n/** @internal */\nexport const toLocalGlobalMixin: Partial<Container> = {\n getGlobalPosition(point: Point = new Point(), skipUpdate = false): Point\n {\n if (this.parent)\n {\n this.parent.toGlobal(this._position, point, skipUpdate);\n }\n else\n {\n point.x = this._position.x;\n point.y = this._position.y;\n }\n\n return point;\n },\n\n toGlobal<P extends PointData = Point>(position: PointData, point?: P, skipUpdate = false): P\n {\n const globalMatrix = this.getGlobalTransform(matrixPool.get(), skipUpdate);\n\n // simply apply the matrix..\n point = globalMatrix.apply(position, point);\n\n matrixPool.return(globalMatrix);\n\n return point;\n },\n\n toLocal<P extends PointData = Point>(position: PointData, from?: Container, point?: P, skipUpdate?: boolean): P\n {\n if (from)\n {\n position = from.toGlobal(position, point, skipUpdate);\n }\n\n const globalMatrix = this.getGlobalTransform(matrixPool.get(), skipUpdate);\n\n // simply apply the matrix..\n point = globalMatrix.applyInverse(position, point);\n\n matrixPool.return(globalMatrix);\n\n return point;\n }\n} as Container;\n", "import { uid } from '../../../../utils/data/uid';\n\nimport type { Renderable } from '../Renderable';\nimport type { Instruction } from './Instruction';\n\n/**\n * A set of instructions that can be executed by the renderer.\n * Basically wraps an array, but with some extra properties that help the renderer\n * to keep things nice and optimised.\n *\n * Note:\n * InstructionSet.instructions contains all the instructions, but does not resize (for performance).\n * So for the true length of the instructions you need to use InstructionSet.instructionSize\n * @category rendering\n * @advanced\n */\nexport class InstructionSet\n{\n /** a unique id for this instruction set used through the renderer */\n public readonly uid: number = uid('instructionSet');\n /** the array of instructions */\n public readonly instructions: Instruction[] = [];\n /** the actual size of the array (any instructions passed this should be ignored) */\n public instructionSize = 0;\n /** allows for access to the render pipes of the renderer */\n public renderPipes: any;\n\n public renderables: Renderable[] = [];\n /** used by the garbage collector to track when the instruction set was last used */\n public gcTick = 0;\n\n /** reset the instruction set so it can be reused set size back to 0 */\n public reset()\n {\n this.instructionSize = 0;\n }\n\n /**\n * Destroy the instruction set, clearing the instructions and renderables.\n * @internal\n */\n public destroy()\n {\n this.instructions.length = 0;\n this.renderables.length = 0;\n\n this.renderPipes = null;\n this.gcTick = 0;\n }\n\n /**\n * Add an instruction to the set\n * @param instruction - add an instruction to the set\n */\n public add(instruction: Instruction)\n {\n this.instructions[this.instructionSize++] = instruction;\n }\n\n /**\n * Log the instructions to the console (for debugging)\n * @internal\n */\n public log()\n {\n this.instructions.length = this.instructionSize;\n // eslint-disable-next-line no-console\n console.table(this.instructions, ['type', 'action']);\n }\n}\n", "import { nextPow2 } from '../../../../maths/misc/pow2';\nimport { GlobalResourceRegistry } from '../../../../utils/pool/GlobalResourceRegistry';\nimport { TextureSource } from './sources/TextureSource';\nimport { Texture } from './Texture';\nimport { TextureStyle } from './TextureStyle';\n\nimport type { TextureSourceOptions } from './sources/TextureSource';\n\nlet count = 0;\n\n/**\n * Texture pool, used by FilterSystem and plugins.\n *\n * Stores collection of temporary pow2 or screen-sized renderTextures\n *\n * If you use custom RenderTexturePool for your filters, you can use methods\n * `getFilterTexture` and `returnFilterTexture` same as in default pool\n * @category rendering\n * @advanced\n */\nexport class TexturePoolClass\n{\n /** The default options for texture pool */\n public textureOptions: TextureSourceOptions;\n\n /** The default texture style for the pool */\n public textureStyle: TextureStyle;\n\n /**\n * Allow renderTextures of the same size as screen, not just pow2\n *\n * Automatically sets to true after `setScreenSize`\n * @default false\n */\n public enableFullScreen: boolean;\n\n private _texturePool: {[x in string | number]: Texture[]};\n private _poolKeyHash: Record<number, number> = Object.create(null);\n\n /**\n * @param textureOptions - options that will be passed to BaseRenderTexture constructor\n * @param {SCALE_MODE} [textureOptions.scaleMode] - See {@link SCALE_MODE} for possible values.\n */\n constructor(textureOptions?: TextureSourceOptions)\n {\n this._texturePool = {};\n this.textureOptions = textureOptions || {};\n this.enableFullScreen = false;\n this.textureStyle = new TextureStyle(this.textureOptions);\n }\n\n /**\n * Creates texture with params that were specified in pool constructor.\n * @param pixelWidth - Width of texture in pixels.\n * @param pixelHeight - Height of texture in pixels.\n * @param antialias\n */\n public createTexture(pixelWidth: number, pixelHeight: number, antialias: boolean): Texture\n {\n const textureSource = new TextureSource({\n ...this.textureOptions,\n\n width: pixelWidth,\n height: pixelHeight,\n resolution: 1,\n antialias,\n autoGarbageCollect: false,\n });\n\n return new Texture({\n source: textureSource,\n label: `texturePool_${count++}`,\n });\n }\n\n /**\n * Gets a Power-of-Two render texture or fullScreen texture\n * @param frameWidth - The minimum width of the render texture.\n * @param frameHeight - The minimum height of the render texture.\n * @param resolution - The resolution of the render texture.\n * @param antialias\n * @returns The new render texture.\n */\n public getOptimalTexture(frameWidth: number, frameHeight: number, resolution = 1, antialias: boolean): Texture\n {\n let po2Width = Math.ceil((frameWidth * resolution) - 1e-6);\n let po2Height = Math.ceil((frameHeight * resolution) - 1e-6);\n\n po2Width = nextPow2(po2Width);\n po2Height = nextPow2(po2Height);\n\n const key = (po2Width << 17) + (po2Height << 1) + (antialias ? 1 : 0);\n\n if (!this._texturePool[key])\n {\n this._texturePool[key] = [];\n }\n\n let texture = this._texturePool[key].pop();\n\n if (!texture)\n {\n texture = this.createTexture(po2Width, po2Height, antialias);\n }\n\n texture.source._resolution = resolution;\n texture.source.width = po2Width / resolution;\n texture.source.height = po2Height / resolution;\n texture.source.pixelWidth = po2Width;\n texture.source.pixelHeight = po2Height;\n\n // fit the layout to the requested original size\n texture.frame.x = 0;\n texture.frame.y = 0;\n texture.frame.width = frameWidth;\n texture.frame.height = frameHeight;\n\n texture.updateUvs();\n\n this._poolKeyHash[texture.uid] = key;\n\n return texture;\n }\n\n /**\n * Gets extra texture of the same size as input renderTexture\n * @param texture - The texture to check what size it is.\n * @param antialias - Whether to use antialias.\n * @returns A texture that is a power of two\n */\n public getSameSizeTexture(texture: Texture, antialias = false)\n {\n const source = texture.source;\n\n return this.getOptimalTexture(texture.width, texture.height, source._resolution, antialias);\n }\n\n /**\n * Place a render texture back into the pool. Optionally reset the style of the texture to the default texture style.\n * useful if you modified the style of the texture after getting it from the pool.\n * @param renderTexture - The renderTexture to free\n * @param resetStyle - Whether to reset the style of the texture to the default texture style\n */\n public returnTexture(renderTexture: Texture, resetStyle = false): void\n {\n const key = this._poolKeyHash[renderTexture.uid];\n\n // we can skip the copy if we don't need to reset the style\n if (resetStyle)\n {\n renderTexture.source.style = this.textureStyle;\n }\n\n this._texturePool[key].push(renderTexture);\n }\n\n /**\n * Clears the pool.\n * @param destroyTextures - Destroy all stored textures.\n */\n public clear(destroyTextures?: boolean): void\n {\n destroyTextures = destroyTextures !== false;\n if (destroyTextures)\n {\n for (const i in this._texturePool)\n {\n const textures = this._texturePool[i];\n\n if (textures)\n {\n for (let j = 0; j < textures.length; j++)\n {\n textures[j].destroy(true);\n }\n }\n }\n }\n\n this._texturePool = {};\n }\n}\n\n/**\n * The default texture pool instance.\n * @category rendering\n * @advanced\n */\nexport const TexturePool = new TexturePoolClass();\nGlobalResourceRegistry.register(TexturePool);\n", "import { Matrix } from '../../maths/matrix/Matrix';\nimport { InstructionSet } from '../../rendering/renderers/shared/instructions/InstructionSet';\nimport { type SCALE_MODE } from '../../rendering/renderers/shared/texture/const';\nimport { TexturePool } from '../../rendering/renderers/shared/texture/TexturePool';\nimport { type Renderer } from '../../rendering/renderers/types';\n\nimport type { Instruction } from '../../rendering/renderers/shared/instructions/Instruction';\nimport type { Texture } from '../../rendering/renderers/shared/texture/Texture';\nimport type { BatchableSprite } from '../sprite/BatchableSprite';\nimport type { ViewContainer } from '../view/ViewContainer';\nimport type { Bounds } from './bounds/Bounds';\nimport type { Container } from './Container';\n\n/**\n * Options for caching a container as a texture.\n * @category rendering\n * @advanced\n */\nexport interface CacheAsTextureOptions\n{\n /**\n * If true, the texture will be antialiased. This smooths out the edges of the texture.\n * @default false\n */\n antialias?: boolean;\n /**\n * The resolution of the texture. A higher resolution means a sharper texture but uses more memory.\n * By default the resolution is 1 which is the same as the rendererers resolution.\n */\n resolution?: number;\n /**\n * Scale Mode to use for the cached texture\n * @type {SCALE_MODE}\n * @default 'linear'\n * @example\n * ```ts\n * const container = new Container();\n * container.cacheAsTexture({ scaleMode: 'nearest' });\n * ```\n * @see {@link SCALE_MODE}\n */\n scaleMode?: SCALE_MODE;\n}\n\n/**\n * A RenderGroup is a class that is responsible for I generating a set of instructions that are used to render the\n * root container and its children. It also watches for any changes in that container or its children,\n * these changes are analysed and either the instruction set is rebuild or the instructions data is updated.\n * @category rendering\n * @advanced\n */\nexport class RenderGroup implements Instruction\n{\n public renderPipeId = 'renderGroup';\n public root: Container = null;\n\n public canBundle = false;\n\n public renderGroupParent: RenderGroup = null;\n public renderGroupChildren: RenderGroup[] = [];\n\n public worldTransform: Matrix = new Matrix();\n public worldColorAlpha = 0xffffffff;\n public worldColor = 0xffffff;\n public worldAlpha = 1;\n\n // these updates are transform changes..\n public readonly childrenToUpdate: Record<number, { list: Container[]; index: number; }> = Object.create(null);\n public updateTick = 0;\n public gcTick = 0;\n\n // these update are renderable changes..\n public readonly childrenRenderablesToUpdate: { list: Container[]; index: number; } = { list: [], index: 0 };\n\n // other\n public structureDidChange = true;\n\n public instructionSet: InstructionSet = new InstructionSet();\n\n private readonly _onRenderContainers: Container[] = [];\n\n /**\n * Indicates if the cached texture needs to be updated.\n * @default true\n */\n public textureNeedsUpdate = true;\n\n /**\n * Indicates if the container should be cached as a texture.\n * @default false\n */\n public isCachedAsTexture = false;\n\n /**\n * The texture used for caching the container. this is only set if isCachedAsTexture is true.\n * It can only be accessed after a render pass.\n * @type {Texture | undefined}\n */\n public texture?: Texture;\n\n /**\n * The bounds of the cached texture.\n * @type {Bounds | undefined}\n * @ignore\n */\n public _textureBounds?: Bounds;\n\n /**\n * The options for caching the container as a texture.\n * @type {CacheAsTextureOptions}\n */\n public textureOptions: CacheAsTextureOptions;\n\n /**\n * holds a reference to the batchable render sprite\n * @ignore\n */\n public _batchableRenderGroup: BatchableSprite;\n\n /**\n * Holds a reference to the closest parent RenderGroup that has isCachedAsTexture enabled.\n * This is used to properly transform coordinates when rendering into cached textures.\n * @type {RenderGroup | null}\n * @ignore\n */\n public _parentCacheAsTextureRenderGroup: RenderGroup;\n\n private _inverseWorldTransform: Matrix;\n private _textureOffsetInverseTransform: Matrix;\n private _inverseParentTextureTransform: Matrix;\n\n private _matrixDirty = 0b111;\n\n public init(root: Container)\n {\n this.root = root;\n\n if (root._onRender) this.addOnRender(root);\n\n root.didChange = true;\n\n const children = root.children;\n\n for (let i = 0; i < children.length; i++)\n {\n const child = children[i];\n\n // make sure the children are all updated on the first pass..\n child._updateFlags = 0b1111;\n\n this.addChild(child);\n }\n }\n\n public enableCacheAsTexture(options: CacheAsTextureOptions = {}): void\n {\n this.textureOptions = options;\n this.isCachedAsTexture = true;\n this.textureNeedsUpdate = true;\n }\n\n public disableCacheAsTexture(): void\n {\n this.isCachedAsTexture = false;\n if (this.texture)\n {\n TexturePool.returnTexture(this.texture, true);\n this.texture = null;\n }\n }\n\n public updateCacheTexture(): void\n {\n this.textureNeedsUpdate = true;\n\n const cachedParent = this._parentCacheAsTextureRenderGroup;\n\n // It's worth going bottom-up and notify all parents cached as texture\n // that cached child was updated.\n if (cachedParent && !cachedParent.textureNeedsUpdate)\n {\n cachedParent.updateCacheTexture();\n }\n }\n\n public reset()\n {\n this.renderGroupChildren.length = 0;\n\n for (const i in this.childrenToUpdate)\n {\n const childrenAtDepth = this.childrenToUpdate[i];\n\n childrenAtDepth.list.fill(null);\n childrenAtDepth.index = 0;\n }\n\n this.childrenRenderablesToUpdate.index = 0;\n this.childrenRenderablesToUpdate.list.fill(null);\n\n this.root = null;\n this.updateTick = 0;\n this.structureDidChange = true;\n\n this._onRenderContainers.length = 0;\n this.renderGroupParent = null;\n\n this.disableCacheAsTexture();\n }\n\n get localTransform()\n {\n return this.root.localTransform;\n }\n\n public addRenderGroupChild(renderGroupChild: RenderGroup)\n {\n if (renderGroupChild.renderGroupParent)\n {\n renderGroupChild.renderGroupParent._removeRenderGroupChild(renderGroupChild);\n }\n\n renderGroupChild.renderGroupParent = this;\n\n this.renderGroupChildren.push(renderGroupChild);\n }\n\n private _removeRenderGroupChild(renderGroupChild: RenderGroup)\n {\n const index = this.renderGroupChildren.indexOf(renderGroupChild);\n\n if (index > -1)\n {\n this.renderGroupChildren.splice(index, 1);\n }\n\n renderGroupChild.renderGroupParent = null;\n }\n\n public addChild(child: Container)\n {\n this.structureDidChange = true;\n\n child.parentRenderGroup = this;\n\n child.updateTick = -1;\n\n if (child.parent === this.root)\n {\n child.relativeRenderGroupDepth = 1;\n }\n else\n {\n child.relativeRenderGroupDepth = child.parent.relativeRenderGroupDepth + 1;\n }\n\n child.didChange = true;\n this.onChildUpdate(child);\n\n if (child.renderGroup)\n {\n this.addRenderGroupChild(child.renderGroup);\n\n return;\n }\n\n if (child._onRender) this.addOnRender(child);\n\n const children = child.children;\n\n for (let i = 0; i < children.length; i++)\n {\n this.addChild(children[i]);\n }\n }\n\n public removeChild(child: Container)\n {\n // remove all the children...\n this.structureDidChange = true;\n\n if (child._onRender)\n {\n // Remove the child to the onRender list under the following conditions:\n // 1. If the child is not a render group.\n // 2. If the child is a render group root of this render group - which it can't be removed from in this case.\n if (!child.renderGroup)\n {\n this.removeOnRender(child);\n }\n }\n\n child.parentRenderGroup = null;\n\n if (child.renderGroup)\n {\n this._removeRenderGroupChild(child.renderGroup);\n\n return;\n }\n\n const children = child.children;\n\n for (let i = 0; i < children.length; i++)\n {\n this.removeChild(children[i]);\n }\n }\n\n public removeChildren(children: Container[])\n {\n for (let i = 0; i < children.length; i++)\n {\n this.removeChild(children[i]);\n }\n }\n\n public onChildUpdate(child: Container)\n {\n let childrenToUpdate = this.childrenToUpdate[child.relativeRenderGroupDepth];\n\n if (!childrenToUpdate)\n {\n childrenToUpdate = this.childrenToUpdate[child.relativeRenderGroupDepth] = {\n index: 0,\n list: [],\n };\n }\n\n childrenToUpdate.list[childrenToUpdate.index++] = child;\n }\n\n public updateRenderable(renderable: ViewContainer)\n {\n if (renderable.globalDisplayStatus < 0b111) return;\n this.instructionSet.renderPipes[renderable.renderPipeId].updateRenderable(renderable);\n renderable.didViewUpdate = false;\n }\n\n public onChildViewUpdate(child: Container)\n {\n this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++] = child;\n }\n\n get isRenderable(): boolean\n {\n return (this.root.localDisplayStatus === 0b111 && this.worldAlpha > 0);\n }\n\n /**\n * adding a container to the onRender list will make sure the user function\n * passed in to the user defined 'onRender` callBack\n * @param container - the container to add to the onRender list\n */\n public addOnRender(container: Container)\n {\n this._onRenderContainers.push(container);\n }\n\n public removeOnRender(container: Container)\n {\n this._onRenderContainers.splice(this._onRenderContainers.indexOf(container), 1);\n }\n\n public runOnRender(renderer: Renderer)\n {\n for (let i = 0; i < this._onRenderContainers.length; i++)\n {\n this._onRenderContainers[i]._onRender(renderer);\n }\n }\n\n public destroy()\n {\n this.disableCacheAsTexture();\n\n this.renderGroupParent = null;\n this.root = null;\n (this.childrenRenderablesToUpdate as any) = null;\n (this.childrenToUpdate as any) = null;\n (this.renderGroupChildren as any) = null;\n (this._onRenderContainers as any) = null;\n this.instructionSet = null;\n }\n\n public getChildren(out: Container[] = []): Container[]\n {\n const children = this.root.children;\n\n for (let i = 0; i < children.length; i++)\n {\n this._getChildren(children[i], out);\n }\n\n return out;\n }\n\n private _getChildren(container: Container, out: Container[] = []): Container[]\n {\n out.push(container);\n\n if (container.renderGroup) return out;\n\n const children = container.children;\n\n for (let i = 0; i < children.length; i++)\n {\n this._getChildren(children[i], out);\n }\n\n return out;\n }\n\n public invalidateMatrices()\n {\n this._matrixDirty = 0b111;\n }\n\n /**\n * Returns the inverse of the world transform matrix.\n * @returns {Matrix} The inverse of the world transform matrix.\n */\n public get inverseWorldTransform()\n {\n if ((this._matrixDirty & 0b001) === 0) return this._inverseWorldTransform;\n\n this._matrixDirty &= ~0b001;\n\n // TODO - add dirty flag\n this._inverseWorldTransform ||= new Matrix();\n\n return this._inverseWorldTransform\n .copyFrom(this.worldTransform)\n .invert();\n }\n\n /**\n * Returns the inverse of the texture offset transform matrix.\n * @returns {Matrix} The inverse of the texture offset transform matrix.\n */\n public get textureOffsetInverseTransform()\n {\n if ((this._matrixDirty & 0b010) === 0) return this._textureOffsetInverseTransform;\n\n this._matrixDirty &= ~0b010;\n\n this._textureOffsetInverseTransform ||= new Matrix();\n\n // TODO shared.. bad!\n return this._textureOffsetInverseTransform\n .copyFrom(this.inverseWorldTransform)\n .translate(\n -this._textureBounds.x,\n -this._textureBounds.y\n );\n }\n\n /**\n * Returns the inverse of the parent texture transform matrix.\n * This is used to properly transform coordinates when rendering into cached textures.\n * @returns {Matrix} The inverse of the parent texture transform matrix.\n */\n public get inverseParentTextureTransform()\n {\n if ((this._matrixDirty & 0b100) === 0) return this._inverseParentTextureTransform;\n\n this._matrixDirty &= ~0b100;\n\n const parentCacheAsTexture = this._parentCacheAsTextureRenderGroup;\n\n if (parentCacheAsTexture)\n {\n this._inverseParentTextureTransform ||= new Matrix();\n\n // Get relative transform by removing parent's world transform\n return this._inverseParentTextureTransform\n .copyFrom(this.worldTransform)\n .prepend(parentCacheAsTexture.inverseWorldTransform)\n // Offset by texture bounds\n .translate(\n -parentCacheAsTexture._textureBounds.x,\n -parentCacheAsTexture._textureBounds.y\n );\n }\n\n return this.worldTransform;\n }\n\n /**\n * Returns a matrix that transforms coordinates to the correct coordinate space of the texture being rendered to.\n * This is the texture offset inverse transform of the closest parent RenderGroup that is cached as a texture.\n * @returns {Matrix | null} The transform matrix for the cached texture coordinate space,\n * or null if no parent is cached as texture.\n */\n public get cacheToLocalTransform()\n {\n if (this.isCachedAsTexture)\n {\n return this.textureOffsetInverseTransform;\n }\n\n if (!this._parentCacheAsTextureRenderGroup) return null;\n\n return this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform;\n }\n}\n", "/**\n * Assigns properties from one object to another, using an optional array of property names to ignore.\n * @param target - The target object to assign properties to.\n * @param options - The object to assign properties from.\n * @param ignore - An object of property names to ignore ({ propToIgnore: true }).\n * @category utils\n * @internal\n */\nexport function assignWithIgnore<T extends Record<string, any>>(\n target: T,\n options: T,\n ignore: Record<string, boolean> = {}\n)\n{\n for (const key in options)\n {\n if (!ignore[key] && options[key] !== undefined)\n {\n target[key] = options[key];\n }\n }\n}\n", "import EventEmitter from 'eventemitter3';\nimport { Color, type ColorSource } from '../../color/Color';\nimport { cullingMixin } from '../../culling/cullingMixin';\nimport { extensions } from '../../extensions/Extensions';\nimport { Matrix } from '../../maths/matrix/Matrix';\nimport { DEG_TO_RAD, RAD_TO_DEG } from '../../maths/misc/const';\nimport { ObservablePoint } from '../../maths/point/ObservablePoint';\nimport { uid } from '../../utils/data/uid';\nimport { deprecation, v8_0_0 } from '../../utils/logging/deprecation';\nimport { warn } from '../../utils/logging/warn';\nimport { BigPool } from '../../utils/pool/PoolGroup';\nimport { type RenderLayer } from '../layers/RenderLayer';\nimport { cacheAsTextureMixin } from './container-mixins/cacheAsTextureMixin';\nimport { childrenHelperMixin } from './container-mixins/childrenHelperMixin';\nimport { collectRenderablesMixin } from './container-mixins/collectRenderablesMixin';\nimport { effectsMixin } from './container-mixins/effectsMixin';\nimport { findMixin } from './container-mixins/findMixin';\nimport { getFastGlobalBoundsMixin } from './container-mixins/getFastGlobalBoundsMixin';\nimport { bgr2rgb, getGlobalMixin } from './container-mixins/getGlobalMixin';\nimport { measureMixin } from './container-mixins/measureMixin';\nimport { onRenderMixin } from './container-mixins/onRenderMixin';\nimport { sortMixin } from './container-mixins/sortMixin';\nimport { toLocalGlobalMixin } from './container-mixins/toLocalGlobalMixin';\nimport { RenderGroup } from './RenderGroup';\nimport { assignWithIgnore } from './utils/assignWithIgnore';\n\nimport type { Size } from '../../maths/misc/Size';\nimport type { PointData } from '../../maths/point/PointData';\nimport type { Rectangle } from '../../maths/shapes/Rectangle';\nimport type { BLEND_MODES } from '../../rendering/renderers/shared/state/const';\nimport type { Dict } from '../../utils/types';\nimport type { Optional } from './container-mixins/measureMixin';\nimport type { DestroyOptions } from './destroyTypes';\n\n/**\n * The type of child that can be added to a {@link Container}.\n * This is a generic type that extends the {@link Container} class.\n * @category scene\n * @standard\n */\nexport type ContainerChild = Container;\n\n// as pivot and skew are the least used properties of a container, we can use this optimisation\n// to avoid allocating lots of unnecessary objects for them.\nconst defaultSkew = new ObservablePoint(null);\nconst defaultPivot = new ObservablePoint(null);\nconst defaultScale = new ObservablePoint(null, 1, 1);\nconst defaultOrigin = new ObservablePoint(null);\n\n/**\n * Events that can be emitted by a Container. These events provide lifecycle hooks and notifications\n * for container state changes.\n * @example\n * ```ts\n * import { Container, Sprite } from 'pixi.js';\n *\n * // Setup container with event listeners\n * const container = new Container();\n *\n * // Listen for child additions\n * container.on('childAdded', (child, container, index) => {\n * console.log(`Child added at index ${index}:`, child);\n * });\n *\n * // Listen for child removals\n * container.on('childRemoved', (child, container, index) => {\n * console.log(`Child removed from index ${index}:`, child);\n * });\n *\n * // Listen for when container is added to parent\n * container.on('added', (parent) => {\n * console.log('Added to parent:', parent);\n * });\n *\n * // Listen for when container is removed from parent\n * container.on('removed', (parent) => {\n * console.log('Removed from parent:', parent);\n * });\n *\n * // Listen for container destruction\n * container.on('destroyed', (container) => {\n * console.log('Container destroyed:', container);\n * });\n * ```\n * @category scene\n * @standard\n */\nexport interface ContainerEvents<C extends ContainerChild> extends PixiMixins.ContainerEvents\n{\n /**\n * Emitted when this container is added to a new container.\n * Useful for setting up parent-specific behaviors.\n * @param container - The parent container this was added to\n * @example\n * ```ts\n * const child = new Container();\n * child.on('added', (parent) => {\n * console.log('Child added to parent:', parent.label);\n * });\n * parentContainer.addChild(child);\n * ```\n */\n added: [container: Container];\n\n /**\n * Emitted when a child is added to this container.\n * Useful for tracking container composition changes.\n * @param child - The child that was added\n * @param container - The container the child was added to (this container)\n * @param index - The index at which the child was added\n * @example\n * ```ts\n * const parent = new Container();\n * parent.on('childAdded', (child, container, index) => {\n * console.log(`New child at index ${index}:`, child);\n * });\n * ```\n */\n childAdded: [child: C, container: Container, index: number];\n\n /**\n * Emitted when this container is removed from its parent.\n * Useful for cleanup and state management.\n * @param container - The parent container this was removed from\n * @example\n * ```ts\n * const child = new Container();\n * child.on('removed', (oldParent) => {\n * console.log('Child removed from parent:', oldParent.label);\n * });\n * ```\n */\n removed: [container: Container];\n\n /**\n * Emitted when a child is removed from this container.\n * Useful for cleanup and maintaining container state.\n * @param child - The child that was removed\n * @param container - The container the child was removed from (this container)\n * @param index - The index from which the child was removed\n * @example\n * ```ts\n * const parent = new Container();\n * parent.on('childRemoved', (child, container, index) => {\n * console.log(`Child removed from index ${index}:`, child);\n * });\n * ```\n */\n childRemoved: [child: C, container: Container, index: number];\n\n /**\n * Emitted when the container is destroyed.\n * Useful for final cleanup and resource management.\n * @param container - The container that was destroyed\n * @example\n * ```ts\n * const container = new Container();\n * container.on('destroyed', (container) => {\n * console.log('Container destroyed:', container.label);\n * });\n * ```\n */\n destroyed: [container: Container];\n}\n\ntype AnyEvent = {\n // The following is a hack to allow any custom event while maintaining type safety.\n // For some reason, the tsc compiler gets angry about error TS1023\n // \"An index signature parameter type must be either 'string' or 'number'.\"\n // This is really odd since ({}&string) should interpret as string, but then again\n // there is some black magic behind why this works in the first place.\n // Closest thing to an explanation:\n // https://stackoverflow.com/questions/70144348/why-does-a-union-of-type-literals-and-string-cause-ide-code-completion-wh\n //\n // Side note, we disable @typescript-eslint/ban-types since {}&string is the only syntax that works.\n // Nor of the Record/unknown/never alternatives work.\n [K: ({} & string) | ({} & symbol)]: any;\n};\n\n/** @internal */\nexport const UPDATE_COLOR = 0b0001;\n/** @internal */\nexport const UPDATE_BLEND = 0b0010;\n/** @internal */\nexport const UPDATE_VISIBLE = 0b0100;\n/** @internal */\nexport const UPDATE_TRANSFORM = 0b1000;\n\n/**\n * Options for updating the transform of a container.\n * @category scene\n * @standard\n */\nexport interface UpdateTransformOptions\n{\n x: number;\n y: number;\n scaleX: number;\n scaleY: number;\n rotation: number;\n skewX: number;\n skewY: number;\n pivotX: number;\n pivotY: number;\n originX: number;\n originY: number;\n}\n\n/**\n * Constructor options used for `Container` instances.\n * ```js\n * const container = new Container({\n * position: new Point(100, 200),\n * scale: new Point(2, 2),\n * rotation: Math.PI / 2,\n * });\n * ```\n * @category scene\n * @standard\n * @see Container\n */\nexport interface ContainerOptions<C extends ContainerChild = ContainerChild> extends PixiMixins.ContainerOptions\n{\n /** @see Container#isRenderGroup */\n isRenderGroup?: boolean;\n\n /**\n * The blend mode to be applied to the sprite. Controls how pixels are blended when rendering.\n *\n * Setting to 'normal' will reset to default blending.\n * > [!NOTE] More blend modes are available after importing the `pixi.js/advanced-blend-modes` sub-export.\n * @example\n * ```ts\n * // Basic blend modes\n * new Container({ blendMode: 'normal' }); // Default blending\n * new Container({ blendMode: 'add' }); // Additive blending\n * new Container({ blendMode: 'multiply' }); // Multiply colors\n * new Container({ blendMode: 'screen' }); // Screen blend\n * ```\n * @default 'normal'\n * @see {@link Container#alpha} For transparency\n * @see {@link Container#tint} For color adjustments\n */\n blendMode?: BLEND_MODES;\n /**\n * The tint applied to the sprite.\n *\n * This can be any valid {@link ColorSource}.\n * @example\n * ```ts\n * new Container({ tint: 0xff0000 }); // Red tint\n * new Container({ tint: 'blue' }); // Blue tint\n * new Container({ tint: '#00ff00' }); // Green tint\n * new Container({ tint: 'rgb(0,0,255)' }); // Blue tint\n * ```\n * @default 0xFFFFFF\n * @see {@link Container#alpha} For transparency\n * @see {@link Container#visible} For visibility control\n */\n tint?: ColorSource;\n\n /**\n * The opacity of the object relative to its parent's opacity.\n * Value ranges from 0 (fully transparent) to 1 (fully opaque).\n * @example\n * ```ts\n * new Container({ alpha: 0.5 }); // 50% opacity\n * new Container({ alpha: 1 }); // Fully opaque\n * ```\n * @default 1\n * @see {@link Container#visible} For toggling visibility\n * @see {@link Container#renderable} For render control\n */\n alpha?: number;\n /**\n * The angle of the object in degrees.\n *\n * > [!NOTE] 'rotation' and 'angle' have the same effect on a display object;\n * > rotation is in radians, angle is in degrees.\n * @example\n * ```ts\n * new Container({ angle: 45 }); // Rotate 45 degrees\n * new Container({ angle: 90 }); // Rotate 90 degrees\n * ```\n */\n angle?: number;\n /**\n * The array of children of this container. Each child must be a Container or extend from it.\n *\n * The array is read-only, but its contents can be modified using Container methods.\n * @example\n * ```ts\n * new Container({\n * children: [\n * new Container(), // First child\n * new Container(), // Second child\n * ],\n * });\n * ```\n * @readonly\n * @see {@link Container#addChild} For adding children\n * @see {@link Container#removeChild} For removing children\n */\n children?: C[];\n /**\n * The display object container that contains this display object.\n * This represents the parent-child relationship in the display tree.\n * @readonly\n * @see {@link Container#addChild} For adding to a parent\n * @see {@link Container#removeChild} For removing from parent\n */\n parent?: Container;\n /**\n * Controls whether this object can be rendered. If false the object will not be drawn,\n * but the transform will still be updated. This is different from visible, which skips\n * transform updates.\n * @example\n * ```ts\n * new Container({ renderable: false }); // Will not be drawn, but transforms will update\n * ```\n * @default true\n * @see {@link Container#visible} For skipping transform updates\n * @see {@link Container#alpha} For transparency\n */\n renderable?: boolean;\n /**\n * The rotation of the object in radians.\n *\n * > [!NOTE] 'rotation' and 'angle' have the same effect on a display object;\n * > rotation is in radians, angle is in degrees.\n * @example\n * ```ts\n * new Container({ rotation: Math.PI / 4 }); // Rotate 45 degrees\n * new Container({ rotation: Math.PI / 2 }); // Rotate 90 degrees\n * ```\n */\n rotation?: number;\n /**\n * The scale factors of this object along the local coordinate axes.\n *\n * The default scale is (1, 1).\n * @example\n * ```ts\n * new Container({ scale: new Point(2, 2) }); // Scale by 2x\n * new Container({ scale: 0.5 }); // Scale by 0.5x\n * new Container({ scale: { x: 1.5, y: 1.5 } }); // Scale by 1.5x\n * ```\n */\n scale?: PointData | number;\n /**\n * The center of rotation, scaling, and skewing for this display object in its local space.\n * The `position` is the projection of `pivot` in the parent's local space.\n *\n * By default, the pivot is the origin (0, 0).\n * @example\n * ```ts\n * new Container({ pivot: new Point(100, 200) }); // Set pivot to (100, 200)\n * new Container({ pivot: 50 }); // Set pivot to (50, 50)\n * new Container({ pivot: { x: 150, y: 150 } }); // Set pivot to (150, 150)\n * ```\n */\n pivot?: PointData | number;\n /**\n * The origin point around which the container rotates and scales.\n * Unlike pivot, changing origin will not move the container's position.\n * @example\n * ```ts\n * new Container({ origin: new Point(100, 100) }); // Rotate around point (100,100)\n * new Container({ origin: 50 }); // Rotate around point (50, 50)\n * new Container({ origin: { x: 150, y: 150 } }); // Rotate around point (150, 150)\n * ```\n */\n origin?: PointData | number;\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n * @example\n * ```ts\n * new Container({ position: new Point(100, 200) }); // Set position to (100, 200)\n * new Container({ position: { x: 150, y: 150 } }); // Set position to (150, 150)\n * ```\n */\n position?: PointData;\n /**\n * The skew factor for the object in radians. Skewing is a transformation that distorts\n * the object by rotating it differently at each point, creating a non-uniform shape.\n * @example\n * ```ts\n * new Container({ skew: new Point(0.1, 0.2) }); // Skew by 0.1 radians on x and 0.2 radians on y\n * new Container({ skew: { x: 0.1, y: 0.2 } }); // Skew by 0.1 radians on x and 0.2 radians on y\n * ```\n * @default { x: 0, y: 0 }\n */\n skew?: PointData;\n /**\n * The visibility of the object. If false the object will not be drawn,\n * and the transform will not be updated.\n * @example\n * ```ts\n * new Container({ visible: false }); // Will not be drawn and transforms will not update\n * new Container({ visible: true }); // Will be drawn and transforms will update\n * ```\n * @default true\n * @see {@link Container#renderable} For render-only control\n * @see {@link Container#alpha} For transparency\n */\n visible?: boolean;\n /**\n * The position of the container on the x axis relative to the local coordinates of the parent.\n *\n * An alias to position.x\n * @example\n * ```ts\n * new Container({ x: 100 }); // Set x position to 100\n * ```\n */\n x?: number;\n /**\n * The position of the container on the y axis relative to the local coordinates of the parent.\n *\n * An alias to position.y\n * @example\n * ```ts\n * new Container({ y: 200 }); // Set y position to 200\n * ```\n */\n y?: number;\n /**\n * An optional bounds area for this container. Setting this rectangle will stop the renderer\n * from recursively measuring the bounds of each children and instead use this single boundArea.\n *\n * > [!IMPORTANT] This is great for optimisation! If for example you have a\n * > 1000 spinning particles and you know they all sit within a specific bounds,\n * > then setting it will mean the renderer will not need to measure the\n * > 1000 children to find the bounds. Instead it will just use the bounds you set.\n * @example\n * ```ts\n * const container = new Container({\n * boundsArea: new Rectangle(0, 0, 500, 500) // Set a fixed bounds area\n * });\n * ```\n */\n boundsArea?: Rectangle;\n}\n\n// eslint-disable-next-line requireExport/require-export-jsdoc, requireMemberAPI/require-member-api-doc\nexport interface Container<C extends ContainerChild>\n extends PixiMixins.Container<C>, EventEmitter<ContainerEvents<C> & AnyEvent> {}\n\n/**\n * Container is a general-purpose display object that holds children. It also adds built-in support for advanced\n * rendering features like masking and filtering.\n *\n * It is the base class of all display objects that act as a container for other objects, including Graphics\n * and Sprite.\n *\n * <details id=\"transforms\">\n *\n * <summary>Transforms</summary>\n *\n * The [transform]{@link Container#localTransform} of a display object describes the projection from its\n * local coordinate space to its parent's local coordinate space. The following properties are derived\n * from the transform:\n *\n * <table>\n * <thead>\n * <tr>\n * <th>Property</th>\n * <th>Description</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>[pivot]{@link Container#pivot}</td>\n * <td>\n * Invariant under rotation, scaling, and skewing. The projection of into the parent's space of the pivot\n * is equal to position, regardless of the other three transformations. In other words, It is the center of\n * rotation, scaling, and skewing.\n * </td>\n * </tr>\n * <tr>\n * <td>[position]{@link Container#position}</td>\n * <td>\n * Translation. This is the position of the [pivot]{@link Container#pivot} in the parent's local\n * space. The default value of the pivot is the origin (0,0). If the top-left corner of your display object\n * is (0,0) in its local space, then the position will be its top-left corner in the parent's local space.\n * </td>\n * </tr>\n * <tr>\n * <td>[scale]{@link Container#scale}</td>\n * <td>\n * Scaling. This will stretch (or compress) the display object's projection. The scale factors are along the\n * local coordinate axes. In other words, the display object is scaled before rotated or skewed. The center\n * of scaling is the [pivot]{@link Container#pivot}.\n * </td>\n * </tr>\n * <tr>\n * <td>[rotation]{@link Container#rotation}</td>\n * <td>\n * Rotation. This will rotate the display object's projection by this angle (in radians).\n * </td>\n * </tr>\n * <tr>\n * <td>[skew]{@link Container#skew}</td>\n * <td>\n * <p>Skewing. This can be used to deform a rectangular display object into a parallelogram.</p>\n * <p>\n * In PixiJS, skew has a slightly different behaviour than the conventional meaning. It can be\n * thought of the net rotation applied to the coordinate axes (separately). For example, if \"skew.x\" is\n * ⍺ and \"skew.y\" is β, then the line x = 0 will be rotated by ⍺ (y = -x*cot⍺) and the line y = 0 will be\n * rotated by β (y = x*tanβ). A line y = x*tanϴ (i.e. a line at angle ϴ to the x-axis in local-space) will\n * be rotated by an angle between ⍺ and β.\n * </p>\n * <p>\n * It can be observed that if skew is applied equally to both axes, then it will be equivalent to applying\n * a rotation. Indeed, if \"skew.x\" = -ϴ and \"skew.y\" = ϴ, it will produce an equivalent of \"rotation\" = ϴ.\n * </p>\n * <p>\n * Another quite interesting observation is that \"skew.x\", \"skew.y\", rotation are commutative operations. Indeed,\n * because rotation is essentially a careful combination of the two.\n * </p>\n * </td>\n * </tr>\n * <tr>\n * <td>[angle]{@link Container#angle}</td>\n * <td>Rotation. This is an alias for [rotation]{@link Container#rotation}, but in degrees.</td>\n * </tr>\n * <tr>\n * <td>[x]{@link Container#x}</td>\n * <td>Translation. This is an alias for position.x!</td>\n * </tr>\n * <tr>\n * <td>[y]{@link Container#y}</td>\n * <td>Translation. This is an alias for position.y!</td>\n * </tr>\n * <tr>\n * <td>[width]{@link Container#width}</td>\n * <td>\n * Implemented in [Container]{@link Container}. Scaling. The width property calculates scale.x by dividing\n * the \"requested\" width by the local bounding box width. It is indirectly an abstraction over scale.x, and there\n * is no concept of user-defined width.\n * </td>\n * </tr>\n * <tr>\n * <td>[height]{@link Container#height}</td>\n * <td>\n * Implemented in [Container]{@link Container}. Scaling. The height property calculates scale.y by dividing\n * the \"requested\" height by the local bounding box height. It is indirectly an abstraction over scale.y, and there\n * is no concept of user-defined height.\n * </td>\n * </tr>\n * </tbody>\n * </table>\n * </details>\n *\n * <details id=\"alpha\">\n * <summary>Alpha</summary>\n *\n * This alpha sets a display object's **relative opacity** w.r.t its parent. For example, if the alpha of a display\n * object is 0.5 and its parent's alpha is 0.5, then it will be rendered with 25% opacity (assuming alpha is not\n * applied on any ancestor further up the chain).\n * </details>\n *\n * <details id=\"visible\">\n * <summary>Renderable vs Visible</summary>\n *\n * The `renderable` and `visible` properties can be used to prevent a display object from being rendered to the\n * screen. However, there is a subtle difference between the two. When using `renderable`, the transforms of the display\n * object (and its children subtree) will continue to be calculated. When using `visible`, the transforms will not\n * be calculated.\n * ```ts\n * import { BlurFilter, Container, Graphics, Sprite } from 'pixi.js';\n *\n * const container = new Container();\n * const sprite = Sprite.from('https://s3-us-west-2.amazonaws.com/s.cdpn.io/693612/IaUrttj.png');\n *\n * sprite.width = 512;\n * sprite.height = 512;\n *\n * // Adds a sprite as a child to this container. As a result, the sprite will be rendered whenever the container\n * // is rendered.\n * container.addChild(sprite);\n *\n * // Blurs whatever is rendered by the container\n * container.filters = [new BlurFilter()];\n *\n * // Only the contents within a circle at the center should be rendered onto the screen.\n * container.mask = new Graphics()\n * .beginFill(0xffffff)\n * .drawCircle(sprite.width / 2, sprite.height / 2, Math.min(sprite.width, sprite.height) / 2)\n * .endFill();\n * ```\n *\n * </details>\n *\n * <details id=\"renderGroup\">\n * <summary>RenderGroup</summary>\n *\n * In PixiJS v8, containers can be set to operate in 'render group mode',\n * transforming them into entities akin to a stage in traditional rendering paradigms.\n * A render group is a root renderable entity, similar to a container,\n * but it's rendered in a separate pass with its own unique set of rendering instructions.\n * This approach enhances rendering efficiency and organization, particularly in complex scenes.\n *\n * You can enable render group mode on any container using container.enableRenderGroup()\n * or by initializing a new container with the render group property set to true (new Container({isRenderGroup: true})).\n * The method you choose depends on your specific use case and setup requirements.\n *\n * An important aspect of PixiJS’s rendering process is the automatic treatment of rendered scenes as render groups.\n * This conversion streamlines the rendering process, but understanding when and how this happens is crucial\n * to fully leverage its benefits.\n *\n * One of the key advantages of using render groups is the performance efficiency in moving them. Since transformations\n * are applied at the GPU level, moving a render group, even one with complex and numerous children,\n * doesn't require recalculating the rendering instructions or performing transformations on each child.\n * This makes operations like panning a large game world incredibly efficient.\n *\n * However, it's crucial to note that render groups do not batch together.\n * This means that turning every container into a render group could actually slow things down,\n * as each render group is processed separately. It's best to use render groups judiciously, at a broader level,\n * rather than on a per-child basis.\n * This approach ensures you get the performance benefits without overburdening the rendering process.\n *\n * RenderGroups maintain their own set of rendering instructions,\n * ensuring that changes or updates within a render group don't affect the rendering\n * instructions of its parent or other render groups.\n * This isolation ensures more stable and predictable rendering behavior.\n *\n * Additionally, renderGroups can be nested, allowing for powerful options in organizing different aspects of your scene.\n * This feature is particularly beneficial for separating complex game graphics from UI elements,\n * enabling intricate and efficient scene management in complex applications.\n *\n * This means that Containers have 3 levels of matrix to be mindful of:\n *\n * 1. localTransform, this is the transform of the container based on its own properties\n * 2. groupTransform, this it the transform of the container relative to the renderGroup it belongs too\n * 3. worldTransform, this is the transform of the container relative to the Scene being rendered\n * </details>\n * @category scene\n * @standard\n */\nexport class Container<C extends ContainerChild = ContainerChild> extends EventEmitter<ContainerEvents<C> & AnyEvent>\n{\n /**\n * Mixes all enumerable properties and methods from a source object to Container.\n * @param source - The source of properties and methods to mix in.\n * @deprecated since 8.8.0\n */\n public static mixin(source: Dict<any>): void\n {\n // #if _DEBUG\n deprecation('8.8.0', 'Container.mixin is deprecated, please use extensions.mixin instead.');\n // #endif\n extensions.mixin(Container, source);\n }\n\n /**\n * unique id for this container\n * @internal\n */\n public readonly uid: number = uid('renderable');\n\n /** @private */\n public _updateFlags = 0b1111;\n\n // the render group this container owns\n /** @private */\n public renderGroup: RenderGroup = null;\n // the render group this container belongs to\n /** @private */\n public parentRenderGroup: RenderGroup = null;\n // the index of the container in the render group\n /** @private */\n public parentRenderGroupIndex: number = 0;\n\n // set to true if the container has changed. It is reset once the changes have been applied\n // by the transform system\n // its here to stop ensure that when things change, only one update gets registers with the transform system\n /** @private */\n public didChange = false;\n // same as above, but for the renderable\n /** @private */\n public didViewUpdate = false;\n\n // how deep is the container relative to its render group..\n // unless the element is the root render group - it will be relative to its parent\n /** @private */\n public relativeRenderGroupDepth = 0;\n\n /**\n * The array of children of this container. Each child must be a Container or extend from it.\n *\n * The array is read-only, but its contents can be modified using Container methods.\n * @example\n * ```ts\n * // Access children\n * const firstChild = container.children[0];\n * const lastChild = container.children[container.children.length - 1];\n * ```\n * @readonly\n * @see {@link Container#addChild} For adding children\n * @see {@link Container#removeChild} For removing children\n */\n public children: C[] = [];\n /**\n * The display object container that contains this display object.\n * This represents the parent-child relationship in the display tree.\n * @example\n * ```ts\n * // Basic parent access\n * const parent = sprite.parent;\n *\n * // Walk up the tree\n * let current = sprite;\n * while (current.parent) {\n * console.log('Level up:', current.parent.constructor.name);\n * current = current.parent;\n * }\n * ```\n * @readonly\n * @see {@link Container#addChild} For adding to a parent\n * @see {@link Container#removeChild} For removing from parent\n */\n public parent: Container | null = null;\n\n // used internally for changing up the render order.. mainly for masks and filters\n // TODO setting this should cause a rebuild??\n /** @private */\n public includeInBuild = true;\n /** @private */\n public measurable = true;\n /** @private */\n public isSimple = true;\n\n /**\n * The RenderLayer this container belongs to, if any.\n * If it belongs to a RenderLayer, it will be rendered from the RenderLayer's position in the scene.\n * @readonly\n * @advanced\n */\n public parentRenderLayer: RenderLayer | null = null;\n\n // / /////////////Transform related props//////////////\n\n // used by the transform system to check if a container needs to be updated that frame\n // if the tick matches the current transform system tick, it is not updated again\n /** @internal */\n public updateTick = -1;\n\n /**\n * Current transform of the object based on local factors: position, scale, other stuff.\n * This matrix represents the local transformation without any parent influence.\n * @example\n * ```ts\n * // Basic transform access\n * const localMatrix = sprite.localTransform;\n * console.log(localMatrix.toString());\n * ```\n * @readonly\n * @see {@link Container#worldTransform} For global transform\n * @see {@link Container#groupTransform} For render group transform\n */\n public localTransform: Matrix = new Matrix();\n /**\n * The relative group transform is a transform relative to the render group it belongs too. It will include all parent\n * transforms and up to the render group (think of it as kind of like a stage - but the stage can be nested).\n * If this container is is self a render group matrix will be relative to its parent render group\n * @readonly\n * @advanced\n */\n public relativeGroupTransform: Matrix = new Matrix();\n /**\n * The group transform is a transform relative to the render group it belongs too.\n * If this container is render group then this will be an identity matrix. other wise it\n * will be the same as the relativeGroupTransform.\n * Use this value when actually rendering things to the screen\n * @readonly\n * @advanced\n */\n public groupTransform: Matrix = this.relativeGroupTransform;\n\n // the global transform taking into account the render group and all parents\n private _worldTransform: Matrix;\n\n /**\n * Whether this object has been destroyed. If true, the object should no longer be used.\n * After an object is destroyed, all of its functionality is disabled and references are removed.\n * @example\n * ```ts\n * // Cleanup with destroy\n * sprite.destroy();\n * console.log(sprite.destroyed); // true\n * ```\n * @default false\n * @see {@link Container#destroy} For destroying objects\n */\n public destroyed = false;\n\n // transform data..\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n * @internal\n */\n public _position: ObservablePoint = new ObservablePoint(this, 0, 0);\n\n /**\n * The scale factor of the object.\n * @internal\n */\n public _scale: ObservablePoint = defaultScale;\n\n /**\n * The pivot point of the container that it rotates around.\n * @internal\n */\n public _pivot: ObservablePoint = defaultPivot;\n\n /**\n * The origin point around which the container rotates and scales.\n * Unlike pivot, changing origin will not move the container's position.\n * @private\n */\n public _origin: ObservablePoint = defaultOrigin;\n\n /**\n * The skew amount, on the x and y axis.\n * @internal\n */\n public _skew: ObservablePoint = defaultSkew;\n\n /**\n * The X-coordinate value of the normalized local X axis,\n * the first column of the local transformation matrix without a scale.\n * @internal\n */\n public _cx = 1;\n\n /**\n * The Y-coordinate value of the normalized local X axis,\n * the first column of the local transformation matrix without a scale.\n * @internal\n */\n public _sx = 0;\n\n /**\n * The X-coordinate value of the normalized local Y axis,\n * the second column of the local transformation matrix without a scale.\n * @internal\n */\n public _cy = 0;\n\n /**\n * The Y-coordinate value of the normalized local Y axis,\n * the second column of the local transformation matrix without a scale.\n * @internal\n */\n public _sy = 1;\n\n /**\n * The rotation amount.\n * @internal\n */\n private _rotation = 0;\n\n // / COLOR related props //////////////\n\n // color stored as ABGR\n /** @internal */\n public localColor = 0xFFFFFF;\n /** @internal */\n public localAlpha = 1;\n\n /** @internal */\n public groupAlpha = 1; // A\n /** @internal */\n public groupColor = 0xFFFFFF; // BGR\n /** @internal */\n public groupColorAlpha = 0xFFFFFFFF; // ABGR\n\n // / BLEND related props //////////////\n\n /** @internal */\n public localBlendMode: BLEND_MODES = 'inherit';\n /** @internal */\n public groupBlendMode: BLEND_MODES = 'normal';\n\n // / VISIBILITY related props //////////////\n\n // visibility\n // 0b11\n // first bit is visible, second bit is renderable\n /**\n * This property holds three bits: culled, visible, renderable\n * the third bit represents culling (0 = culled, 1 = not culled) 0b100\n * the second bit represents visibility (0 = not visible, 1 = visible) 0b010\n * the first bit represents renderable (0 = not renderable, 1 = renderable) 0b001\n * @internal\n */\n public localDisplayStatus = 0b111; // 0b11 | 0b10 | 0b01 | 0b00\n /** @internal */\n public globalDisplayStatus = 0b111; // 0b11 | 0b10 | 0b01 | 0b00\n\n /** @internal */\n public readonly renderPipeId: string;\n\n /**\n * An optional bounds area for this container. Setting this rectangle will stop the renderer\n * from recursively measuring the bounds of each children and instead use this single boundArea.\n *\n * > [!IMPORTANT] This is great for optimisation! If for example you have a\n * > 1000 spinning particles and you know they all sit within a specific bounds,\n * > then setting it will mean the renderer will not need to measure the\n * > 1000 children to find the bounds. Instead it will just use the bounds you set.\n * @example\n * ```ts\n * const container = new Container();\n * container.boundsArea = new Rectangle(0, 0, 500, 500);\n * ```\n */\n public boundsArea: Rectangle;\n\n /**\n * A value that increments each time the containe is modified\n * eg children added, removed etc\n * @ignore\n */\n public _didContainerChangeTick = 0;\n /**\n * A value that increments each time the container view is modified\n * eg texture swap, geometry change etc\n * @ignore\n */\n public _didViewChangeTick = 0;\n\n /** @internal */\n public layerParentId: string;// = 'default';\n /**\n * We now use the _didContainerChangeTick and _didViewChangeTick to track changes\n * @deprecated since 8.2.6\n * @ignore\n */\n set _didChangeId(value: number)\n {\n this._didViewChangeTick = (value >> 12) & 0xFFF; // Extract the upper 12 bits\n this._didContainerChangeTick = value & 0xFFF; // Extract the lower 12 bits\n }\n /** @ignore */\n get _didChangeId(): number\n {\n return (this._didContainerChangeTick & 0xfff) | ((this._didViewChangeTick & 0xfff) << 12);\n }\n\n /**\n * property that tracks if the container transform has changed\n * @ignore\n */\n private _didLocalTransformChangeId = -1;\n\n constructor(options: ContainerOptions<C> = {})\n {\n super();\n\n this.effects = [];\n assignWithIgnore(this, options, {\n children: true,\n parent: true,\n effects: true,\n });\n\n options.children?.forEach((child) => this.addChild(child));\n options.parent?.addChild(this);\n }\n\n /**\n * Adds one or more children to the container.\n * The children will be rendered as part of this container's display list.\n * @example\n * ```ts\n * // Add a single child\n * container.addChild(sprite);\n *\n * // Add multiple children\n * container.addChild(background, player, foreground);\n *\n * // Add with type checking\n * const sprite = container.addChild<Sprite>(new Sprite(texture));\n * sprite.tint = 'red';\n * ```\n * @param children - The Container(s) to add to the container\n * @returns The first child that was added\n * @see {@link Container#removeChild} For removing children\n * @see {@link Container#addChildAt} For adding at specific index\n */\n public addChild<U extends C[]>(...children: U): U[0]\n {\n // #if _DEBUG\n if (!this.allowChildren)\n {\n deprecation(v8_0_0, 'addChild: Only Containers will be allowed to add children in v8.0.0');\n }\n // #endif\n\n if (children.length > 1)\n {\n // loop through the array and add all children\n for (let i = 0; i < children.length; i++)\n {\n this.addChild(children[i]);\n }\n\n return children[0];\n }\n\n const child = children[0];\n\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n if (child.parent === this)\n {\n this.children.splice(this.children.indexOf(child), 1);\n this.children.push(child);\n\n if (renderGroup)\n {\n renderGroup.structureDidChange = true;\n }\n\n return child;\n }\n\n if (child.parent)\n {\n // TODO Optimisation...if the parent has the same render group, this does not need to change!\n child.parent.removeChild(child);\n }\n\n this.children.push(child);\n\n if (this.sortableChildren) this.sortDirty = true;\n\n child.parent = this;\n\n child.didChange = true;\n\n // TODO - Optimise this? could check what the parent has set?\n child._updateFlags = 0b1111;\n\n if (renderGroup)\n {\n renderGroup.addChild(child);\n }\n\n this.emit('childAdded', child, this, this.children.length - 1);\n child.emit('added', this);\n\n this._didViewChangeTick++;\n\n if (child._zIndex !== 0)\n {\n child.depthOfChildModified();\n }\n\n return child;\n }\n\n /**\n * Removes one or more children from the container.\n * When removing multiple children, events will be triggered for each child in sequence.\n * @example\n * ```ts\n * // Remove a single child\n * const removed = container.removeChild(sprite);\n *\n * // Remove multiple children\n * const bg = container.removeChild(background, player, userInterface);\n *\n * // Remove with type checking\n * const sprite = container.removeChild<Sprite>(childSprite);\n * sprite.texture = newTexture;\n * ```\n * @param children - The Container(s) to remove\n * @returns The first child that was removed\n * @see {@link Container#addChild} For adding children\n * @see {@link Container#removeChildren} For removing multiple children\n */\n public removeChild<U extends C[]>(...children: U): U[0]\n {\n // if there is only one argument we can bypass looping through the them\n if (children.length > 1)\n {\n // loop through the arguments property and remove all children\n for (let i = 0; i < children.length; i++)\n {\n this.removeChild(children[i]);\n }\n\n return children[0];\n }\n\n const child = children[0];\n\n const index = this.children.indexOf(child);\n\n if (index > -1)\n {\n this._didViewChangeTick++;\n\n this.children.splice(index, 1);\n\n if (this.renderGroup)\n {\n this.renderGroup.removeChild(child);\n }\n else if (this.parentRenderGroup)\n {\n this.parentRenderGroup.removeChild(child);\n }\n\n if (child.parentRenderLayer)\n {\n child.parentRenderLayer.detach(child);\n }\n\n child.parent = null;\n this.emit('childRemoved', child, this, index);\n child.emit('removed', this);\n }\n\n return child;\n }\n\n /** @ignore */\n public _onUpdate(point?: ObservablePoint)\n {\n if (point)\n {\n // this.updateFlags |= UPDATE_TRANSFORM;\n\n if (point === this._skew)\n {\n this._updateSkew();\n }\n }\n\n this._didContainerChangeTick++;\n\n if (this.didChange) return;\n this.didChange = true;\n\n if (this.parentRenderGroup)\n {\n this.parentRenderGroup.onChildUpdate(this);\n }\n }\n\n set isRenderGroup(value: boolean)\n {\n if (!!this.renderGroup === value) return;\n\n if (value)\n {\n this.enableRenderGroup();\n }\n else\n {\n this.disableRenderGroup();\n }\n }\n\n /**\n * Returns true if this container is a render group.\n * This means that it will be rendered as a separate pass, with its own set of instructions\n * @advanced\n */\n get isRenderGroup(): boolean\n {\n return !!this.renderGroup;\n }\n\n /**\n * Calling this enables a render group for this container.\n * This means it will be rendered as a separate set of instructions.\n * The transform of the container will also be handled on the GPU rather than the CPU.\n * @advanced\n */\n public enableRenderGroup(): void\n {\n if (this.renderGroup) return;\n\n const parentRenderGroup = this.parentRenderGroup;\n\n parentRenderGroup?.removeChild(this);\n\n this.renderGroup = BigPool.get(RenderGroup, this);\n\n // this group matrix will now be an identity matrix,\n // as its own transform will be passed to the GPU\n this.groupTransform = Matrix.IDENTITY;\n\n parentRenderGroup?.addChild(this);\n\n this._updateIsSimple();\n }\n\n /**\n * This will disable the render group for this container.\n * @advanced\n */\n public disableRenderGroup(): void\n {\n if (!this.renderGroup) return;\n\n const parentRenderGroup = this.parentRenderGroup;\n\n parentRenderGroup?.removeChild(this);\n\n BigPool.return(this.renderGroup);\n\n this.renderGroup = null;\n this.groupTransform = this.relativeGroupTransform;\n\n parentRenderGroup?.addChild(this);\n\n this._updateIsSimple();\n }\n\n /** @ignore */\n public _updateIsSimple()\n {\n this.isSimple = !(this.renderGroup) && (this.effects.length === 0);\n }\n\n /**\n * Current transform of the object based on world (parent) factors.\n *\n * This matrix represents the absolute transformation in the scene graph.\n * @example\n * ```ts\n * // Get world position\n * const worldPos = container.worldTransform;\n * console.log(`World position: (${worldPos.tx}, ${worldPos.ty})`);\n * ```\n * @readonly\n * @see {@link Container#localTransform} For local space transform\n */\n get worldTransform()\n {\n this._worldTransform ||= new Matrix();\n\n if (this.renderGroup)\n {\n this._worldTransform.copyFrom(this.renderGroup.worldTransform);\n }\n else if (this.parentRenderGroup)\n {\n this._worldTransform.appendFrom(this.relativeGroupTransform, this.parentRenderGroup.worldTransform);\n }\n\n return this._worldTransform;\n }\n\n /**\n * The position of the container on the x axis relative to the local coordinates of the parent.\n *\n * An alias to position.x\n * @example\n * ```ts\n * // Basic position\n * container.x = 100;\n * ```\n */\n get x(): number\n {\n return this._position.x;\n }\n\n set x(value: number)\n {\n this._position.x = value;\n }\n\n /**\n * The position of the container on the y axis relative to the local coordinates of the parent.\n *\n * An alias to position.y\n * @example\n * ```ts\n * // Basic position\n * container.y = 200;\n * ```\n */\n get y(): number\n {\n return this._position.y;\n }\n\n set y(value: number)\n {\n this._position.y = value;\n }\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n * @example\n * ```ts\n * // Basic position setting\n * container.position.set(100, 200);\n * container.position.set(100); // Sets both x and y to 100\n * // Using point data\n * container.position = { x: 50, y: 75 };\n * ```\n * @since 4.0.0\n */\n get position(): ObservablePoint\n {\n return this._position;\n }\n\n set position(value: PointData)\n {\n this._position.copyFrom(value);\n }\n\n /**\n * The rotation of the object in radians.\n *\n * > [!NOTE] 'rotation' and 'angle' have the same effect on a display object;\n * > rotation is in radians, angle is in degrees.\n * @example\n * ```ts\n * // Basic rotation\n * container.rotation = Math.PI / 4; // 45 degrees\n *\n * // Convert from degrees\n * const degrees = 45;\n * container.rotation = degrees * Math.PI / 180;\n *\n * // Rotate around center\n * container.pivot.set(container.width / 2, container.height / 2);\n * container.rotation = Math.PI; // 180 degrees\n *\n * // Rotate around center with origin\n * container.origin.set(container.width / 2, container.height / 2);\n * container.rotation = Math.PI; // 180 degrees\n * ```\n */\n get rotation(): number\n {\n return this._rotation;\n }\n\n set rotation(value: number)\n {\n if (this._rotation !== value)\n {\n this._rotation = value;\n this._onUpdate(this._skew);\n }\n }\n\n /**\n * The angle of the object in degrees.\n *\n * > [!NOTE] 'rotation' and 'angle' have the same effect on a display object;\n * > rotation is in radians, angle is in degrees.\n * @example\n * ```ts\n * // Basic angle rotation\n * sprite.angle = 45; // 45 degrees\n *\n * // Rotate around center\n * sprite.pivot.set(sprite.width / 2, sprite.height / 2);\n * sprite.angle = 180; // Half rotation\n *\n * // Rotate around center with origin\n * sprite.origin.set(sprite.width / 2, sprite.height / 2);\n * sprite.angle = 180; // Half rotation\n *\n * // Reset rotation\n * sprite.angle = 0;\n * ```\n */\n get angle(): number\n {\n return this.rotation * RAD_TO_DEG;\n }\n\n set angle(value: number)\n {\n this.rotation = value * DEG_TO_RAD;\n }\n\n /**\n * The center of rotation, scaling, and skewing for this display object in its local space.\n * The `position` is the projection of `pivot` in the parent's local space.\n *\n * By default, the pivot is the origin (0, 0).\n * @example\n * ```ts\n * // Rotate around center\n * container.pivot.set(container.width / 2, container.height / 2);\n * container.rotation = Math.PI; // Rotates around center\n * ```\n * @since 4.0.0\n */\n get pivot(): ObservablePoint\n {\n if (this._pivot === defaultPivot)\n {\n this._pivot = new ObservablePoint(this, 0, 0);\n }\n\n return this._pivot;\n }\n\n set pivot(value: PointData | number)\n {\n if (this._pivot === defaultPivot)\n {\n this._pivot = new ObservablePoint(this, 0, 0);\n\n // #if _DEBUG\n if (this._origin !== defaultOrigin)\n {\n // eslint-disable-next-line max-len\n warn(`Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.`);\n }\n // #endif\n }\n\n typeof value === 'number' ? this._pivot.set(value) : this._pivot.copyFrom(value);\n }\n\n /**\n * The skew factor for the object in radians. Skewing is a transformation that distorts\n * the object by rotating it differently at each point, creating a non-uniform shape.\n * @example\n * ```ts\n * // Basic skewing\n * container.skew.set(0.5, 0); // Skew horizontally\n * container.skew.set(0, 0.5); // Skew vertically\n *\n * // Skew with point data\n * container.skew = { x: 0.3, y: 0.3 }; // Diagonal skew\n *\n * // Reset skew\n * container.skew.set(0, 0);\n *\n * // Animate skew\n * app.ticker.add(() => {\n * // Create wave effect\n * container.skew.x = Math.sin(Date.now() / 1000) * 0.3;\n * });\n *\n * // Combine with rotation\n * container.rotation = Math.PI / 4; // 45 degrees\n * container.skew.set(0.2, 0.2); // Skew the rotated object\n * ```\n * @since 4.0.0\n * @type {ObservablePoint} Point-like object with x/y properties in radians\n * @default {x: 0, y: 0}\n */\n get skew(): ObservablePoint\n {\n if (this._skew === defaultSkew)\n {\n this._skew = new ObservablePoint(this, 0, 0);\n }\n\n return this._skew;\n }\n\n set skew(value: PointData)\n {\n if (this._skew === defaultSkew)\n {\n this._skew = new ObservablePoint(this, 0, 0);\n }\n\n this._skew.copyFrom(value);\n }\n\n /**\n * The scale factors of this object along the local coordinate axes.\n *\n * The default scale is (1, 1).\n * @example\n * ```ts\n * // Basic scaling\n * container.scale.set(2, 2); // Scales to double size\n * container.scale.set(2); // Scales uniformly to double size\n * container.scale = 2; // Scales uniformly to double size\n * // Scale to a specific width and height\n * container.setSize(200, 100); // Sets width to 200 and height to 100\n * ```\n * @since 4.0.0\n */\n get scale(): ObservablePoint\n {\n if (this._scale === defaultScale)\n {\n this._scale = new ObservablePoint(this, 1, 1);\n }\n\n return this._scale;\n }\n\n set scale(value: PointData | number | string)\n {\n if (this._scale === defaultScale)\n {\n this._scale = new ObservablePoint(this, 0, 0);\n }\n\n if (typeof value === 'string')\n {\n value = parseFloat(value);\n }\n\n typeof value === 'number' ? this._scale.set(value) : this._scale.copyFrom(value);\n }\n\n /**\n * @experimental\n * The origin point around which the container rotates and scales without affecting its position.\n * Unlike pivot, changing the origin will not move the container's position.\n * @example\n * ```ts\n * // Rotate around center point\n * container.origin.set(container.width / 2, container.height / 2);\n * container.rotation = Math.PI; // Rotates around center\n *\n * // Reset origin\n * container.origin.set(0, 0);\n * ```\n */\n get origin(): ObservablePoint\n {\n if (this._origin === defaultOrigin)\n {\n this._origin = new ObservablePoint(this, 0, 0);\n }\n\n return this._origin;\n }\n\n set origin(value: PointData | number)\n {\n if (this._origin === defaultOrigin)\n {\n this._origin = new ObservablePoint(this, 0, 0);\n\n // #if _DEBUG\n if (this._pivot !== defaultPivot)\n {\n // eslint-disable-next-line max-len\n warn(`Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.`);\n }\n // #endif\n }\n\n typeof value === 'number' ? this._origin.set(value) : this._origin.copyFrom(value);\n }\n\n /**\n * The width of the Container, setting this will actually modify the scale to achieve the value set.\n * > [!NOTE] Changing the width will adjust the scale.x property of the container while maintaining its aspect ratio.\n * > [!NOTE] If you want to set both width and height at the same time, use {@link Container#setSize}\n * as it is more optimized by not recalculating the local bounds twice.\n * @example\n * ```ts\n * // Basic width setting\n * container.width = 100;\n * // Optimized width setting\n * container.setSize(100, 100);\n * ```\n */\n get width(): number\n {\n return Math.abs(this.scale.x * this.getLocalBounds().width);\n }\n\n set width(value: number)\n {\n const localWidth = this.getLocalBounds().width;\n\n this._setWidth(value, localWidth);\n }\n\n /**\n * The height of the Container,\n * > [!NOTE] Changing the height will adjust the scale.y property of the container while maintaining its aspect ratio.\n * > [!NOTE] If you want to set both width and height at the same time, use {@link Container#setSize}\n * as it is more optimized by not recalculating the local bounds twice.\n * @example\n * ```ts\n * // Basic height setting\n * container.height = 200;\n * // Optimized height setting\n * container.setSize(100, 200);\n * ```\n */\n get height(): number\n {\n return Math.abs(this.scale.y * this.getLocalBounds().height);\n }\n\n set height(value: number)\n {\n const localHeight = this.getLocalBounds().height;\n\n this._setHeight(value, localHeight);\n }\n\n /**\n * Retrieves the size of the container as a [Size]{@link Size} object.\n *\n * This is faster than get the width and height separately.\n * @example\n * ```ts\n * // Basic size retrieval\n * const size = container.getSize();\n * console.log(`Size: ${size.width}x${size.height}`);\n *\n * // Reuse existing size object\n * const reuseSize = { width: 0, height: 0 };\n * container.getSize(reuseSize);\n * ```\n * @param out - Optional object to store the size in.\n * @returns The size of the container.\n */\n public getSize(out?: Size): Size\n {\n if (!out)\n {\n out = {} as Size;\n }\n\n const bounds = this.getLocalBounds();\n\n out.width = Math.abs(this.scale.x * bounds.width);\n out.height = Math.abs(this.scale.y * bounds.height);\n\n return out;\n }\n\n /**\n * Sets the size of the container to the specified width and height.\n * This is more efficient than setting width and height separately as it only recalculates bounds once.\n * @example\n * ```ts\n * // Basic size setting\n * container.setSize(100, 200);\n *\n * // Set uniform size\n * container.setSize(100); // Sets both width and height to 100\n * ```\n * @param value - This can be either a number or a [Size]{@link Size} object.\n * @param height - The height to set. Defaults to the value of `width` if not provided.\n */\n public setSize(value: number | Optional<Size, 'height'>, height?: number)\n {\n const size = this.getLocalBounds();\n\n if (typeof value === 'object')\n {\n height = value.height ?? value.width;\n value = value.width;\n }\n else\n {\n height ??= value;\n }\n\n value !== undefined && this._setWidth(value, size.width);\n height !== undefined && this._setHeight(height, size.height);\n }\n\n /** Called when the skew or the rotation changes. */\n private _updateSkew(): void\n {\n const rotation = this._rotation;\n const skew = this._skew;\n\n this._cx = Math.cos(rotation + skew._y);\n this._sx = Math.sin(rotation + skew._y);\n this._cy = -Math.sin(rotation - skew._x); // cos, added PI/2\n this._sy = Math.cos(rotation - skew._x); // sin, added PI/2\n }\n\n /**\n * Updates the transform properties of the container.\n * Allows partial updates of transform properties for optimized manipulation.\n * @example\n * ```ts\n * // Basic transform update\n * container.updateTransform({\n * x: 100,\n * y: 200,\n * rotation: Math.PI / 4\n * });\n *\n * // Scale and rotate around center\n * sprite.updateTransform({\n * pivotX: sprite.width / 2,\n * pivotY: sprite.height / 2,\n * scaleX: 2,\n * scaleY: 2,\n * rotation: Math.PI\n * });\n *\n * // Update position only\n * button.updateTransform({\n * x: button.x + 10, // Move right\n * y: button.y // Keep same y\n * });\n * ```\n * @param opts - Transform options to update\n * @param opts.x - The x position\n * @param opts.y - The y position\n * @param opts.scaleX - The x-axis scale factor\n * @param opts.scaleY - The y-axis scale factor\n * @param opts.rotation - The rotation in radians\n * @param opts.skewX - The x-axis skew factor\n * @param opts.skewY - The y-axis skew factor\n * @param opts.pivotX - The x-axis pivot point\n * @param opts.pivotY - The y-axis pivot point\n * @returns This container, for chaining\n * @see {@link Container#setFromMatrix} For matrix-based transforms\n * @see {@link Container#position} For direct position access\n */\n public updateTransform(opts: Partial<UpdateTransformOptions>): this\n {\n this.position.set(\n typeof opts.x === 'number' ? opts.x : this.position.x,\n typeof opts.y === 'number' ? opts.y : this.position.y\n );\n this.scale.set(\n typeof opts.scaleX === 'number' ? opts.scaleX || 1 : this.scale.x,\n typeof opts.scaleY === 'number' ? opts.scaleY || 1 : this.scale.y\n );\n this.rotation = typeof opts.rotation === 'number' ? opts.rotation : this.rotation;\n this.skew.set(\n typeof opts.skewX === 'number' ? opts.skewX : this.skew.x,\n typeof opts.skewY === 'number' ? opts.skewY : this.skew.y\n );\n this.pivot.set(\n typeof opts.pivotX === 'number' ? opts.pivotX : this.pivot.x,\n typeof opts.pivotY === 'number' ? opts.pivotY : this.pivot.y\n );\n this.origin.set(\n typeof opts.originX === 'number' ? opts.originX : this.origin.x,\n typeof opts.originY === 'number' ? opts.originY : this.origin.y\n );\n\n return this;\n }\n\n /**\n * Updates the local transform properties by decomposing the given matrix.\n * Extracts position, scale, rotation, and skew from a transformation matrix.\n * @example\n * ```ts\n * // Basic matrix transform\n * const matrix = new Matrix()\n * .translate(100, 100)\n * .rotate(Math.PI / 4)\n * .scale(2, 2);\n *\n * container.setFromMatrix(matrix);\n *\n * // Copy transform from another container\n * const source = new Container();\n * source.position.set(100, 100);\n * source.rotation = Math.PI / 2;\n *\n * target.setFromMatrix(source.localTransform);\n *\n * // Reset transform\n * container.setFromMatrix(Matrix.IDENTITY);\n * ```\n * @param matrix - The matrix to use for updating the transform\n * @see {@link Container#updateTransform} For property-based updates\n * @see {@link Matrix#decompose} For matrix decomposition details\n */\n public setFromMatrix(matrix: Matrix): void\n {\n matrix.decompose(this);\n }\n\n /** Updates the local transform. */\n public updateLocalTransform(): void\n {\n const localTransformChangeId = this._didContainerChangeTick;\n\n if (this._didLocalTransformChangeId === localTransformChangeId) return;\n\n this._didLocalTransformChangeId = localTransformChangeId;\n\n const lt = this.localTransform;\n const scale = this._scale;\n const pivot = this._pivot;\n const origin = this._origin;\n const position = this._position;\n\n const sx = scale._x;\n const sy = scale._y;\n\n const px = pivot._x;\n const py = pivot._y;\n\n const ox = -origin._x;\n const oy = -origin._y;\n\n // get the matrix values of the container based on its this properties..\n lt.a = this._cx * sx;\n lt.b = this._sx * sx;\n lt.c = this._cy * sy;\n lt.d = this._sy * sy;\n\n lt.tx = position._x - ((px * lt.a) + (py * lt.c)) // Pivot offset\n + ((ox * lt.a) + (oy * lt.c)) // Origin offset for rotation and scaling\n - ox; // Remove origin to maintain position\n lt.ty = position._y - ((px * lt.b) + (py * lt.d)) // Pivot offset\n + ((ox * lt.b) + (oy * lt.d)) // Origin offset for rotation and scaling\n - oy; // Remove origin to maintain position\n }\n\n // / ///// color related stuff\n\n set alpha(value: number)\n {\n if (value === this.localAlpha) return;\n\n this.localAlpha = value;\n\n this._updateFlags |= UPDATE_COLOR;\n\n this._onUpdate();\n }\n\n /**\n * The opacity of the object relative to its parent's opacity.\n * Value ranges from 0 (fully transparent) to 1 (fully opaque).\n * @example\n * ```ts\n * // Basic transparency\n * sprite.alpha = 0.5; // 50% opacity\n *\n * // Inherited opacity\n * container.alpha = 0.5;\n * const child = new Sprite(texture);\n * child.alpha = 0.5;\n * container.addChild(child);\n * // child's effective opacity is 0.25 (0.5 * 0.5)\n * ```\n * @default 1\n * @see {@link Container#visible} For toggling visibility\n * @see {@link Container#renderable} For render control\n */\n get alpha(): number\n {\n return this.localAlpha;\n }\n\n set tint(value: ColorSource)\n {\n const tempColor = Color.shared.setValue(value ?? 0xFFFFFF);\n const bgr = tempColor.toBgrNumber();\n\n if (bgr === this.localColor) return;\n\n this.localColor = bgr;\n\n this._updateFlags |= UPDATE_COLOR;\n\n this._onUpdate();\n }\n\n /**\n * The tint applied to the sprite.\n *\n * This can be any valid {@link ColorSource}.\n * @example\n * ```ts\n * // Basic color tinting\n * container.tint = 0xff0000; // Red tint\n * container.tint = 'red'; // Same as above\n * container.tint = '#00ff00'; // Green\n * container.tint = 'rgb(0,0,255)'; // Blue\n *\n * // Remove tint\n * container.tint = 0xffffff; // White = no tint\n * container.tint = null; // Also removes tint\n * ```\n * @default 0xFFFFFF\n * @see {@link Container#alpha} For transparency\n * @see {@link Container#visible} For visibility control\n */\n get tint(): number\n {\n // convert bgr to rgb..\n return bgr2rgb(this.localColor);\n }\n\n // / //////////////// blend related stuff\n\n set blendMode(value: BLEND_MODES)\n {\n if (this.localBlendMode === value) return;\n if (this.parentRenderGroup)\n {\n this.parentRenderGroup.structureDidChange = true;\n }\n\n this._updateFlags |= UPDATE_BLEND;\n\n this.localBlendMode = value;\n\n this._onUpdate();\n }\n\n /**\n * The blend mode to be applied to the sprite. Controls how pixels are blended when rendering.\n *\n * Setting to 'normal' will reset to default blending.\n * > [!NOTE] More blend modes are available after importing the `pixi.js/advanced-blend-modes` sub-export.\n * @example\n * ```ts\n * // Basic blend modes\n * sprite.blendMode = 'add'; // Additive blending\n * sprite.blendMode = 'multiply'; // Multiply colors\n * sprite.blendMode = 'screen'; // Screen blend\n *\n * // Reset blend mode\n * sprite.blendMode = 'normal'; // Normal blending\n * ```\n * @default 'normal'\n * @see {@link Container#alpha} For transparency\n * @see {@link Container#tint} For color adjustments\n */\n get blendMode(): BLEND_MODES\n {\n return this.localBlendMode;\n }\n\n // / ///////// VISIBILITY / RENDERABLE /////////////////\n\n /**\n * The visibility of the object. If false the object will not be drawn,\n * and the transform will not be updated.\n * @example\n * ```ts\n * // Basic visibility toggle\n * sprite.visible = false; // Hide sprite\n * sprite.visible = true; // Show sprite\n * ```\n * @default true\n * @see {@link Container#renderable} For render-only control\n * @see {@link Container#alpha} For transparency\n */\n get visible()\n {\n return !!(this.localDisplayStatus & 0b010);\n }\n\n set visible(value: boolean)\n {\n const valueNumber = value ? 0b010 : 0;\n\n if ((this.localDisplayStatus & 0b010) === valueNumber) return;\n\n if (this.parentRenderGroup)\n {\n this.parentRenderGroup.structureDidChange = true;\n }\n\n this._updateFlags |= UPDATE_VISIBLE;\n\n this.localDisplayStatus ^= 0b010;\n\n this._onUpdate();\n }\n\n /** @ignore */\n get culled()\n {\n return !(this.localDisplayStatus & 0b100);\n }\n\n /** @ignore */\n set culled(value: boolean)\n {\n const valueNumber = value ? 0 : 0b100;\n\n if ((this.localDisplayStatus & 0b100) === valueNumber) return;\n\n if (this.parentRenderGroup)\n {\n this.parentRenderGroup.structureDidChange = true;\n }\n\n this._updateFlags |= UPDATE_VISIBLE;\n this.localDisplayStatus ^= 0b100;\n\n this._onUpdate();\n }\n\n /**\n * Controls whether this object can be rendered. If false the object will not be drawn,\n * but the transform will still be updated. This is different from visible, which skips\n * transform updates.\n * @example\n * ```ts\n * // Basic render control\n * sprite.renderable = false; // Skip rendering\n * sprite.renderable = true; // Enable rendering\n * ```\n * @default true\n * @see {@link Container#visible} For skipping transform updates\n * @see {@link Container#alpha} For transparency\n */\n get renderable()\n {\n return !!(this.localDisplayStatus & 0b001);\n }\n\n set renderable(value: boolean)\n {\n const valueNumber = value ? 0b001 : 0;\n\n if ((this.localDisplayStatus & 0b001) === valueNumber) return;\n\n this._updateFlags |= UPDATE_VISIBLE;\n this.localDisplayStatus ^= 0b001;\n\n if (this.parentRenderGroup)\n {\n this.parentRenderGroup.structureDidChange = true;\n }\n\n this._onUpdate();\n }\n\n /**\n * Whether or not the object should be rendered.\n * @advanced\n */\n get isRenderable(): boolean\n {\n return (this.localDisplayStatus === 0b111 && this.groupAlpha > 0);\n }\n\n /**\n * Removes all internal references and listeners as well as removes children from the display list.\n * Do not use a Container after calling `destroy`.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @example\n * ```ts\n * container.destroy();\n * container.destroy(true);\n * container.destroy({ children: true });\n * container.destroy({ children: true, texture: true, textureSource: true });\n * ```\n */\n public destroy(options: DestroyOptions = false): void\n {\n if (this.destroyed) return;\n this.destroyed = true;\n\n // remove children is faster than removeChild..\n\n let oldChildren: ContainerChild[];\n\n // we add this check as calling removeChildren on particle container will throw an error\n // As we know it does cannot have any children, check before calling the function.\n if (this.children.length)\n {\n oldChildren = this.removeChildren(0, this.children.length);\n }\n\n this.removeFromParent();\n this.parent = null;\n this._maskEffect = null;\n this._filterEffect = null;\n this.effects = null;\n this._position = null;\n this._scale = null;\n this._pivot = null;\n this._origin = null;\n this._skew = null;\n\n this.emit('destroyed', this);\n\n this.removeAllListeners();\n\n const destroyChildren = typeof options === 'boolean' ? options : options?.children;\n\n if (destroyChildren && oldChildren)\n {\n for (let i = 0; i < oldChildren.length; ++i)\n {\n oldChildren[i].destroy(options);\n }\n }\n\n this.renderGroup?.destroy();\n this.renderGroup = null;\n }\n}\n\nextensions.mixin(\n Container,\n childrenHelperMixin,\n getFastGlobalBoundsMixin,\n toLocalGlobalMixin,\n onRenderMixin,\n measureMixin,\n effectsMixin,\n findMixin,\n sortMixin,\n cullingMixin,\n cacheAsTextureMixin,\n getGlobalMixin,\n collectRenderablesMixin,\n);\n", "/* eslint-disable no-restricted-globals */\nimport { type Adapter } from '../environment/adapter';\nimport { type ImageLike } from '../environment/ImageLike';\n\n/**\n * This is an implementation of the {@link Adapter} interface.\n * It can be used to make Pixi work in the browser.\n * @category environment\n * @property {Function} createCanvas - Creates a canvas element of the given size.\n * This canvas is created using the browser's native canvas element.\n * @property {Function} getCanvasRenderingContext2D - Returns a 2D rendering context.\n * @property {Function} getWebGLRenderingContext - Returns a WebGL rendering context.\n * @property {Function} getNavigator - Returns browsers window.navigator\n * @property {Function} getBaseUrl - Returns the current base URL for browser environments this is either\n * the document.baseURI or window.location.href\n * @property {Function} getFontFaceSet - Return the font face set if available\n * @property {Function} fetch - Returns a Response object that has been fetched from the given URL.\n * @property {Function} parseXML - Returns Document object that has been parsed from the given XML string.\n * @advanced\n */\nexport const BrowserAdapter = {\n createCanvas: (width: number, height: number): HTMLCanvasElement =>\n {\n const canvas = document.createElement('canvas');\n\n canvas.width = width;\n canvas.height = height;\n\n return canvas;\n },\n createImage: (): ImageLike => new Image(),\n getCanvasRenderingContext2D: () => CanvasRenderingContext2D,\n getWebGLRenderingContext: () => WebGLRenderingContext,\n getNavigator: () => navigator,\n getBaseUrl: () => (document.baseURI ?? window.location.href),\n getFontFaceSet: () => document.fonts,\n fetch: (url: RequestInfo, options?: RequestInit) => fetch(url, options),\n parseXML: (xml: string) =>\n {\n const parser = new DOMParser();\n\n return parser.parseFromString(xml, 'text/xml');\n },\n} as Adapter;\n", "import { BrowserAdapter } from '../environment-browser/BrowserAdapter';\nimport { type ImageLike } from './ImageLike';\n\nimport type { ICanvas } from './canvas/ICanvas';\nimport type { ICanvasRenderingContext2D } from './canvas/ICanvasRenderingContext2D';\n\n/**\n * This interface describes all the DOM dependent calls that Pixi makes throughout its codebase.\n * Implementations of this interface can be used to make sure Pixi will work in any environment,\n * such as browser, Web Workers, and Node.js.\n * @category environment\n * @advanced\n */\nexport interface Adapter\n{\n /** Returns a canvas object that can be used to create a webgl context. */\n createCanvas: (width?: number, height?: number) => ICanvas;\n /** Returns an IImage (HTMLImageElement) that can be used to create a texture. */\n createImage: () => ImageLike;\n /** Returns a 2D rendering context. */\n getCanvasRenderingContext2D: () => { prototype: ICanvasRenderingContext2D; };\n /** Returns a WebGL rendering context. */\n getWebGLRenderingContext: () => typeof WebGLRenderingContext;\n /** Returns a partial implementation of the browsers window.navigator */\n getNavigator: () => { userAgent: string, gpu: GPU | null };\n /** Returns the current base URL For browser environments this is either the document.baseURI or window.location.href */\n getBaseUrl: () => string;\n /** Return the font face set if available */\n getFontFaceSet: () => FontFaceSet | null;\n /** Returns a Response object that has been fetched from the given URL. */\n fetch: (url: RequestInfo, options?: RequestInit) => Promise<Response>;\n /** Returns Document object that has been parsed from the given XML string. */\n parseXML: (xml: string) => Document;\n}\n\nlet currentAdapter: Adapter = BrowserAdapter;\n\n/**\n * The DOMAdapter is a singleton that allows PixiJS to perform DOM operations, such as creating a canvas.\n * This allows PixiJS to be used in any environment, such as a web browser, Web Worker, or Node.js.\n * It uses the {@link Adapter} interface to abstract away the differences between these environments\n * and uses the {@link BrowserAdapter} by default.\n *\n * It has two methods: `get():Adapter` and `set(adapter: Adapter)`.\n *\n * Defaults to the {@link BrowserAdapter}.\n * @example\n * import { DOMAdapter, WebWorkerAdapter } from 'pixi.js';\n *\n * // WebWorkerAdapter is an implementation of the Adapter interface\n * DOMAdapter.set(WebWorkerAdapter);\n *\n * // use the adapter to create a canvas (in this case an OffscreenCanvas)\n * DOMAdapter.get().createCanvas(800, 600);\n * @category environment\n * @advanced\n */\nexport const DOMAdapter = {\n /**\n * Returns the current adapter.\n * @returns {environment.Adapter} The current adapter.\n */\n get(): Adapter\n {\n return currentAdapter;\n },\n /**\n * Sets the current adapter.\n * @param adapter - The new adapter.\n */\n set(adapter: Adapter): void\n {\n currentAdapter = adapter;\n },\n};\n", "import { DOMAdapter } from '../../../../../environment/adapter';\nimport { ExtensionType } from '../../../../../extensions/Extensions';\nimport { TextureSource } from './TextureSource';\n\nimport type { ICanvas } from '../../../../../environment/canvas/ICanvas';\nimport type { ExtensionMetadata } from '../../../../../extensions/Extensions';\nimport type { TextureSourceOptions } from './TextureSource';\n\n/**\n * Options for creating a CanvasSource.\n * @category rendering\n * @advanced\n */\nexport interface CanvasSourceOptions extends TextureSourceOptions<ICanvas>\n{\n /**\n * Should the canvas be resized to preserve its screen width and height regardless\n * of the resolution of the renderer, this is only supported for HTMLCanvasElement\n * and will be ignored if the canvas is an OffscreenCanvas.\n */\n autoDensity?: boolean;\n /** if true, this canvas will be set up to be transparent where possible */\n transparent?: boolean;\n}\n\n/**\n * A texture source that uses a canvas as its resource.\n * It automatically resizes the canvas based on the width, height, and resolution.\n * It also provides a 2D rendering context for drawing.\n * @category rendering\n * @advanced\n */\nexport class CanvasSource extends TextureSource<ICanvas>\n{\n public static extension: ExtensionMetadata = ExtensionType.TextureSource;\n\n public uploadMethodId = 'image';\n public autoDensity: boolean;\n public transparent: boolean;\n\n private _context2D: CanvasRenderingContext2D;\n\n constructor(options: CanvasSourceOptions)\n {\n if (!options.resource)\n {\n options.resource = DOMAdapter.get().createCanvas();\n }\n\n if (!options.width)\n {\n options.width = options.resource.width;\n\n if (!options.autoDensity)\n {\n options.width /= options.resolution;\n }\n }\n\n if (!options.height)\n {\n options.height = options.resource.height;\n\n if (!options.autoDensity)\n {\n options.height /= options.resolution;\n }\n }\n\n super(options);\n\n this.autoDensity = options.autoDensity;\n\n this.resizeCanvas();\n\n this.transparent = !!options.transparent;\n }\n\n public resizeCanvas()\n {\n if (this.autoDensity && 'style' in this.resource)\n {\n this.resource.style.width = `${this.width}px`;\n this.resource.style.height = `${this.height}px`;\n }\n\n // only resize if wee need to, as this clears the canvas (even if values are set to the same)\n if (this.resource.width !== this.pixelWidth || this.resource.height !== this.pixelHeight)\n {\n this.resource.width = this.pixelWidth;\n this.resource.height = this.pixelHeight;\n }\n }\n\n public resize(width = this.width, height = this.height, resolution = this._resolution): boolean\n {\n const didResize = super.resize(width, height, resolution);\n\n if (didResize)\n {\n this.resizeCanvas();\n }\n\n return didResize;\n }\n\n public static test(resource: any): resource is ICanvas\n {\n return (globalThis.HTMLCanvasElement && resource instanceof HTMLCanvasElement)\n || (globalThis.OffscreenCanvas && resource instanceof OffscreenCanvas);\n }\n\n /**\n * Returns the 2D rendering context for the canvas.\n * Caches the context after creating it.\n * @returns The 2D rendering context of the canvas.\n */\n get context2D(): CanvasRenderingContext2D\n {\n return this._context2D || (this._context2D = this.resource.getContext('2d') as CanvasRenderingContext2D);\n }\n}\n", "import type { BindResource } from './BindResource';\n\n/**\n * A bind group is a collection of resources that are bound together for use by a shader.\n * They are essentially a wrapper for the WebGPU BindGroup class. But with the added bonus\n * that WebGL can also work with them.\n * @see https://gpuweb.github.io/gpuweb/#dictdef-gpubindgroupdescriptor\n * @example\n * // Create a bind group with a single texture and sampler\n * const bindGroup = new BindGroup({\n * uTexture: texture.source,\n * uTexture: texture.style,\n * });\n *\n * Bind groups resources must implement the {@link BindResource} interface.\n * The following resources are supported:\n * - {@link TextureSource}\n * - {@link TextureStyle}\n * - {@link Buffer}\n * - {@link BufferResource}\n * - {@link UniformGroup}\n *\n * The keys in the bind group must correspond to the names of the resources in the GPU program.\n *\n * This bind group class will also watch for changes in its resources ensuring that the changes\n * are reflected in the WebGPU BindGroup.\n * @category rendering\n * @advanced\n */\nexport class BindGroup\n{\n /** The resources that are bound together for use by a shader. */\n public resources: Record<string, BindResource> = Object.create(null);\n /**\n * a key used internally to match it up to a WebGPU Bindgroup\n * @internal\n */\n public _key: string;\n private _dirty = true;\n\n /**\n * Create a new instance eof the Bind Group.\n * @param resources - The resources that are bound together for use by a shader.\n */\n constructor(resources?: Record<string, BindResource>)\n {\n let index = 0;\n\n for (const i in resources)\n {\n const resource: BindResource = resources[i];\n\n this.setResource(resource, index++);\n }\n\n this._updateKey();\n }\n\n /**\n * Updates the key if its flagged as dirty. This is used internally to\n * match this bind group to a WebGPU BindGroup.\n * @internal\n */\n public _updateKey(): void\n {\n if (!this._dirty) return;\n\n this._dirty = false;\n\n const keyParts = [];\n let index = 0;\n\n // TODO - lets use big ints instead of strings...\n for (const i in this.resources)\n {\n // TODO make this consistent...\n keyParts[index++] = this.resources[i]._resourceId;\n }\n\n this._key = keyParts.join('|');\n }\n\n /**\n * Set a resource at a given index. this function will\n * ensure that listeners will be removed from the current resource\n * and added to the new resource.\n * @param resource - The resource to set.\n * @param index - The index to set the resource at.\n */\n public setResource(resource: BindResource, index: number): void\n {\n const currentResource = this.resources[index];\n\n if (resource === currentResource) return;\n\n if (currentResource)\n {\n resource.off?.('change', this.onResourceChange, this);\n }\n\n resource.on?.('change', this.onResourceChange, this);\n\n this.resources[index] = resource;\n this._dirty = true;\n }\n\n /**\n * Returns the resource at the current specified index.\n * @param index - The index of the resource to get.\n * @returns - The resource at the specified index.\n */\n public getResource(index: number): BindResource\n {\n return this.resources[index];\n }\n\n /**\n * Used internally to 'touch' each resource, to ensure that the GC\n * knows that all resources in this bind group are still being used.\n * @param tick - The current tick.\n * @internal\n */\n public _touch(tick: number)\n {\n const resources = this.resources;\n\n for (const i in resources)\n {\n resources[i]._touched = tick;\n }\n }\n\n /** Destroys this bind group and removes all listeners. */\n public destroy()\n {\n const resources = this.resources;\n\n for (const i in resources)\n {\n const resource = resources[i];\n\n resource?.off?.('change', this.onResourceChange, this);\n }\n\n this.resources = null;\n }\n\n protected onResourceChange(resource: BindResource)\n {\n this._dirty = true;\n\n // check if a resource has been destroyed, if it has then we need to destroy this bind group\n // using this bind group with a destroyed resource will cause the renderer to explode :)\n if (resource.destroyed)\n {\n // free up the resource\n const resources = this.resources;\n\n for (const i in resources)\n {\n if (resources[i] === resource)\n {\n resources[i] = null;\n }\n }\n }\n else\n {\n this._updateKey();\n }\n }\n}\n", "/**\n * Copies from one buffer to another.\n * This is an optimised function that will use `Float64Array` window.\n * This means it can copy twice as fast!\n * @param sourceBuffer - the array buffer to copy from\n * @param destinationBuffer - the array buffer to copy to\n * @private\n */\nexport function fastCopy(sourceBuffer: ArrayBuffer, destinationBuffer: ArrayBuffer): void\n{\n const lengthDouble = (sourceBuffer.byteLength / 8) | 0;\n\n const sourceFloat64View = new Float64Array(sourceBuffer, 0, lengthDouble);\n const destinationFloat64View = new Float64Array(destinationBuffer, 0, lengthDouble);\n\n // Use set for faster copying\n destinationFloat64View.set(sourceFloat64View);\n\n // copying over the remaining bytes\n const remainingBytes = sourceBuffer.byteLength - (lengthDouble * 8);\n\n if (remainingBytes > 0)\n {\n const sourceUint8View = new Uint8Array(sourceBuffer, lengthDouble * 8, remainingBytes);\n const destinationUint8View = new Uint8Array(destinationBuffer, lengthDouble * 8, remainingBytes);\n\n // Direct copy for remaining bytes\n destinationUint8View.set(sourceUint8View);\n }\n}\n", "/**\n * Various blend modes supported by Pixi\n * @category filters\n * @standard\n */\nexport type BLEND_MODES = 'inherit'\n| 'normal'\n| 'add'\n| 'multiply'\n| 'screen'\n| 'darken'\n| 'lighten'\n| 'erase'\n| 'color-dodge'\n| 'color-burn'\n| 'linear-burn'\n| 'linear-dodge'\n| 'linear-light'\n| 'hard-light'\n| 'soft-light'\n| 'pin-light'\n| 'difference'\n| 'exclusion'\n| 'overlay'\n// | 'hue'\n| 'saturation'\n| 'color'\n| 'luminosity'\n| 'normal-npm'\n| 'add-npm'\n| 'screen-npm'\n| 'none'\n| 'subtract'\n| 'divide'\n| 'vivid-light'\n| 'hard-mix'\n| 'negation'\n| 'min'\n| 'max';\n\n/**\n * The map of blend modes supported by Pixi\n * @category rendering\n * @advanced\n */\nexport const BLEND_TO_NPM = {\n normal: 'normal-npm',\n add: 'add-npm',\n screen: 'screen-npm',\n};\n\n/**\n * The stencil operation to perform when using the stencil buffer\n * @category rendering\n * @advanced\n */\nexport enum STENCIL_MODES\n{\n DISABLED = 0,\n RENDERING_MASK_ADD = 1,\n MASK_ACTIVE = 2,\n INVERSE_MASK_ACTIVE = 3,\n RENDERING_MASK_REMOVE = 4,\n NONE = 5,\n}\n\n/**\n * The culling mode to use. It can be either `none`, `front` or `back`.\n * @category rendering\n * @advanced\n */\nexport type CULL_MODES = 'none' | 'back' | 'front';\n\n", "import type { GlRenderingContext } from '../../../renderers/gl/context/GlRenderingContext';\n\nconst fragTemplate = [\n 'precision mediump float;',\n 'void main(void){',\n 'float test = 0.1;',\n '%forloop%',\n 'gl_FragColor = vec4(0.0);',\n '}',\n].join('\\n');\n\nfunction generateIfTestSrc(maxIfs: number): string\n{\n let src = '';\n\n for (let i = 0; i < maxIfs; ++i)\n {\n if (i > 0)\n {\n src += '\\nelse ';\n }\n\n if (i < maxIfs - 1)\n {\n src += `if(test == ${i}.0){}`;\n }\n }\n\n return src;\n}\n\n/**\n * @param maxIfs\n * @param gl\n * @internal\n */\nexport function checkMaxIfStatementsInShader(maxIfs: number, gl: GlRenderingContext): number\n{\n if (maxIfs === 0)\n {\n throw new Error('Invalid value of `0` passed to `checkMaxIfStatementsInShader`');\n }\n\n const shader = gl.createShader(gl.FRAGMENT_SHADER);\n\n try\n {\n while (true)\n {\n const fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));\n\n gl.shaderSource(shader, fragmentSrc);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))\n {\n maxIfs = (maxIfs / 2) | 0;\n }\n else\n {\n // valid!\n break;\n }\n }\n }\n finally\n {\n gl.deleteShader(shader);\n }\n\n return maxIfs;\n}\n", "/**\n * Buffer usage flags. they can be combined using the bitwise OR operator\n * eg : BufferUsage.VERTEX | BufferUsage.INDEX\n * @category rendering\n * @advanced\n */\nexport enum BufferUsage\n{\n /**\n * The buffer can be mapped for reading. (Example: calling mapAsync() with GPUMapMode.READ)\n * May only be combined with COPY_DST.\n */\n MAP_READ = 0x0001,\n /**\n * The buffer can be mapped for writing. (Example: calling mapAsync() with GPUMapMode.WRITE)\n * May only be combined with COPY_SRC.\n */\n MAP_WRITE = 0x0002,\n /**\n * The buffer can be used as the source of a copy operation.\n * (Examples: as the source argument of a copyBufferToBuffer() or copyBufferToTexture() call.)\n */\n COPY_SRC = 0x0004,\n /**\n * The buffer can be used as the destination of a copy or write operation.\n * (Examples: as the destination argument of a copyBufferToBuffer() or\n * copyTextureToBuffer() call, or as the target of a writeBuffer() call.)\n */\n COPY_DST = 0x0008,\n /** The buffer can be used as an index buffer. (Example: passed to setIndexBuffer().) */\n INDEX = 0x0010,\n /** The buffer can be used as a vertex buffer. (Example: passed to setVertexBuffer().) */\n VERTEX = 0x0020,\n /**\n * The buffer can be used as a uniform buffer.\n * (Example: as a bind group entry for a GPUBufferBindingLayout with a buffer.type of \"uniform\".)\n */\n UNIFORM = 0x0040,\n /**\n * The buffer can be used as a storage buffer.\n * (Example: as a bind group entry for a GPUBufferBindingLayout with a buffer.type of \"storage\" or \"read-only-storage\".)\n */\n STORAGE = 0x0080,\n /**\n * The buffer can be used as to store indirect command arguments.\n * (Examples: as the indirectBuffer argument of a drawIndirect() or dispatchWorkgroupsIndirect() call.)\n */\n INDIRECT = 0x0100,\n /**\n * The buffer can be used to capture query results.\n * (Example: as the destination argument of a resolveQuerySet() call.)\n */\n QUERY_RESOLVE = 0x0200,\n /** the buffer will not be updated frequently */\n STATIC = 0x0400\n}\n", "import EventEmitter from 'eventemitter3';\nimport { uid } from '../../../../utils/data/uid';\nimport { BufferUsage } from './const';\n\nimport type { BindResource } from '../../gpu/shader/BindResource';\n\n/**\n * All the various typed arrays that exist in js\n * @category rendering\n * @advanced\n */\n// eslint-disable-next-line max-len\nexport type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;\n\n/**\n * Options for creating a buffer\n *\n * This interface defines the options that can be passed to the Buffer constructor.\n * It includes the data to initialize the buffer with, the size of the buffer,\n * the usage of the buffer, a label for debugging, and whether the buffer should shrink to fit\n * when the data becomes smaller.\n * @category rendering\n * @advanced\n */\nexport interface BufferOptions\n{\n /**\n * the data to initialize the buffer with, this can be a typed array,\n * or a regular number array. If it is a number array, it will be converted to a Float32Array\n */\n data?: TypedArray | number[];\n /** the size of the buffer in bytes, if not supplied, it will be inferred from the data */\n size?: number;\n /** the usage of the buffer, see {@link BufferUsage} */\n usage: number;\n /** a label for the buffer, this is useful for debugging */\n label?: string;\n /**\n * should the GPU buffer be shrunk when the data becomes smaller?\n * changing this will cause the buffer to be destroyed and a new one created on the GPU\n * this can be expensive, especially if the buffer is already big enough!\n * setting this to false will prevent the buffer from being shrunk. This will yield better performance\n * if you are constantly setting data that is changing size often.\n * @default true\n */\n shrinkToFit?: boolean;\n}\n\n/** @internal */\nexport interface BufferDescriptor\n{\n label?: string;\n size: GPUSize64;\n usage: BufferUsage;\n mappedAtCreation?: boolean;\n}\n\n/**\n * A wrapper for a WebGPU/WebGL Buffer.\n * In PixiJS, the Buffer class is used to manage the data that is sent to the GPU rendering pipeline.\n * It abstracts away the underlying GPU buffer and provides an interface for uploading typed arrays or other data to the GPU,\n * They are used in the following places:\n * <br><br>\n * .1. {@link Geometry} as attribute data or index data for geometry\n * <br>\n * .2. {@link UniformGroup} as an underlying buffer for uniform data\n * <br>\n * .3. {@link BufferResource} as an underlying part of a buffer used directly by the GPU program\n * <br>\n *\n * It is important to note that you must provide a usage type when creating a buffer. This is because\n * the underlying GPU buffer needs to know how it will be used. For example, if you are creating a buffer\n * to hold vertex data, you would use `BufferUsage.VERTEX`. This will tell the GPU that this buffer will be\n * used as a vertex buffer. This is important because it will affect how you can use the buffer.\n *\n * Buffers are updated by calling the {@link Buffer.update} method. This immediately updates the buffer on the GPU.\n * Be mindful of calling this more often than you need to. It is recommended to update buffers only when needed.\n *\n * In WebGPU, a GPU buffer cannot resized. This limitation is abstracted away, but know that resizing a buffer means\n * creating a brand new one and destroying the old, so it is best to limit this if possible.\n * @example\n *\n * const buffer = new Buffer({\n * data: new Float32Array([1, 2, 3, 4]),\n * usage: BufferUsage.VERTEX,\n * });\n * @category rendering\n * @advanced\n */\nexport class Buffer extends EventEmitter<{\n change: BindResource,\n update: Buffer,\n destroy: Buffer,\n}> implements BindResource\n{\n /**\n * emits when the underlying buffer has changed shape (i.e. resized)\n * letting the renderer know that it needs to discard the old buffer on the GPU and create a new one\n * @event change\n */\n\n /**\n * emits when the underlying buffer data has been updated. letting the renderer know\n * that it needs to update the buffer on the GPU\n * @event update\n */\n\n /**\n * emits when the buffer is destroyed. letting the renderer know that it needs to destroy the buffer on the GPU\n * @event destroy\n */\n\n /** a unique id for this uniform group used through the renderer */\n public readonly uid: number = uid('buffer');\n\n /**\n * a resource type, used to identify how to handle it when its in a bind group / shader resource\n * @internal\n */\n public readonly _resourceType = 'buffer';\n\n /**\n * the resource id used internally by the renderer to build bind group keys\n * @internal\n */\n public _resourceId = uid('resource');\n\n /**\n * used internally to know if a uniform group was used in the last render pass\n * @internal\n */\n public _touched = 0;\n\n /**\n * a description of the buffer and how it should be set up on the GPU\n * @internal\n */\n public readonly descriptor: BufferDescriptor;\n\n /** @internal */\n public _updateID = 1;\n\n /** @internal */\n public _updateSize: number;\n\n private _data: TypedArray;\n\n private _dataInt32: Int32Array = null;\n\n /**\n * should the GPU buffer be shrunk when the data becomes smaller?\n * changing this will cause the buffer to be destroyed and a new one created on the GPU\n * this can be expensive, especially if the buffer is already big enough!\n * setting this to false will prevent the buffer from being shrunk. This will yield better performance\n * if you are constantly setting data that is changing size often.\n * @default true\n */\n public shrinkToFit = true;\n\n /**\n * Has the buffer been destroyed?\n * @readonly\n */\n public destroyed = false;\n\n /**\n * Creates a new Buffer with the given options\n * @param options - the options for the buffer\n */\n constructor(options: BufferOptions)\n {\n let { data, size } = options;\n const { usage, label, shrinkToFit } = options;\n\n super();\n\n if (data instanceof Array)\n {\n data = new Float32Array(data as number[]);\n }\n\n this._data = data as TypedArray;\n\n size ??= (data as TypedArray)?.byteLength;\n\n const mappedAtCreation = !!data;\n\n this.descriptor = {\n size,\n usage,\n mappedAtCreation,\n label,\n };\n\n this.shrinkToFit = shrinkToFit ?? true;\n }\n\n /** the data in the buffer */\n get data()\n {\n return this._data;\n }\n\n set data(value: TypedArray)\n {\n this.setDataWithSize(value, value.length, true);\n }\n\n get dataInt32()\n {\n if (!this._dataInt32)\n {\n this._dataInt32 = new Int32Array((this.data as any).buffer);\n }\n\n return this._dataInt32;\n }\n\n /** whether the buffer is static or not */\n get static()\n {\n return !!(this.descriptor.usage & BufferUsage.STATIC);\n }\n\n set static(value: boolean)\n {\n if (value)\n {\n this.descriptor.usage |= BufferUsage.STATIC;\n }\n else\n {\n this.descriptor.usage &= ~BufferUsage.STATIC;\n }\n }\n\n /**\n * Sets the data in the buffer to the given value. This will immediately update the buffer on the GPU.\n * If you only want to update a subset of the buffer, you can pass in the size of the data.\n * @param value - the data to set\n * @param size - the size of the data in bytes\n * @param syncGPU - should the buffer be updated on the GPU immediately?\n */\n public setDataWithSize(value: TypedArray, size: number, syncGPU: boolean)\n {\n // Increment update ID\n this._updateID++;\n\n this._updateSize = (size * value.BYTES_PER_ELEMENT);\n\n // If the data hasn't changed, early return after emitting 'update'\n if (this._data === value)\n {\n if (syncGPU) this.emit('update', this);\n\n return;\n }\n\n // Cache old data and update to new value\n const oldData = this._data;\n\n this._data = value;\n this._dataInt32 = null;\n\n // Event handling\n if (!oldData || oldData.length !== value.length)\n {\n if (!this.shrinkToFit && oldData && value.byteLength < oldData.byteLength)\n {\n if (syncGPU) this.emit('update', this);\n }\n else\n {\n this.descriptor.size = value.byteLength;\n this._resourceId = uid('resource');\n this.emit('change', this);\n }\n\n return;\n }\n\n if (syncGPU) this.emit('update', this);\n }\n\n /**\n * updates the buffer on the GPU to reflect the data in the buffer.\n * By default it will update the entire buffer. If you only want to update a subset of the buffer,\n * you can pass in the size of the buffer to update.\n * @param sizeInBytes - the new size of the buffer in bytes\n */\n public update(sizeInBytes?: number): void\n {\n this._updateSize = sizeInBytes ?? this._updateSize;\n\n this._updateID++;\n\n this.emit('update', this);\n }\n\n /** Destroys the buffer */\n public destroy()\n {\n this.destroyed = true;\n\n this.emit('destroy', this);\n this.emit('change', this);\n\n this._data = null;\n (this.descriptor as null) = null;\n\n this.removeAllListeners();\n }\n}\n\n", "import { Buffer } from '../../buffer/Buffer';\nimport { BufferUsage } from '../../buffer/const';\n\nimport type { TypedArray } from '../../buffer/Buffer';\n\n/**\n * Converts something into a buffer. If it is already a buffer it will pass it through\n * if it is a number array it will convert it to a float32 array before being passed into a buffer\n * the buffer will be created with the correct usage flags for geometry attributes\n * @param buffer - number array\n * @param index - is this an index buffer?\n * @returns a buffer\n * @category rendering\n * @internal\n */\nexport function ensureIsBuffer(buffer: Buffer | TypedArray | number[], index: boolean): Buffer\n{\n if (!(buffer instanceof Buffer))\n {\n let usage: number = index ? BufferUsage.INDEX : BufferUsage.VERTEX;\n\n // its an array!\n if (buffer instanceof Array)\n {\n if (index)\n {\n buffer = new Uint32Array(buffer);\n usage = BufferUsage.INDEX | BufferUsage.COPY_DST;\n }\n\n else\n {\n buffer = new Float32Array(buffer);\n usage = BufferUsage.VERTEX | BufferUsage.COPY_DST;\n }\n }\n\n buffer = new Buffer({\n data: buffer,\n label: index ? 'index-mesh-buffer' : 'vertex-mesh-buffer',\n usage\n });\n }\n\n return buffer;\n}\n", "import type { Bounds } from '../../../../../scene/container/bounds/Bounds';\nimport type { Geometry } from '../Geometry';\n\n/**\n * Gets the 2D bounds of a geometry, based on a specific attribute.\n * @param geometry - Geometry to to measure\n * @param attributeId - AttributeId that contains the x,y data\n * @param bounds - Bounds to store the result in\n * @returns the bounds\n * @internal\n */\nexport function getGeometryBounds(geometry: Geometry, attributeId: string, bounds: Bounds): Bounds\n{\n const attribute = geometry.getAttribute(attributeId);\n\n if (!attribute)\n {\n bounds.minX = 0;\n bounds.minY = 0;\n bounds.maxX = 0;\n bounds.maxY = 0;\n\n return bounds;\n }\n\n const data = attribute.buffer.data as Float32Array;\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n const byteSize = data.BYTES_PER_ELEMENT;\n\n // stride and offset MAY have not been calculated yet.. so go with assumed defaults\n const offset = (attribute.offset || 0) / byteSize;\n const stride = (attribute.stride || (2 * 4)) / byteSize;\n\n for (let i = offset; i < data.length; i += stride)\n {\n const x = data[i];\n const y = data[i + 1];\n\n if (x > maxX)maxX = x;\n if (y > maxY)maxY = y;\n if (x < minX)minX = x;\n if (y < minY)minY = y;\n }\n\n bounds.minX = minX;\n bounds.minY = minY;\n bounds.maxX = maxX;\n bounds.maxY = maxY;\n\n return bounds;\n}\n", "import EventEmitter from 'eventemitter3';\nimport { Bounds } from '../../../../scene/container/bounds/Bounds';\nimport { uid } from '../../../../utils/data/uid';\nimport { Buffer } from '../buffer/Buffer';\nimport { ensureIsBuffer } from './utils/ensureIsBuffer';\nimport { getGeometryBounds } from './utils/getGeometryBounds';\n\nimport type { TypedArray } from '../buffer/Buffer';\nimport type { Topology, VertexFormat } from './const';\n\n/**\n * The index buffer array type used in geometries.\n * @category rendering\n * @advanced\n */\nexport type IndexBufferArray = Uint16Array | Uint32Array;\n\n/**\n * The attribute data for a geometries attributes\n * @category rendering\n * @advanced\n */\nexport interface Attribute\n{\n /** the buffer that this attributes data belongs to */\n buffer: Buffer;\n /** the format of the attribute */\n format?: VertexFormat;\n /** the stride of the data in the buffer - in bytes*/\n stride?: number;\n /** the offset of the attribute from the buffer, defaults to 0 - in bytes*/\n offset?: number;\n /** is this an instanced buffer? (defaults to false) */\n instance?: boolean;\n /** the number of elements to be rendered. If not specified, all vertices after the starting vertex will be drawn. */\n size?: number;\n /**\n * the starting vertex in the geometry to start drawing from. If not specified,\n * drawing will start from the first vertex.\n */\n start?: number;\n /**\n * attribute divisor for instanced rendering. Note: this is a **WebGL-only** feature, the WebGPU renderer will\n * issue a warning if one of the attributes has divisor set.\n */\n divisor?: number;\n}\n\n/**\n * The attribute option used by the constructor for adding geometries attributes\n * extends {@link Attribute} but allows for the buffer to be a typed or number array\n * @category rendering\n * @advanced\n */\nexport type AttributeOption = Omit<Attribute, 'buffer'> & { buffer: Buffer | TypedArray | number[]}\n| Buffer | TypedArray | number[];\n\n/**\n * The attribute options used by the constructor for adding geometries attributes\n * extends {@link Attribute} but allows for the buffer to be a typed or number array\n * @category rendering\n * @advanced\n */\nexport type AttributeOptions = Record<string, AttributeOption>;\n\n/**\n * the interface that describes the structure of the geometry\n * @category rendering\n * @advanced\n */\nexport interface GeometryDescriptor\n{\n /** an optional label to easily identify the geometry */\n label?: string;\n /** the attributes that make up the geometry */\n attributes?: AttributeOptions;\n /** optional index buffer for this geometry */\n indexBuffer?: Buffer | TypedArray | number[];\n /** the topology of the geometry, defaults to 'triangle-list' */\n topology?: Topology;\n\n instanceCount?: number;\n}\nfunction ensureIsAttribute(attribute: AttributeOption): Attribute\n{\n if (attribute instanceof Buffer || Array.isArray(attribute) || (attribute as TypedArray).BYTES_PER_ELEMENT)\n {\n attribute = {\n buffer: attribute as Buffer | TypedArray | number[],\n };\n }\n\n (attribute as Attribute).buffer = ensureIsBuffer(attribute.buffer as Buffer | TypedArray | number[], false);\n\n return attribute as Attribute;\n}\n\n/**\n * A Geometry is a low-level object that represents the structure of 2D shapes in terms of vertices and attributes.\n * It's a crucial component for rendering as it describes the shape and format of the data that will go through the shaders.\n * Essentially, a Geometry object holds the data you'd send to a GPU buffer.\n *\n * A geometry is basically made of two components:\n * <br>\n * <b>Attributes</b>: These are essentially arrays that define properties of the vertices like position, color,\n * texture coordinates, etc. They map directly to attributes in your vertex shaders.\n * <br>\n * <b>Indices</b>: An optional array that describes how the vertices are connected.\n * If not provided, vertices will be interpreted in the sequence they're given.\n * @example\n *\n * const geometry = new Geometry({\n * attributes: {\n * aPosition: [ // add some positions\n * 0, 0,\n * 0, 100,\n * 100, 100,\n * 100, 0,\n * ],\n * aUv: [ // add some uvs\n * 0, 0,\n * 0, 1,\n * 1, 1,\n * 1, 0,\n * ]\n * }\n * });\n * @category rendering\n * @advanced\n */\nexport class Geometry extends EventEmitter<{\n update: Geometry,\n destroy: Geometry,\n}>\n{\n /** The topology of the geometry. */\n public topology: Topology;\n /** The unique id of the geometry. */\n public readonly uid: number = uid('geometry');\n /** A record of the attributes of the geometry. */\n public readonly attributes: Record<string, Attribute>;\n /** The buffers that the attributes use */\n public readonly buffers: Buffer[];\n /** The index buffer of the geometry */\n public indexBuffer: Buffer;\n\n /**\n * the layout key will be generated by WebGPU all geometries that have the same structure\n * will have the same layout key. This is used to cache the pipeline layout\n * @internal\n */\n public _layoutKey = 0;\n\n /** the instance count of the geometry to draw */\n public instanceCount = 1;\n\n private readonly _bounds: Bounds = new Bounds();\n private _boundsDirty = true;\n\n /**\n * Create a new instance of a geometry\n * @param options - The options for the geometry.\n */\n constructor(options: GeometryDescriptor = {})\n {\n super();\n\n const { attributes, indexBuffer, topology } = options;\n\n this.buffers = [];\n\n this.attributes = {};\n\n if (attributes)\n {\n for (const i in attributes)\n {\n this.addAttribute(i, attributes[i]);\n }\n }\n\n this.instanceCount = options.instanceCount ?? 1;\n\n if (indexBuffer)\n {\n this.addIndex(indexBuffer);\n }\n\n this.topology = topology || 'triangle-list';\n }\n\n protected onBufferUpdate(): void\n {\n this._boundsDirty = true;\n this.emit('update', this);\n }\n\n /**\n * Returns the requested attribute.\n * @param id - The name of the attribute required\n * @returns - The attribute requested.\n */\n public getAttribute(id: string): Attribute\n {\n return this.attributes[id];\n }\n\n /**\n * Returns the index buffer\n * @returns - The index buffer.\n */\n public getIndex(): Buffer\n {\n return this.indexBuffer;\n }\n\n /**\n * Returns the requested buffer.\n * @param id - The name of the buffer required.\n * @returns - The buffer requested.\n */\n public getBuffer(id: string): Buffer\n {\n return this.getAttribute(id).buffer;\n }\n\n /**\n * Used to figure out how many vertices there are in this geometry\n * @returns the number of vertices in the geometry\n */\n public getSize(): number\n {\n for (const i in this.attributes)\n {\n const attribute = this.attributes[i];\n const buffer = attribute.buffer;\n\n // TODO use SIZE again like v7..\n return (buffer.data as any).length / ((attribute.stride / 4) || attribute.size);\n }\n\n return 0;\n }\n\n /**\n * Adds an attribute to the geometry.\n * @param name - The name of the attribute to add.\n * @param attributeOption - The attribute option to add.\n */\n public addAttribute(name: string, attributeOption: AttributeOption): void\n {\n const attribute = ensureIsAttribute(attributeOption);\n\n const bufferIndex = this.buffers.indexOf(attribute.buffer);\n\n if (bufferIndex === -1)\n {\n this.buffers.push(attribute.buffer);\n\n // two events here - one for a resize (new buffer change)\n // and one for an update (existing buffer change)\n attribute.buffer.on('update', this.onBufferUpdate, this);\n attribute.buffer.on('change', this.onBufferUpdate, this);\n }\n this.attributes[name] = attribute;\n }\n\n /**\n * Adds an index buffer to the geometry.\n * @param indexBuffer - The index buffer to add. Can be a Buffer, TypedArray, or an array of numbers.\n */\n public addIndex(indexBuffer: Buffer | TypedArray | number[]): void\n {\n this.indexBuffer = ensureIsBuffer(indexBuffer, true);\n this.buffers.push(this.indexBuffer);\n }\n\n /** Returns the bounds of the geometry. */\n get bounds(): Bounds\n {\n if (!this._boundsDirty) return this._bounds;\n\n this._boundsDirty = false;\n\n return getGeometryBounds(this, 'aPosition', this._bounds);\n }\n\n /**\n * destroys the geometry.\n * @param destroyBuffers - destroy the buffers associated with this geometry\n */\n public destroy(destroyBuffers = false): void\n {\n this.emit('destroy', this);\n\n this.removeAllListeners();\n\n if (destroyBuffers)\n {\n this.buffers.forEach((buffer) => buffer.destroy());\n }\n\n this.indexBuffer?.destroy();\n (this.attributes as null) = null;\n (this.buffers as null) = null;\n (this.indexBuffer as null) = null;\n (this._bounds as null) = null;\n }\n}\n", "const idCounts: Record<string, number> = Object.create(null);\nconst idHash: Record<string, number> = Object.create(null);\n\n/**\n * @param value\n * @param groupId\n * @internal\n */\nexport function createIdFromString(value: string, groupId: string): number\n{\n let id = idHash[value];\n\n if (id === undefined)\n {\n if (idCounts[groupId] === undefined)\n {\n idCounts[groupId] = 1;\n }\n\n idHash[value] = id = idCounts[groupId]++;\n }\n\n return id;\n}\n", "import { DOMAdapter } from '../../../../../environment/adapter';\n\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\n\nlet context: GlRenderingContext;\n\n/**\n * returns a little WebGL context to use for program inspection.\n * @private\n * @returns {WebGLRenderingContext} a gl context to test with\n */\nexport function getTestContext(): GlRenderingContext\n{\n if (!context || context?.isContextLost())\n {\n const canvas = DOMAdapter.get().createCanvas();\n\n context = canvas.getContext('webgl', {}) as GlRenderingContext;\n }\n\n return context;\n}\n", "import { getTestContext } from './getTestContext';\n\nimport type { PRECISION } from '../const';\n\nlet maxFragmentPrecision: PRECISION;\n\n/** @internal */\nexport function getMaxFragmentPrecision(): PRECISION\n{\n if (!maxFragmentPrecision)\n {\n maxFragmentPrecision = 'mediump';\n const gl = getTestContext();\n\n if (gl)\n {\n if (gl.getShaderPrecisionFormat)\n {\n const shaderFragment = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);\n\n maxFragmentPrecision = shaderFragment.precision ? 'highp' : 'mediump';\n }\n }\n }\n\n return maxFragmentPrecision;\n}\n", "/**\n * @param src\n * @param isES300\n * @param isFragment\n * @internal\n */\nexport function addProgramDefines(src: string, isES300: boolean, isFragment?: boolean)\n{\n if (isES300) return src;\n\n if (isFragment)\n {\n src = src.replace('out vec4 finalColor;', '');\n\n return `\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in varying\n #define finalColor gl_FragColor\n #define texture texture2D\n #endif\n ${src}\n `;\n }\n\n return `\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in attribute\n #define out varying\n #endif\n ${src}\n `;\n}\n", "import type { PRECISION } from '../../const';\n\ninterface EnsurePrecisionOptions\n{\n requestedVertexPrecision: PRECISION;\n requestedFragmentPrecision: PRECISION;\n maxSupportedVertexPrecision: PRECISION;\n maxSupportedFragmentPrecision: PRECISION;\n}\n\n/**\n * Sets the float precision on the shader, ensuring the device supports the request precision.\n * If the precision is already present, it just ensures that the device is able to handle it.\n * @param src\n * @param options\n * @param options.requestedVertexPrecision\n * @param options.requestedFragmentPrecision\n * @param options.maxSupportedVertexPrecision\n * @param options.maxSupportedFragmentPrecision\n * @param isFragment\n * @private\n */\nexport function ensurePrecision(\n src: string,\n options: EnsurePrecisionOptions,\n isFragment: boolean,\n): string\n{\n const maxSupportedPrecision = isFragment ? options.maxSupportedFragmentPrecision : options.maxSupportedVertexPrecision;\n\n if (src.substring(0, 9) !== 'precision')\n {\n // no precision supplied, so PixiJS will add the requested level.\n let precision = isFragment ? options.requestedFragmentPrecision : options.requestedVertexPrecision;\n\n // If highp is requested but not supported, downgrade precision to a level all devices support.\n if (precision === 'highp' && maxSupportedPrecision !== 'highp')\n {\n precision = 'mediump';\n }\n\n return `precision ${precision} float;\\n${src}`;\n }\n else if (maxSupportedPrecision !== 'highp' && src.substring(0, 15) === 'precision highp')\n {\n // precision was supplied, but at a level this device does not support, so downgrading to mediump.\n return src.replace('precision highp', 'precision mediump');\n }\n\n return src;\n}\n", "/**\n * @param src\n * @param isES300\n * @internal\n */\nexport function insertVersion(src: string, isES300: boolean): string\n{\n if (!isES300) return src;\n\n return `#version 300 es\\n${src}`;\n}\n", "const fragmentNameCache: { [key: string]: number } = {};\nconst VertexNameCache: { [key: string]: number } = {};\n\n/**\n * @param src\n * @param root0\n * @param root0.name\n * @param isFragment\n * @internal\n */\nexport function setProgramName(src: string, { name = `pixi-program` }: { name: string; }, isFragment = true)\n{\n name = name.replace(/\\s+/g, '-');\n\n name += isFragment ? '-fragment' : '-vertex';\n\n const nameCache = isFragment ? fragmentNameCache : VertexNameCache;\n\n if (nameCache[name])\n {\n nameCache[name]++;\n name += `-${nameCache[name]}`;\n }\n else\n {\n nameCache[name] = 1;\n }\n\n // if it already contains the define return\n if (src.indexOf('#define SHADER_NAME') !== -1) return src;\n\n const shaderName = `#define SHADER_NAME ${name}`;\n\n return `${shaderName}\\n${src}`;\n}\n", "/**\n * @param src\n * @param isES300\n * @internal\n */\nexport function stripVersion(src: string, isES300: boolean): string\n{\n if (!isES300) return src;\n\n return src.replace('#version 300 es', '');\n}\n", "import { createIdFromString } from '../../shared/utils/createIdFromString';\nimport { getMaxFragmentPrecision } from './program/getMaxFragmentPrecision';\nimport { addProgramDefines } from './program/preprocessors/addProgramDefines';\nimport { ensurePrecision } from './program/preprocessors/ensurePrecision';\nimport { insertVersion } from './program/preprocessors/insertVersion';\nimport { setProgramName } from './program/preprocessors/setProgramName';\nimport { stripVersion } from './program/preprocessors/stripVersion';\n\nimport type { TypedArray } from '../../shared/buffer/Buffer';\nimport type { ExtractedAttributeData } from './program/extractAttributesFromGlProgram';\n\n/** @internal */\nexport interface GlUniformData\n{\n name: string;\n index: number;\n type: string;\n size: number;\n isArray: boolean;\n value: any;\n}\n\n/** @internal */\nexport interface GlUniformBlockData\n{\n index: number;\n name: string;\n size: number;\n value?: TypedArray;\n}\n\n/**\n * The options for the gl program\n * @category rendering\n * @advanced\n */\nexport interface GlProgramOptions\n{\n /** The fragment glsl shader source. */\n fragment: string;\n /** The vertex glsl shader source. */\n vertex: string;\n /** the name of the program, defaults to 'pixi-program' */\n name?: string;\n /** the preferred vertex precision for the shader, this may not be used if the device does not support it */\n preferredVertexPrecision?: string;\n /** the preferred fragment precision for the shader, this may not be used if the device does not support it */\n preferredFragmentPrecision?: string;\n\n transformFeedbackVaryings?: {names: string[], bufferMode: 'separate' | 'interleaved'};\n}\n\nconst processes: Record<string, ((source: string, options: any, isFragment?: boolean) => string)> = {\n // strips any version headers..\n stripVersion,\n // adds precision string if not already present\n ensurePrecision,\n // add some defines if WebGL1 to make it more compatible with WebGL2 shaders\n addProgramDefines,\n // add the program name to the shader\n setProgramName,\n // add the version string to the shader header\n insertVersion,\n};\n\nconst programCache: Record<string, GlProgram> = Object.create(null);\n\n/**\n * A wrapper for a WebGL Program. You can create one and then pass it to a shader.\n * This will manage the WebGL program that is compiled and uploaded to the GPU.\n *\n * To get the most out of this class, you should be familiar with glsl shaders and how they work.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLProgram\n * @example\n *\n * // Create a new program\n * const program = new GlProgram({\n * vertex: '...',\n * fragment: '...',\n * });\n *\n *\n * There are a few key things that pixi shader will do for you automatically:\n * <br>\n * - If no precision is provided in the shader, it will be injected into the program source for you.\n * This precision will be taken form the options provided, if none is provided,\n * then the program will default to the defaultOptions.\n * <br>\n * - It will inject the program name into the shader source if none is provided.\n * <br>\n * - It will set the program version to 300 es.\n *\n * For optimal usage and best performance, its best to reuse programs as much as possible.\n * You should use the {@link GlProgram.from} helper function to create programs.\n * @class\n * @category rendering\n * @advanced\n */\nexport class GlProgram\n{\n /** The default options used by the program. */\n public static defaultOptions: Partial<GlProgramOptions> = {\n preferredVertexPrecision: 'highp',\n preferredFragmentPrecision: 'mediump',\n };\n\n /** the fragment glsl shader source. */\n public readonly fragment?: string;\n /** the vertex glsl shader source */\n public readonly vertex?: string;\n /**\n * attribute data extracted from the program once created this happens when the program is used for the first time\n * @internal\n */\n public _attributeData: Record<string, ExtractedAttributeData>;\n /**\n * uniform data extracted from the program once created this happens when the program is used for the first time\n * @internal\n */\n public _uniformData: Record<string, GlUniformData>;\n /**\n * uniform data extracted from the program once created this happens when the program is used for the first time\n * @internal\n */\n public _uniformBlockData: Record<string, GlUniformBlockData>;\n /** details on how to use this program with transform feedback */\n public transformFeedbackVaryings?: {names: string[], bufferMode: 'separate' | 'interleaved'};\n /**\n * the key that identifies the program via its source vertex + fragment\n * @internal\n */\n public readonly _key: number;\n /**\n * A cache key used to identify the program instance.\n * @internal\n */\n public _cacheKey: string;\n\n /**\n * Creates a shiny new GlProgram. Used by WebGL renderer.\n * @param options - The options for the program.\n */\n constructor(options: GlProgramOptions)\n {\n options = { ...GlProgram.defaultOptions, ...options };\n\n // only need to check one as they both need to be the same or\n // errors ensue!\n const isES300 = options.fragment.indexOf('#version 300 es') !== -1;\n\n const preprocessorOptions = {\n stripVersion: isES300,\n ensurePrecision: {\n requestedFragmentPrecision: options.preferredFragmentPrecision,\n requestedVertexPrecision: options.preferredVertexPrecision,\n maxSupportedVertexPrecision: 'highp',\n maxSupportedFragmentPrecision: getMaxFragmentPrecision(),\n },\n setProgramName: {\n name: options.name,\n },\n addProgramDefines: isES300,\n insertVersion: isES300\n };\n\n let fragment = options.fragment;\n let vertex = options.vertex;\n\n Object.keys(processes).forEach((processKey) =>\n {\n const processOptions = preprocessorOptions[processKey as keyof typeof preprocessorOptions];\n\n fragment = processes[processKey](fragment, processOptions, true);\n vertex = processes[processKey](vertex, processOptions, false);\n });\n\n this.fragment = fragment;\n this.vertex = vertex;\n\n this.transformFeedbackVaryings = options.transformFeedbackVaryings;\n\n this._key = createIdFromString(`${this.vertex}:${this.fragment}`, 'gl-program');\n }\n\n /** destroys the program */\n public destroy(): void\n {\n (this.fragment as null) = null;\n (this.vertex as null) = null;\n\n this._attributeData = null;\n this._uniformData = null;\n this._uniformBlockData = null;\n\n this.transformFeedbackVaryings = null;\n\n programCache[this._cacheKey] = null;\n }\n\n /**\n * Helper function that creates a program for a given source.\n * It will check the program cache if the program has already been created.\n * If it has that one will be returned, if not a new one will be created and cached.\n * @param options - The options for the program.\n * @returns A program using the same source\n */\n public static from(options: GlProgramOptions): GlProgram\n {\n const key = `${options.vertex}:${options.fragment}`;\n\n if (!programCache[key])\n {\n programCache[key] = new GlProgram(options);\n programCache[key]._cacheKey = key;\n }\n\n return programCache[key];\n }\n}\n", "import type { VertexFormat } from '../const';\n\nconst attributeFormatData = {\n uint8x2: { size: 2, stride: 2, normalised: false },\n uint8x4: { size: 4, stride: 4, normalised: false },\n sint8x2: { size: 2, stride: 2, normalised: false },\n sint8x4: { size: 4, stride: 4, normalised: false },\n unorm8x2: { size: 2, stride: 2, normalised: true },\n unorm8x4: { size: 4, stride: 4, normalised: true },\n snorm8x2: { size: 2, stride: 2, normalised: true },\n snorm8x4: { size: 4, stride: 4, normalised: true },\n uint16x2: { size: 2, stride: 4, normalised: false },\n uint16x4: { size: 4, stride: 8, normalised: false },\n sint16x2: { size: 2, stride: 4, normalised: false },\n sint16x4: { size: 4, stride: 8, normalised: false },\n unorm16x2: { size: 2, stride: 4, normalised: true },\n unorm16x4: { size: 4, stride: 8, normalised: true },\n snorm16x2: { size: 2, stride: 4, normalised: true },\n snorm16x4: { size: 4, stride: 8, normalised: true },\n float16x2: { size: 2, stride: 4, normalised: false },\n float16x4: { size: 4, stride: 8, normalised: false },\n float32: { size: 1, stride: 4, normalised: false },\n float32x2: { size: 2, stride: 8, normalised: false },\n float32x3: { size: 3, stride: 12, normalised: false },\n float32x4: { size: 4, stride: 16, normalised: false },\n uint32: { size: 1, stride: 4, normalised: false },\n uint32x2: { size: 2, stride: 8, normalised: false },\n uint32x3: { size: 3, stride: 12, normalised: false },\n uint32x4: { size: 4, stride: 16, normalised: false },\n sint32: { size: 1, stride: 4, normalised: false },\n sint32x2: { size: 2, stride: 8, normalised: false },\n sint32x3: { size: 3, stride: 12, normalised: false },\n sint32x4: { size: 4, stride: 16, normalised: false },\n};\n\n/**\n * @param format\n * @internal\n */\nexport function getAttributeInfoFromFormat(format: VertexFormat): { size: number; stride: number; normalised: boolean }\n{\n return attributeFormatData[format] ?? attributeFormatData.float32;\n}\n", "import { getAttributeInfoFromFormat } from '../../../shared/geometry/utils/getAttributeInfoFromFormat';\n\nimport type { ExtractedAttributeData } from '../../../gl/shader/program/extractAttributesFromGlProgram';\nimport type { VertexFormat } from '../../../shared/geometry/const';\nimport type { ProgramSource } from '../GpuProgram';\n\nconst WGSL_TO_VERTEX_TYPES: Record<string, VertexFormat> = {\n\n f32: 'float32',\n 'vec2<f32>': 'float32x2',\n 'vec3<f32>': 'float32x3',\n 'vec4<f32>': 'float32x4',\n vec2f: 'float32x2',\n vec3f: 'float32x3',\n vec4f: 'float32x4',\n\n i32: 'sint32',\n 'vec2<i32>': 'sint32x2',\n 'vec3<i32>': 'sint32x3',\n 'vec4<i32>': 'sint32x4',\n\n u32: 'uint32',\n 'vec2<u32>': 'uint32x2',\n 'vec3<u32>': 'uint32x3',\n 'vec4<u32>': 'uint32x4',\n\n bool: 'uint32',\n 'vec2<bool>': 'uint32x2',\n 'vec3<bool>': 'uint32x3',\n 'vec4<bool>': 'uint32x4',\n};\n\n/**\n * @param root0\n * @param root0.source\n * @param root0.entryPoint\n * @internal\n */\nexport function extractAttributesFromGpuProgram(\n { source, entryPoint }: ProgramSource\n): Record<string, ExtractedAttributeData>\n{\n const results: Record<string, ExtractedAttributeData> = {};\n\n // Step 1: Find the start of the mainVert function using string methods\n const mainVertStart = source.indexOf(`fn ${entryPoint}`);\n\n if (mainVertStart !== -1)\n {\n // Step 2: Find the index of the next '->' after the start of the mainVert function\n const arrowFunctionStart = source.indexOf('->', mainVertStart);\n\n if (arrowFunctionStart !== -1)\n {\n const functionArgsSubstring = source.substring(mainVertStart, arrowFunctionStart);\n\n // Apply the inputs regex directly to the trimmed string\n const inputsRegex = /@location\\((\\d+)\\)\\s+([a-zA-Z0-9_]+)\\s*:\\s*([a-zA-Z0-9_<>]+)(?:,|\\s|$)/g;\n let match;\n\n while ((match = inputsRegex.exec(functionArgsSubstring)) !== null)\n {\n const format = WGSL_TO_VERTEX_TYPES[match[3] as VertexFormat] ?? 'float32';\n\n results[match[2]] = {\n location: parseInt(match[1], 10),\n format,\n stride: getAttributeInfoFromFormat(format).stride,\n offset: 0,\n instance: false,\n start: 0,\n };\n }\n }\n }\n\n return results;\n}\n", "/**\n * Defines the structure of the extracted WGSL structs and groups.\n * @category rendering\n * @advanced\n */\nexport interface StructsAndGroups\n{\n groups: {\n group: number;\n binding: number;\n name: string;\n isUniform: boolean;\n type: string;\n }[];\n structs: {\n name: string;\n members: Record<string, string>;\n }[];\n}\n\n/**\n * @param wgsl\n * @internal\n */\nexport function extractStructAndGroups(wgsl: string): StructsAndGroups\n{\n // Patterns for parsing the WGSL file\n const linePattern = /(^|[^/])@(group|binding)\\(\\d+\\)[^;]+;/g;\n const groupPattern = /@group\\((\\d+)\\)/;\n const bindingPattern = /@binding\\((\\d+)\\)/;\n const namePattern = /var(<[^>]+>)? (\\w+)/;\n const typePattern = /:\\s*(\\w+)/;\n const structPattern = /struct\\s+(\\w+)\\s*{([^}]+)}/g;\n const structMemberPattern = /(\\w+)\\s*:\\s*([\\w\\<\\>]+)/g;\n const structName = /struct\\s+(\\w+)/;\n\n // Find the @group and @binding annotations\n const groups = wgsl.match(linePattern)?.map((item) => ({\n group: parseInt(item.match(groupPattern)[1], 10),\n binding: parseInt(item.match(bindingPattern)[1], 10),\n name: item.match(namePattern)[2],\n isUniform: item.match(namePattern)[1] === '<uniform>',\n type: item.match(typePattern)[1],\n }));\n\n if (!groups)\n {\n return {\n groups: [],\n structs: [],\n };\n }\n\n // Find the structs\n const structs = wgsl\n .match(structPattern)\n ?.map((struct) =>\n {\n const name = struct.match(structName)[1];\n const members = struct.match(structMemberPattern).reduce((acc: Record<string, string>, member) =>\n {\n const [name, type] = member.split(':');\n\n acc[name.trim()] = type.trim();\n\n return acc;\n }, {});\n\n if (!members)\n {\n return null;\n }\n\n return { name, members };\n // Only include the structs mentioned in the @group/@binding annotations\n })\n .filter(({ name }) => groups.some((group) => group.type === name)) ?? [];\n\n return {\n groups,\n structs,\n };\n}\n", "/** @internal */\nexport enum ShaderStage\n{\n VERTEX = 1,\n FRAGMENT = 2,\n COMPUTE = 4\n}\n", "import { ShaderStage } from '../../../shared/shader/const';\n\nimport type { ProgramPipelineLayoutDescription } from '../GpuProgram';\nimport type { StructsAndGroups } from './extractStructAndGroups';\n\n/**\n * @param root0\n * @param root0.groups\n * @internal\n */\nexport function generateGpuLayoutGroups({ groups }: StructsAndGroups): ProgramPipelineLayoutDescription\n{\n const layout: ProgramPipelineLayoutDescription = [];\n\n for (let i = 0; i < groups.length; i++)\n {\n const group = groups[i];\n\n if (!layout[group.group])\n {\n layout[group.group] = [];\n }\n\n if (group.isUniform)\n {\n layout[group.group].push({\n binding: group.binding,\n visibility: ShaderStage.VERTEX | ShaderStage.FRAGMENT,\n buffer: {\n type: 'uniform'\n }\n });\n }\n else if (group.type === 'sampler')\n {\n layout[group.group].push({\n binding: group.binding,\n visibility: ShaderStage.FRAGMENT,\n sampler: {\n type: 'filtering'\n }\n });\n }\n else if (group.type === 'texture_2d')\n {\n layout[group.group].push({\n binding: group.binding,\n visibility: ShaderStage.FRAGMENT,\n texture: {\n sampleType: 'float',\n viewDimension: '2d',\n multisampled: false,\n }\n });\n }\n }\n\n return layout;\n}\n", "import type { ProgramLayout } from '../GpuProgram';\nimport type { StructsAndGroups } from './extractStructAndGroups';\n\n/**\n * @param root0\n * @param root0.groups\n * @internal\n */\nexport function generateLayoutHash({ groups }: StructsAndGroups): ProgramLayout\n{\n const layout: ProgramLayout = [];\n\n for (let i = 0; i < groups.length; i++)\n {\n const group = groups[i];\n\n if (!layout[group.group])\n {\n layout[group.group] = {};\n }\n\n layout[group.group][group.name] = group.binding;\n }\n\n return layout;\n}\n", "import type { StructsAndGroups } from './extractStructAndGroups';\n\n/**\n * @param vertexStructsAndGroups\n * @param fragmentStructsAndGroups\n * @internal\n */\nexport function removeStructAndGroupDuplicates(\n vertexStructsAndGroups: StructsAndGroups,\n fragmentStructsAndGroups: StructsAndGroups\n)\n{\n const structNameSet = new Set();\n const dupeGroupKeySet = new Set();\n\n const structs = [...vertexStructsAndGroups.structs, ...fragmentStructsAndGroups.structs]\n .filter((struct) =>\n {\n if (structNameSet.has(struct.name))\n {\n return false;\n }\n structNameSet.add(struct.name);\n\n return true;\n });\n\n const groups = [...vertexStructsAndGroups.groups, ...fragmentStructsAndGroups.groups]\n .filter((group) =>\n {\n const key = `${group.name}-${group.binding}`;\n\n if (dupeGroupKeySet.has(key))\n {\n return false;\n }\n dupeGroupKeySet.add(key);\n\n return true;\n });\n\n return { structs, groups };\n}\n", "import { createIdFromString } from '../../shared/utils/createIdFromString';\nimport { extractAttributesFromGpuProgram } from './utils/extractAttributesFromGpuProgram';\nimport { extractStructAndGroups } from './utils/extractStructAndGroups';\nimport { generateGpuLayoutGroups } from './utils/generateGpuLayoutGroups';\nimport { generateLayoutHash } from './utils/generateLayoutHash';\nimport { removeStructAndGroupDuplicates } from './utils/removeStructAndGroupDuplicates';\n\nimport type { ExtractedAttributeData } from '../../gl/shader/program/extractAttributesFromGlProgram';\nimport type { StructsAndGroups } from './utils/extractStructAndGroups';\n\n/**\n * a WebGPU descriptions of how the program is laid out\n * @see https://gpuweb.github.io/gpuweb/#gpupipelinelayout\n * @category rendering\n * @advanced\n */\nexport type ProgramPipelineLayoutDescription = GPUBindGroupLayoutEntry[][];\n/**\n * a map the maps names of uniforms to group indexes\n * @category rendering\n * @advanced\n */\nexport type ProgramLayout = Record<string, number>[];\n\n/**\n * the program source\n * @category rendering\n * @advanced\n */\nexport interface ProgramSource\n{\n /** The wgsl source code of the shader. */\n source: string;\n /** The main function to run in this shader */\n entryPoint?: string;\n}\n\n/**\n * The options for the gpu program\n * @category rendering\n * @advanced\n */\nexport interface GpuProgramOptions\n{\n /**\n * the name of the program, this is added to the label of the GPU Program created\n * under the hood. Makes it much easier to debug!\n */\n name?: string;\n /** The fragment glsl shader source. */\n fragment?: ProgramSource;\n /** The vertex glsl shader source. */\n vertex?: ProgramSource;\n /** The layout of the program. If not provided, it will be generated from the shader sources. */\n layout?: ProgramLayout;\n /** The gpu layout of the program. If not provided, it will be generated from the shader sources. */\n gpuLayout?: ProgramPipelineLayoutDescription;\n}\n\nconst programCache: Record<string, GpuProgram> = Object.create(null);\n\n/**\n * A wrapper for a WebGPU Program, specifically designed for the WebGPU renderer.\n * This class facilitates the creation and management of shader code that integrates with the WebGPU pipeline.\n *\n * To leverage the full capabilities of this class, familiarity with WGSL shaders is recommended.\n * @see https://gpuweb.github.io/gpuweb/#index\n * @example\n *\n * // Create a new program\n * const program = new GpuProgram({\n * vertex: {\n * source: '...',\n * entryPoint: 'main',\n * },\n * fragment:{\n * source: '...',\n * entryPoint: 'main',\n * },\n * });\n *\n *\n * Note: Both fragment and vertex shader sources can coexist within a single WGSL source file\n * this can make things a bit simpler.\n *\n * For optimal usage and best performance, it help to reuse programs whenever possible.\n * The {@link GpuProgram.from} helper function is designed for this purpose, utilizing an\n * internal cache to efficiently manage and retrieve program instances.\n * By leveraging this function, you can significantly reduce overhead and enhance the performance of your rendering pipeline.\n *\n * An important distinction between WebGL and WebGPU regarding program data retrieval:\n * While WebGL allows extraction of program information directly from its compiled state,\n * WebGPU does not offer such a capability. Therefore, in the context of WebGPU, we're required\n * to manually extract the program layout information from the source code itself.\n * @category rendering\n * @advanced\n */\nexport class GpuProgram\n{\n /** The fragment glsl shader source. */\n public readonly fragment?: ProgramSource;\n /** The vertex glsl shader source */\n public readonly vertex?: ProgramSource;\n\n /**\n * Mapping of uniform names to group indexes for organizing shader program uniforms.\n * Automatically generated from shader sources if not provided.\n * @example\n * // Assuming a shader with two uniforms, `u_time` and `u_resolution`, grouped respectively:\n * [\n * { \"u_time\": 0 },\n * { \"u_resolution\": 1 }\n * ]\n */\n public readonly layout: ProgramLayout;\n\n /**\n * Configuration for the WebGPU bind group layouts, detailing resource organization for the shader.\n * Generated from shader sources if not explicitly provided.\n * @example\n * // Assuming a shader program that requires two bind groups:\n * [\n * // First bind group layout entries\n * [{ binding: 0, visibility: GPUShaderStage.VERTEX, type: \"uniform-buffer\" }],\n * // Second bind group layout entries\n * [{ binding: 1, visibility: GPUShaderStage.FRAGMENT, type: \"sampler\" },\n * { binding: 2, visibility: GPUShaderStage.FRAGMENT, type: \"sampled-texture\" }]\n * ]\n */\n public readonly gpuLayout: ProgramPipelineLayoutDescription;\n\n /** @internal */\n public _layoutKey = 0;\n /** @internal */\n public _cacheKey: string;\n\n /** @internal */\n public _attributeLocationsKey = 0;\n\n /** the structs and groups extracted from the shader sources */\n public readonly structsAndGroups: StructsAndGroups;\n /**\n * the name of the program, this is added to the label of the GPU Program created under the hood.\n * Makes it much easier to debug!\n */\n public readonly name: string;\n private _attributeData: Record<string, ExtractedAttributeData>;\n\n /** if true, the program will automatically assign global uniforms to group[0] */\n public autoAssignGlobalUniforms: boolean;\n /** if true, the program will automatically assign local uniforms to group[1] */\n public autoAssignLocalUniforms: boolean;\n\n /**\n * Create a new GpuProgram\n * @param options - The options for the gpu program\n */\n constructor(options: GpuProgramOptions)\n {\n const { fragment, vertex, layout, gpuLayout, name } = options;\n\n this.name = name;\n\n this.fragment = fragment;\n this.vertex = vertex;\n\n // TODO this should be cached - or dealt with at a system level.\n if (fragment.source === vertex.source)\n {\n const structsAndGroups = extractStructAndGroups(fragment.source);\n\n this.structsAndGroups = structsAndGroups;\n }\n else\n {\n const vertexStructsAndGroups = extractStructAndGroups(vertex.source);\n const fragmentStructsAndGroups = extractStructAndGroups(fragment.source);\n\n this.structsAndGroups = removeStructAndGroupDuplicates(vertexStructsAndGroups, fragmentStructsAndGroups);\n }\n\n // todo layout\n this.layout = layout ?? generateLayoutHash(this.structsAndGroups);\n\n // struct properties!\n\n this.gpuLayout = gpuLayout ?? generateGpuLayoutGroups(this.structsAndGroups);\n\n this.autoAssignGlobalUniforms = !!(this.layout[0]?.globalUniforms !== undefined);\n this.autoAssignLocalUniforms = !!(this.layout[1]?.localUniforms !== undefined);\n\n this._generateProgramKey();\n }\n\n // TODO maker this pure\n private _generateProgramKey()\n {\n const { vertex, fragment } = this;\n\n const bigKey = vertex.source + fragment.source + vertex.entryPoint + fragment.entryPoint;\n\n this._layoutKey = createIdFromString(bigKey, 'program');\n }\n\n get attributeData()\n {\n this._attributeData ??= extractAttributesFromGpuProgram(this.vertex);\n\n return this._attributeData;\n }\n /** destroys the program */\n public destroy(): void\n {\n (this.gpuLayout as null) = null;\n (this.layout as null) = null;\n (this.structsAndGroups as null) = null;\n (this.fragment as null) = null;\n (this.vertex as null) = null;\n programCache[this._cacheKey] = null;\n }\n\n /**\n * Helper function that creates a program for a given source.\n * It will check the program cache if the program has already been created.\n * If it has that one will be returned, if not a new one will be created and cached.\n * @param options - The options for the program.\n * @returns A program using the same source\n */\n public static from(options: GpuProgramOptions): GpuProgram\n {\n // eslint-disable-next-line max-len\n const key = `${options.vertex.source}:${options.fragment.source}:${options.fragment.entryPoint}:${options.vertex.entryPoint}`;\n\n if (!programCache[key])\n {\n programCache[key] = new GpuProgram(options);\n programCache[key]._cacheKey = key;\n }\n\n return programCache[key];\n }\n}\n\n", "import { warn } from '../../../../utils/logging/warn';\n\n/**\n * takes the HighFragment source parts and adds them to the hook hash\n * @param srcParts - the hash of hook arrays\n * @param parts - the code to inject into the hooks\n * @param name - optional the name of the part to add\n * @internal\n */\nexport function addBits(srcParts: Record<string, string>, parts: Record<string, string[]>, name?: string)\n{\n if (srcParts)\n {\n for (const i in srcParts)\n {\n const id = i.toLocaleLowerCase();\n\n const part = parts[id];\n\n if (part)\n {\n let sanitisedPart = srcParts[i];\n\n if (i === 'header')\n {\n sanitisedPart = sanitisedPart\n .replace(/@in\\s+[^;]+;\\s*/g, '')\n .replace(/@out\\s+[^;]+;\\s*/g, '');\n }\n\n if (name)\n {\n part.push(`//----${name}----//`);\n }\n part.push(sanitisedPart);\n }\n\n else\n {\n // #if _DEBUG\n warn(`${i} placement hook does not exist in shader`);\n // #endif\n }\n }\n }\n}\n", "const findHooksRx = /\\{\\{(.*?)\\}\\}/g;\n\n/**\n * takes a program string and returns an hash mapping the hooks to empty arrays\n * @param programSrc - the program containing hooks\n * @internal\n */\nexport function compileHooks(programSrc: string): Record<string, string[]>\n{\n const parts: Record<string, string[]> = {};\n\n const partMatches = programSrc\n .match(findHooksRx)\n ?.map((hook) => hook.replace(/[{()}]/g, '')) ?? [];\n\n partMatches.forEach((hook) =>\n {\n parts[hook] = [];\n });\n\n return parts;\n}\n", "function extractInputs(fragmentSource: string, out: string[])\n{\n let match;\n const regex = /@in\\s+([^;]+);/g;\n\n while ((match = regex.exec(fragmentSource)) !== null)\n {\n out.push(match[1]);\n }\n}\n\n/**\n * @param fragments\n * @param template\n * @param sort\n * @internal\n */\nexport function compileInputs(fragments: any[], template: string, sort = false)\n{\n // get all the inputs from the fragments..\n const results: string[] = [];\n\n extractInputs(template, results);\n\n fragments.forEach((fragment) =>\n {\n if (fragment.header)\n {\n extractInputs(fragment.header, results);\n }\n });\n\n // build the input:\n const mainInput = results;\n\n if (sort)\n {\n mainInput.sort();\n }\n\n const finalString = mainInput\n .map((inValue, i) => ` @location(${i}) ${inValue},`)\n .join('\\n');\n\n // Remove lines from original string\n let cleanedString = template.replace(/@in\\s+[^;]+;\\s*/g, '');\n\n cleanedString = cleanedString.replace('{{in}}', `\\n${finalString}\\n`);\n\n return cleanedString;\n}\n", "function extractOutputs(fragmentSource: string, out: string[])\n{\n let match;\n const regex = /@out\\s+([^;]+);/g;\n\n while ((match = regex.exec(fragmentSource)) !== null)\n {\n out.push(match[1]);\n }\n}\n\nfunction extractVariableName(value: string)\n{\n const regex = /\\b(\\w+)\\s*:/g;\n\n const match = regex.exec(value);\n\n return match ? match[1] : '';\n}\n\nfunction stripVariable(value: string)\n{\n const regex = /@.*?\\s+/g;\n\n return value.replace(regex, '');\n}\n\n/**\n * @param fragments\n * @param template\n * @internal\n */\nexport function compileOutputs(fragments: any[], template: string)\n{\n // get all the inputs from the fragments..\n const results: string[] = [];\n\n extractOutputs(template, results);\n\n fragments.forEach((fragment) =>\n {\n if (fragment.header)\n {\n extractOutputs(fragment.header, results);\n }\n });\n\n let index = 0;\n\n // generate the output struct\n const mainStruct = results\n .sort()\n .map((inValue) =>\n {\n if (inValue.indexOf('builtin') > -1)\n {\n return inValue;\n }\n\n return `@location(${index++}) ${inValue}`;\n })\n .join(',\\n');\n\n // generate the variables we will set:\n const mainStart = results\n .sort()\n .map((inValue) => ` var ${stripVariable(inValue)};`)\n .join('\\n');\n\n // generate the return object\n const mainEnd = `return VSOutput(\n ${results\n .sort()\n .map((inValue) => ` ${extractVariableName(inValue)}`)\n .join(',\\n')});`;\n\n // Remove lines from original string\n let compiledCode = template.replace(/@out\\s+[^;]+;\\s*/g, '');\n\n compiledCode = compiledCode.replace('{{struct}}', `\\n${mainStruct}\\n`);\n compiledCode = compiledCode.replace('{{start}}', `\\n${mainStart}\\n`);\n compiledCode = compiledCode.replace('{{return}}', `\\n${mainEnd}\\n`);\n\n return compiledCode;\n}\n", "/**\n * takes a shader src and replaces any hooks with the HighFragment code.\n * @param templateSrc - the program src template\n * @param fragmentParts - the fragments to inject\n * @internal\n */\nexport function injectBits(templateSrc: string, fragmentParts: Record<string, string[]>): string\n{\n let out = templateSrc;\n\n for (const i in fragmentParts)\n {\n const parts = fragmentParts[i];\n\n const toInject = parts.join('\\n');\n\n if (toInject.length)\n {\n out = out.replace(`{{${i}}}`, `//-----${i} START-----//\\n${parts.join('\\n')}\\n//----${i} FINISH----//`);\n }\n\n else\n {\n out = out.replace(`{{${i}}}`, '');\n }\n }\n\n return out;\n}\n", "import { addBits } from './utils/addBits';\nimport { compileHooks } from './utils/compileHooks';\nimport { compileInputs } from './utils/compileInputs';\nimport { compileOutputs } from './utils/compileOutputs';\nimport { injectBits } from './utils/injectBits';\n\nimport type { HighShaderBit, HighShaderSource } from './types';\n\n/**\n * A high template consists of vertex and fragment source\n * @internal\n */\nexport interface HighShaderTemplate\n{\n name?: string;\n fragment: string;\n vertex: string;\n}\n\n/** @internal */\nexport interface CompileHighShaderOptions\n{\n template: HighShaderTemplate;\n bits: HighShaderBit[];\n}\n\nconst cacheMap: {[key: string]: HighShaderSource} = Object.create(null);\nconst bitCacheMap: Map<HighShaderBit, number> = new Map();\n\nlet CACHE_UID = 0;\n\n/**\n * This function will take a HighShader template, some High fragments and then merge them in to a shader source.\n * @param options\n * @param options.template\n * @param options.bits\n * @internal\n */\nexport function compileHighShader({\n template,\n bits\n}: CompileHighShaderOptions): HighShaderSource\n{\n const cacheId = generateCacheId(template, bits);\n\n if (cacheMap[cacheId]) return cacheMap[cacheId];\n\n const { vertex, fragment } = compileInputsAndOutputs(template, bits);\n\n cacheMap[cacheId] = compileBits(vertex, fragment, bits);\n\n return cacheMap[cacheId];\n}\n\n/**\n * This function will take a HighShader template, some High fragments and then merge them in to a shader source.\n * It is specifically for WebGL and does not compile inputs and outputs.\n * @param options\n * @param options.template - The HighShader template containing vertex and fragment source.\n * @param options.bits - An array of HighShaderBit objects to be compiled into the shader.\n * @returns A HighShaderSource object containing the compiled vertex and fragment shaders.\n * @internal\n */\nexport function compileHighShaderGl({\n template,\n bits\n}: CompileHighShaderOptions): HighShaderSource\n{\n const cacheId = generateCacheId(template, bits);\n\n if (cacheMap[cacheId]) return cacheMap[cacheId];\n\n cacheMap[cacheId] = compileBits(template.vertex, template.fragment, bits);\n\n return cacheMap[cacheId];\n}\n\nfunction compileInputsAndOutputs(template: HighShaderTemplate, bits: HighShaderBit[])\n{\n const vertexFragments = bits.map((shaderBit) => shaderBit.vertex).filter((v) => !!v);\n const fragmentFragments = bits.map((shaderBit) => shaderBit.fragment).filter((v) => !!v);\n\n // WebGPU compile inputs and outputs..\n let compiledVertex = compileInputs(vertexFragments, template.vertex, true);\n\n compiledVertex = compileOutputs(vertexFragments, compiledVertex);\n\n const compiledFragment = compileInputs(fragmentFragments, template.fragment, true);\n\n return {\n vertex: compiledVertex,\n fragment: compiledFragment,\n };\n}\n\nfunction generateCacheId(template: HighShaderTemplate, bits: HighShaderBit[]): string\n{\n return bits\n .map((highFragment) =>\n {\n if (!bitCacheMap.has(highFragment))\n {\n bitCacheMap.set(highFragment, CACHE_UID++);\n }\n\n return bitCacheMap.get(highFragment);\n })\n .sort((a, b) => a - b)\n .join('-') + template.vertex + template.fragment;\n}\n\nfunction compileBits(vertex: string, fragment: string, bits: HighShaderBit[])\n{\n const vertexParts = compileHooks(vertex);\n const fragmentParts = compileHooks(fragment);\n\n bits.forEach((shaderBit) =>\n {\n addBits(shaderBit.vertex, vertexParts, shaderBit.name);\n addBits(shaderBit.fragment, fragmentParts, shaderBit.name);\n });\n\n return {\n vertex: injectBits(vertex, vertexParts),\n fragment: injectBits(fragment, fragmentParts),\n };\n}\n", "/** @ignore */\nconst vertexGPUTemplate = /* wgsl */`\n @in aPosition: vec2<f32>;\n @in aUV: vec2<f32>;\n\n @out @builtin(position) vPosition: vec4<f32>;\n @out vUV : vec2<f32>;\n @out vColor : vec4<f32>;\n\n {{header}}\n\n struct VSOutput {\n {{struct}}\n };\n\n @vertex\n fn main( {{in}} ) -> VSOutput {\n\n var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;\n var modelMatrix = mat3x3<f32>(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n var position = aPosition;\n var uv = aUV;\n\n {{start}}\n\n vColor = vec4<f32>(1., 1., 1., 1.);\n\n {{main}}\n\n vUV = uv;\n\n var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= globalUniforms.uWorldColorAlpha;\n\n {{end}}\n\n {{return}}\n };\n`;\n\n/** @ignore */\nconst fragmentGPUTemplate = /* wgsl */`\n @in vUV : vec2<f32>;\n @in vColor : vec4<f32>;\n\n {{header}}\n\n @fragment\n fn main(\n {{in}}\n ) -> @location(0) vec4<f32> {\n\n {{start}}\n\n var outColor:vec4<f32>;\n\n {{main}}\n\n var finalColor:vec4<f32> = outColor * vColor;\n\n {{end}}\n\n return finalColor;\n };\n`;\n\n/** @ignore */\nconst vertexGlTemplate = /* glsl */`\n in vec2 aPosition;\n in vec2 aUV;\n\n out vec4 vColor;\n out vec2 vUV;\n\n {{header}}\n\n void main(void){\n\n mat3 worldTransformMatrix = uWorldTransformMatrix;\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n vec2 position = aPosition;\n vec2 uv = aUV;\n\n {{start}}\n\n vColor = vec4(1.);\n\n {{main}}\n\n vUV = uv;\n\n mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= uWorldColorAlpha;\n\n {{end}}\n }\n`;\n\n/** @ignore */\nconst fragmentGlTemplate = /* glsl */`\n\n in vec4 vColor;\n in vec2 vUV;\n\n out vec4 finalColor;\n\n {{header}}\n\n void main(void) {\n\n {{start}}\n\n vec4 outColor;\n\n {{main}}\n\n finalColor = outColor * vColor;\n\n {{end}}\n }\n`;\n\nexport {\n fragmentGlTemplate,\n fragmentGPUTemplate,\n vertexGlTemplate,\n vertexGPUTemplate\n};\n", "/** @internal */\nexport const globalUniformsBit = {\n name: 'global-uniforms-bit',\n vertex: {\n header: /* wgsl */`\n struct GlobalUniforms {\n uProjectionMatrix:mat3x3<f32>,\n uWorldTransformMatrix:mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n }\n\n @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;\n `\n }\n};\n\n/** @internal */\nexport const globalUniformsUBOBitGl = {\n name: 'global-uniforms-ubo-bit',\n vertex: {\n header: /* glsl */`\n uniform globalUniforms {\n mat3 uProjectionMatrix;\n mat3 uWorldTransformMatrix;\n vec4 uWorldColorAlpha;\n vec2 uResolution;\n };\n `\n }\n};\n\n/** @internal */\nexport const globalUniformsBitGl = {\n name: 'global-uniforms-bit',\n vertex: {\n header: /* glsl */`\n uniform mat3 uProjectionMatrix;\n uniform mat3 uWorldTransformMatrix;\n uniform vec4 uWorldColorAlpha;\n uniform vec2 uResolution;\n `\n }\n\n};\n", "import { GlProgram } from '../renderers/gl/shader/GlProgram';\nimport { GpuProgram } from '../renderers/gpu/shader/GpuProgram';\nimport { compileHighShader, compileHighShaderGl } from './compiler/compileHighShader';\nimport { fragmentGlTemplate, fragmentGPUTemplate, vertexGlTemplate, vertexGPUTemplate } from './defaultProgramTemplate';\nimport { globalUniformsBit, globalUniformsBitGl } from './shader-bits/globalUniformsBit';\n\nimport type { HighShaderBit } from './compiler/types';\n\n/**\n * @param root0\n * @param root0.bits\n * @param root0.name\n * @internal\n */\nexport function compileHighShaderGpuProgram({ bits, name }: {bits: HighShaderBit[], name: string}): GpuProgram\n{\n const source = compileHighShader({\n template: {\n fragment: fragmentGPUTemplate,\n vertex: vertexGPUTemplate,\n },\n bits: [\n globalUniformsBit,\n ...bits,\n ]\n });\n\n return GpuProgram.from({\n name,\n vertex: {\n source: source.vertex,\n entryPoint: 'main',\n },\n fragment: {\n source: source.fragment,\n entryPoint: 'main',\n },\n });\n}\n\n/**\n * @param root0\n * @param root0.bits\n * @param root0.name\n * @internal\n */\nexport function compileHighShaderGlProgram({ bits, name }: {bits: HighShaderBit[], name: string}): GlProgram\n{\n return new GlProgram({\n name,\n ...compileHighShaderGl({\n template: {\n vertex: vertexGlTemplate,\n fragment: fragmentGlTemplate,\n },\n bits: [\n globalUniformsBitGl,\n ...bits,\n ]\n })\n });\n}\n", "/** @internal */\nexport const colorBit = {\n name: 'color-bit',\n vertex: {\n header: /* wgsl */`\n @in aColor: vec4<f32>;\n `,\n main: /* wgsl */`\n vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);\n `\n }\n};\n\n/** @internal */\nexport const colorBitGl = {\n name: 'color-bit',\n vertex: {\n header: /* glsl */`\n in vec4 aColor;\n `,\n main: /* glsl */`\n vColor *= vec4(aColor.rgb * aColor.a, aColor.a);\n `\n }\n};\n", "import type { HighShaderBit } from '../compiler/types';\n\nconst textureBatchBitGpuCache: Record<number, HighShaderBit> = {};\n\n/**\n *\n * @param maxTextures - the max textures the shader can use.\n * @returns a shader bit that will allow the shader to sample multiple textures AND round pixels.\n */\nfunction generateBindingSrc(maxTextures: number): string\n{\n const src = [];\n\n if (maxTextures === 1)\n {\n src.push('@group(1) @binding(0) var textureSource1: texture_2d<f32>;');\n src.push('@group(1) @binding(1) var textureSampler1: sampler;');\n }\n else\n {\n let bindingIndex = 0;\n\n for (let i = 0; i < maxTextures; i++)\n {\n src.push(`@group(1) @binding(${bindingIndex++}) var textureSource${i + 1}: texture_2d<f32>;`);\n src.push(`@group(1) @binding(${bindingIndex++}) var textureSampler${i + 1}: sampler;`);\n }\n }\n\n return src.join('\\n');\n}\n\nfunction generateSampleSrc(maxTextures: number): string\n{\n const src = [];\n\n if (maxTextures === 1)\n {\n src.push('outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);');\n }\n else\n {\n src.push('switch vTextureId {');\n\n for (let i = 0; i < maxTextures; i++)\n {\n if (i === maxTextures - 1)\n {\n src.push(` default:{`);\n }\n else\n {\n src.push(` case ${i}:{`);\n }\n src.push(` outColor = textureSampleGrad(textureSource${i + 1}, textureSampler${i + 1}, vUV, uvDx, uvDy);`);\n src.push(` break;}`);\n }\n\n src.push(`}`);\n }\n\n return src.join('\\n');\n}\n\n/**\n * @param maxTextures\n * @internal\n */\nexport function generateTextureBatchBit(maxTextures: number): HighShaderBit\n{\n if (!textureBatchBitGpuCache[maxTextures])\n {\n textureBatchBitGpuCache[maxTextures] = {\n name: 'texture-batch-bit',\n vertex: {\n header: `\n @in aTextureIdAndRound: vec2<u32>;\n @out @interpolate(flat) vTextureId : u32;\n `,\n main: `\n vTextureId = aTextureIdAndRound.y;\n `,\n end: `\n if(aTextureIdAndRound.x == 1)\n {\n vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n `\n },\n fragment: {\n header: `\n @in @interpolate(flat) vTextureId: u32;\n\n ${generateBindingSrc(maxTextures)}\n `,\n main: `\n var uvDx = dpdx(vUV);\n var uvDy = dpdy(vUV);\n\n ${generateSampleSrc(maxTextures)}\n `\n }\n };\n }\n\n return textureBatchBitGpuCache[maxTextures];\n}\n\nconst textureBatchBitGlCache: Record<number, HighShaderBit> = {};\n\n/**\n *\n * @param maxTextures - the max textures the shader can use.\n * @returns a shader bit that will allow the shader to sample multiple textures AND round pixels.\n */\nfunction generateSampleGlSrc(maxTextures: number): string\n{\n const src = [];\n\n for (let i = 0; i < maxTextures; i++)\n {\n if (i > 0)\n {\n src.push('else');\n }\n\n if (i < maxTextures - 1)\n {\n src.push(`if(vTextureId < ${i}.5)`);\n }\n\n src.push('{');\n src.push(`\\toutColor = texture(uTextures[${i}], vUV);`);\n src.push('}');\n }\n\n return src.join('\\n');\n}\n\n/**\n * @param maxTextures\n * @internal\n */\nexport function generateTextureBatchBitGl(maxTextures: number): HighShaderBit\n{\n if (!textureBatchBitGlCache[maxTextures])\n {\n textureBatchBitGlCache[maxTextures] = {\n name: 'texture-batch-bit',\n vertex: {\n header: `\n in vec2 aTextureIdAndRound;\n out float vTextureId;\n\n `,\n main: `\n vTextureId = aTextureIdAndRound.y;\n `,\n end: `\n if(aTextureIdAndRound.x == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n `\n },\n fragment: {\n header: `\n in float vTextureId;\n\n uniform sampler2D uTextures[${maxTextures}];\n\n `,\n main: `\n\n ${generateSampleGlSrc(maxTextures)}\n `\n }\n };\n }\n\n return textureBatchBitGlCache[maxTextures];\n}\n", "/** @internal */\nexport const roundPixelsBit = {\n name: 'round-pixels-bit',\n vertex: {\n header: /* wgsl */`\n fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n `\n }\n};\n\n/** @internal */\nexport const roundPixelsBitGl = {\n name: 'round-pixels-bit',\n vertex: {\n header: /* glsl */`\n vec2 roundPixels(vec2 position, vec2 targetSize)\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n `\n }\n};\n\n", "// TODO add more types as required\n/** @internal */\nexport const UNIFORM_TYPES_VALUES = [\n 'f32',\n 'i32',\n 'vec2<f32>',\n 'vec3<f32>',\n 'vec4<f32>',\n 'mat2x2<f32>',\n 'mat3x3<f32>',\n 'mat4x4<f32>',\n 'mat3x2<f32>',\n 'mat4x2<f32>',\n 'mat2x3<f32>',\n 'mat4x3<f32>',\n 'mat2x4<f32>',\n 'mat3x4<f32>',\n 'vec2<i32>',\n 'vec3<i32>',\n 'vec4<i32>',\n] as const;\n\n/**\n * useful for checking if a type is supported - a map of supported types with a true value.\n * @internal\n */\nexport const UNIFORM_TYPES_MAP = UNIFORM_TYPES_VALUES.reduce((acc, type) =>\n{\n acc[type] = true;\n\n return acc;\n}, {} as Record<UNIFORM_TYPES, boolean>);\n\n/** @internal */\nexport type UNIFORM_TYPES_SINGLE = typeof UNIFORM_TYPES_VALUES[number];\n\ntype OPTIONAL_SPACE = ' ' | '';\n\n/** @internal */\nexport type UNIFORM_TYPES_ARRAY = `array<${UNIFORM_TYPES_SINGLE},${OPTIONAL_SPACE}${number}>`;\n\n/** @internal */\nexport type UNIFORM_TYPES = UNIFORM_TYPES_SINGLE | UNIFORM_TYPES_ARRAY;\n\n/**\n * This is the type of the uniform structures that are used in the UniformGroup.\n * @category rendering\n * @advanced\n */\nexport interface UniformData\n{\n /** the value of the uniform, this could be any object - a parser will figure out how to write it to the buffer */\n value: unknown;\n type: UNIFORM_TYPES;\n /** the size of the variable (eg 2 for vec2, 3 for vec3, 4 for vec4) */\n size?: number;\n name?: string;\n}\n\n/** @internal */\nexport interface UboElement\n{\n data: UniformData;\n offset: number;\n size: number;\n}\n\n/** @internal */\nexport interface UboLayout\n{\n uboElements: UboElement[];\n /** float32 size // TODO change to bytes */\n size: number;\n}\n\n/** @internal */\nexport type UniformsSyncCallback = (...args: any[]) => void;\n", "/**\n * @param {string} type - Type of value\n * @param {number} size\n * @private\n */\nexport function getDefaultUniformValue(\n type: string,\n size: number\n): number | Float32Array | Int32Array | Uint32Array | boolean | boolean[]\n{\n switch (type)\n {\n case 'f32':\n return 0;\n\n case 'vec2<f32>':\n return new Float32Array(2 * size);\n\n case 'vec3<f32>':\n return new Float32Array(3 * size);\n\n case 'vec4<f32>':\n return new Float32Array(4 * size);\n case 'mat2x2<f32>':\n return new Float32Array([1, 0,\n 0, 1]);\n\n case 'mat3x3<f32>':\n return new Float32Array([1, 0, 0,\n 0, 1, 0,\n 0, 0, 1]);\n\n case 'mat4x4<f32>':\n return new Float32Array([1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1]);\n }\n\n return null;\n}\n", "import { uid } from '../../../../utils/data/uid';\nimport { createIdFromString } from '../utils/createIdFromString';\nimport { UNIFORM_TYPES_MAP, UNIFORM_TYPES_VALUES, type UniformData } from './types';\nimport { getDefaultUniformValue } from './utils/getDefaultUniformValue';\n\nimport type { BindResource } from '../../gpu/shader/BindResource';\nimport type { Buffer } from '../buffer/Buffer';\n\ntype FLOPS<T = UniformData> = T extends { value: infer V } ? V : never;\n\n/**\n * Extracts the value type from a uniform data object.\n * @internal\n */\nexport type ExtractUniformObject<T = Record<string, UniformData>> = {\n [K in keyof T]: FLOPS<T[K]>;\n};\n\n/**\n * Uniform group options\n * @category rendering\n * @advanced\n */\nexport type UniformGroupOptions = {\n /**\n * if true the UniformGroup is handled as an Uniform buffer object.\n * This is the only way WebGPU can work with uniforms. WebGL2 can also use this.\n * So don't set to true if you want to use WebGPU :D\n */\n ubo?: boolean;\n /** if true, then you are responsible for when the data is uploaded to the GPU by calling `update()` */\n isStatic?: boolean;\n};\n\n/**\n * Uniform group holds uniform map and some ID's for work\n *\n * `UniformGroup` has two modes:\n *\n * 1: Normal mode\n * Normal mode will upload the uniforms with individual function calls as required. This is the default mode\n * for WebGL rendering.\n *\n * 2: Uniform buffer mode\n * This mode will treat the uniforms as a uniform buffer. You can pass in either a buffer that you manually handle, or\n * or a generic object that PixiJS will automatically map to a buffer for you.\n * For maximum benefits, make Ubo UniformGroups static, and only update them each frame.\n * This is the only way uniforms can be used with WebGPU.\n *\n * Rules of UBOs:\n * - UBOs only work with WebGL2, so make sure you have a fallback!\n * - Only floats are supported (including vec[2,3,4], mat[2,3,4])\n * - Samplers cannot be used in ubo's (a GPU limitation)\n * - You must ensure that the object you pass in exactly matches in the shader ubo structure.\n * Otherwise, weirdness will ensue!\n * - The name of the ubo object added to the group must match exactly the name of the ubo in the shader.\n *\n * When declaring your uniform options, you ust parse in the value and the type of the uniform.\n * The types correspond to the WebGPU types\n *\n Uniforms can be modified via the classes 'uniforms' property. It will contain all the uniforms declared in the constructor.\n *\n * ```ts\n * // UBO in shader:\n * uniform myCoolData { // Declaring a UBO...\n * mat4 uCoolMatrix;\n * float uFloatyMcFloatFace;\n * };\n * ```\n *\n * ```js\n * // A new Uniform Buffer Object...\n * const myCoolData = new UniformGroup({\n * uCoolMatrix: {value:new Matrix(), type: 'mat4<f32>'},\n * uFloatyMcFloatFace: {value:23, type: 'f32'},\n * }}\n *\n * // modify the data\n * myCoolData.uniforms.uFloatyMcFloatFace = 42;\n * // Build a shader...\n * const shader = Shader.from(srcVert, srcFrag, {\n * myCoolData // Name matches the UBO name in the shader. Will be processed accordingly.\n * })\n * ```\n * @category rendering\n * @advanced\n */\nexport class UniformGroup<UNIFORMS extends { [key: string]: UniformData } = any> implements BindResource\n{\n /** The default options used by the uniform group. */\n public static defaultOptions: UniformGroupOptions = {\n /** if true the UniformGroup is handled as an Uniform buffer object. */\n ubo: false,\n /** if true, then you are responsible for when the data is uploaded to the GPU by calling `update()` */\n isStatic: false,\n };\n\n /**\n * used internally to know if a uniform group was used in the last render pass\n * @internal\n */\n public _touched = 0;\n\n /** a unique id for this uniform group used through the renderer */\n public readonly uid: number = uid('uniform');\n /**\n * a resource type, used to identify how to handle it when its in a bind group / shader resource\n * @internal\n */\n public _resourceType = 'uniformGroup';\n /**\n * the resource id used internally by the renderer to build bind group keys\n * @internal\n */\n public _resourceId = uid('resource');\n /** the structures of the uniform group */\n public uniformStructures: UNIFORMS;\n /** the uniforms as an easily accessible map of properties */\n public uniforms: ExtractUniformObject<UNIFORMS>;\n /** true if it should be used as a uniform buffer object */\n public ubo: boolean;\n /** an underlying buffer that will be uploaded to the GPU when using this UniformGroup */\n public buffer?: Buffer;\n /**\n * if true, then you are responsible for when the data is uploaded to the GPU.\n * otherwise, the data is reuploaded each frame.\n */\n public isStatic: boolean;\n /** used ito identify if this is a uniform group */\n public readonly isUniformGroup = true;\n /**\n * used to flag if this Uniform groups data is different from what it has stored in its buffer / on the GPU\n * @internal\n */\n public _dirtyId = 0;\n /**\n * a signature string generated for internal use\n * @internal\n */\n public readonly _signature: number;\n\n // implementing the interface - UniformGroup are not destroyed\n public readonly destroyed = false;\n\n /**\n * Create a new Uniform group\n * @param uniformStructures - The structures of the uniform group\n * @param options - The optional parameters of this uniform group\n */\n constructor(uniformStructures: UNIFORMS, options?: UniformGroupOptions)\n {\n options = { ...UniformGroup.defaultOptions, ...options };\n\n this.uniformStructures = uniformStructures;\n\n const uniforms = {} as ExtractUniformObject<UNIFORMS>;\n\n for (const i in uniformStructures)\n {\n const uniformData = uniformStructures[i] as UniformData;\n\n uniformData.name = i;\n uniformData.size = uniformData.size ?? 1;\n\n if (!UNIFORM_TYPES_MAP[uniformData.type])\n {\n const arrayMatch = uniformData.type.match(/^array<(\\w+(?:<\\w+>)?),\\s*(\\d+)>$/);\n\n if (arrayMatch)\n {\n const [, innerType, size] = arrayMatch;\n\n throw new Error(\n `Uniform type ${uniformData.type} is not supported. Use type: '${innerType}', size: ${size} instead.`\n );\n }\n\n // eslint-disable-next-line max-len\n throw new Error(`Uniform type ${uniformData.type} is not supported. Supported uniform types are: ${UNIFORM_TYPES_VALUES.join(', ')}`);\n }\n\n uniformData.value ??= getDefaultUniformValue(uniformData.type, uniformData.size);\n\n uniforms[i] = uniformData.value as ExtractUniformObject<UNIFORMS>[keyof UNIFORMS];\n }\n\n this.uniforms = uniforms;\n\n this._dirtyId = 1;\n this.ubo = options.ubo;\n this.isStatic = options.isStatic;\n\n this._signature = createIdFromString(Object.keys(uniforms).map(\n (i) => `${i}-${(uniformStructures[i as keyof typeof uniformStructures] as UniformData).type}`\n ).join('-'), 'uniform-group');\n }\n\n /** Call this if you want the uniform groups data to be uploaded to the GPU only useful if `isStatic` is true. */\n public update(): void\n {\n this._dirtyId++;\n // dispatch...\n }\n}\n", "import { UniformGroup } from '../../shared/shader/UniformGroup';\n\nconst batchSamplersUniformGroupHash: Record<number, UniformGroup> = {};\n\n/**\n * Automatically generates a uniform group that holds the texture samplers for a shader.\n * This is used mainly by the shaders that batch textures!\n * @param maxTextures - the number of textures that this uniform group will contain.\n * @returns a uniform group that holds the texture samplers.\n * @internal\n */\nexport function getBatchSamplersUniformGroup(maxTextures: number)\n{\n let batchSamplersUniformGroup = batchSamplersUniformGroupHash[maxTextures];\n\n if (batchSamplersUniformGroup) return batchSamplersUniformGroup;\n\n const sampleValues = new Int32Array(maxTextures);\n\n for (let i = 0; i < maxTextures; i++)\n {\n sampleValues[i] = i;\n }\n\n batchSamplersUniformGroup = batchSamplersUniformGroupHash[maxTextures] = new UniformGroup({\n uTextures: { value: sampleValues, type: `i32`, size: maxTextures }\n }, { isStatic: true });\n\n return batchSamplersUniformGroup;\n}\n", "import EventEmitter from 'eventemitter3';\nimport { uid } from '../../../../utils/data/uid';\nimport { GlProgram } from '../../gl/shader/GlProgram';\nimport { BindGroup } from '../../gpu/shader/BindGroup';\nimport { GpuProgram } from '../../gpu/shader/GpuProgram';\nimport { RendererType } from '../../types';\nimport { UniformGroup } from './UniformGroup';\n\nimport type { GlProgramOptions } from '../../gl/shader/GlProgram';\nimport type { BindResource } from '../../gpu/shader/BindResource';\nimport type { GpuProgramOptions } from '../../gpu/shader/GpuProgram';\n\n/**\n * A record of {@link BindGroup}'s used by the shader.\n *\n * `Record<number, BindGroup>`\n * @category rendering\n * @advanced\n */\nexport type ShaderGroups = Record<number, BindGroup>;\n\ninterface ShaderBase\n{\n /** The WebGL program used by the WebGL renderer. */\n glProgram?: GlProgram\n /** The WebGPU program used by the WebGPU renderer. */\n gpuProgram?: GpuProgram\n /**\n * A number that uses two bits on whether the shader is compatible with the WebGL renderer and/or the WebGPU renderer.\n * 0b00 - not compatible with either\n * 0b01 - compatible with WebGL\n * 0b10 - compatible with WebGPU\n * This is automatically set based on if a {@link GlProgram} or {@link GpuProgram} is provided.\n */\n compatibleRenderers?: number\n}\n\n/**\n * A base interface for shaders that includes the common properties.\n * @category rendering\n * @advanced\n */\nexport interface GlShaderWith extends ShaderBase\n{\n /** The WebGL program used by the WebGL renderer. */\n glProgram: GlProgram\n}\n\n/**\n * A base interface for shaders that includes the common properties.\n * @category rendering\n * @advanced\n */\nexport interface GpuShaderWith extends ShaderBase\n{\n /** The WebGPU program used by the WebGPU renderer. */\n gpuProgram: GpuProgram\n}\n\n/**\n * A descriptor for a shader with groups.\n * This is used to define a shader that uses {@link BindGroup}'s.\n * @category rendering\n * @advanced\n */\nexport interface ShaderWithGroupsDescriptor\n{\n /** A record of {@link BindGroup}'s used by the shader. */\n groups: ShaderGroups;\n /** an optional map of how to bind the groups. This is automatically generated by reading the WebGPU program */\n groupMap?: Record<string, Record<string, any>>;\n}\n\ninterface ShaderWithResourcesDescriptor\n{\n /**\n * A key value of uniform resources used by the shader.\n * Under the hood pixi will look at the provided shaders and figure out where\n * the resources are mapped. Its up to you to make sure the resource key\n * matches the uniform name in the webGPU program. WebGL is a little more forgiving!\n */\n resources?: Record<string, any>;\n}\n\ninterface GroupsData\n{\n group: number\n binding: number\n name: string\n}\n\n/**\n * A descriptor for a shader\n * @category rendering\n * @advanced\n */\nexport type ShaderWith = GlShaderWith | GpuShaderWith;\n\n/**\n * A descriptor for a shader with groups.\n * @category rendering\n * @advanced\n */\nexport type ShaderWithGroups = ShaderWithGroupsDescriptor & ShaderWith;\n\n/**\n * A descriptor for a shader with resources. This is an easier way to work with uniforms.\n * especially when you are not working with bind groups\n * @category rendering\n * @advanced\n */\nexport type ShaderWithResources = ShaderWithResourcesDescriptor & ShaderWith;\n/**\n * A shader that can be used with both WebGL and WebGPU.\n * @category rendering\n * @advanced\n */\nexport interface IShaderWithResources extends ShaderWithResourcesDescriptor, ShaderBase {}\n\n/**\n * A descriptor for a shader that can be used with both WebGL and WebGPU.\n * @category rendering\n * @advanced\n */\nexport type ShaderDescriptor = ShaderWithGroups & ShaderWithResources;\n\n/**\n * A descriptor for a shader with resources and groups.\n * @category rendering\n */\ntype GlShaderFromWith = {\n gpu?: GpuProgramOptions,\n gl: GlProgramOptions\n};\n/**\n * A descriptor for a shader with groups and resources.\n * @category rendering\n */\ntype GpuShaderFromWith = {\n gpu: GpuProgramOptions,\n gl?: GlProgramOptions\n};\n/**\n * A descriptor for a shader that can be used with both WebGL and WebGPU.\n * @category rendering\n * @advanced\n */\nexport type ShaderFromGroups = (GlShaderFromWith | GpuShaderFromWith) & Omit<ShaderWithGroups, 'glProgram' | 'gpuProgram'>;\n/**\n * A descriptor for a shader that can be used with both WebGL and WebGPU.\n * @category rendering\n * @advanced\n */\nexport type ShaderFromResources = (GlShaderFromWith | GpuShaderFromWith)\n& Omit<ShaderWithResources, 'glProgram' | 'gpuProgram'>;\n\n/**\n * The Shader class is an integral part of the PixiJS graphics pipeline.\n * Central to rendering in PixiJS are two key elements: A [shader] and a [geometry].\n * The shader incorporates a {@link GlProgram} for WebGL or a {@link GpuProgram} for WebGPU,\n * instructing the respective technology on how to render the geometry.\n *\n * The primary goal of the Shader class is to offer a unified interface compatible with both WebGL and WebGPU.\n * When constructing a shader, you need to provide both a WebGL program and a WebGPU program due to the distinctions\n * between the two rendering engines. If only one is provided, the shader won't function with the omitted renderer.\n *\n * Both WebGL and WebGPU utilize the same resource object when passed into the shader.\n * Post-creation, the shader's interface remains consistent across both WebGL and WebGPU.\n * The sole distinction lies in whether a glProgram or a gpuProgram is employed.\n *\n * Modifying shader uniforms, which can encompass:\n * - TextureSampler {@link TextureStyle}\n * - TextureSource {@link TextureSource}\n * - UniformsGroups {@link UniformGroup}\n * @example\n *\n * const shader = new Shader({\n * glProgram: glProgram,\n * gpuProgram: gpuProgram,\n * resources: {\n * uTexture: texture.source,\n * uSampler: texture.sampler,\n * uColor: [1, 0, 0, 1],\n * },\n * });\n *\n * // update the uniforms\n * shader.resources.uColor[1] = 1;\n * shader.resources.uTexture = texture2.source;\n * @class\n * @category rendering\n * @advanced\n */\nexport class Shader extends EventEmitter<{'destroy': Shader}>\n{\n /** A unique identifier for the shader */\n public readonly uid: number = uid('shader');\n /** An instance of the GPU program used by the WebGPU renderer */\n public gpuProgram: GpuProgram;\n /** An instance of the GL program used by the WebGL renderer */\n public glProgram: GlProgram;\n /**\n * A number that uses two bits on whether the shader is compatible with the WebGL renderer and/or the WebGPU renderer.\n * 0b00 - not compatible with either\n * 0b01 - compatible with WebGL\n * 0b10 - compatible with WebGPU\n * This is automatically set based on if a {@link GlProgram} or {@link GpuProgram} is provided.\n */\n public readonly compatibleRenderers: number;\n /** */\n public groups: Record<number, BindGroup>;\n /** A record of the resources used by the shader. */\n public resources: Record<string, any>;\n /**\n * A record of the uniform groups and resources used by the shader.\n * This is used by WebGL renderer to sync uniform data.\n * @internal\n */\n public _uniformBindMap: Record<number, Record<number, string>> = Object.create(null);\n private readonly _ownedBindGroups: BindGroup[] = [];\n\n /** @internal */\n public _destroyed: boolean = false;\n\n /**\n * Fired after rendering finishes.\n * @event Shader#destroy\n */\n\n /**\n * There are two ways to create a shader.\n * one is to pass in resources which is a record of uniform groups and resources.\n * another is to pass in groups which is a record of {@link BindGroup}s.\n * this second method is really to make use of shared {@link BindGroup}s.\n * For most cases you will want to use resources as they are easier to work with.\n * USe Groups if you want to share {@link BindGroup}s between shaders.\n * you cannot mix and match - either use resources or groups.\n * @param options - The options for the shader\n */\n constructor(options: ShaderWithResources);\n constructor(options: ShaderWithGroups);\n constructor(options: ShaderDescriptor)\n {\n super();\n\n /* eslint-disable prefer-const */\n let {\n gpuProgram,\n glProgram,\n groups,\n resources,\n compatibleRenderers,\n groupMap\n } = options;\n /* eslint-enable prefer-const */\n\n this.gpuProgram = gpuProgram;\n this.glProgram = glProgram;\n\n if (compatibleRenderers === undefined)\n {\n compatibleRenderers = 0;\n\n if (gpuProgram)compatibleRenderers |= RendererType.WEBGPU;\n if (glProgram)compatibleRenderers |= RendererType.WEBGL;\n }\n\n this.compatibleRenderers = compatibleRenderers;\n\n const nameHash: Record<string, GroupsData> = {};\n\n if (!resources && !groups)\n {\n resources = {};\n }\n\n if (resources && groups)\n {\n throw new Error('[Shader] Cannot have both resources and groups');\n }\n else if (!gpuProgram && groups && !groupMap)\n {\n throw new Error('[Shader] No group map or WebGPU shader provided - consider using resources instead.');\n }\n else if (!gpuProgram && groups && groupMap)\n {\n for (const i in groupMap)\n {\n for (const j in groupMap[i])\n {\n const uniformName = groupMap[i][j];\n\n nameHash[uniformName] = {\n group: i as unknown as number,\n binding: j as unknown as number,\n name: uniformName\n };\n }\n }\n }\n else if (gpuProgram && groups && !groupMap)\n {\n const groupData = gpuProgram.structsAndGroups.groups;\n\n groupMap = {};\n\n groupData.forEach((data) =>\n {\n groupMap[data.group] = groupMap[data.group] || {};\n groupMap[data.group][data.binding] = data.name;\n\n nameHash[data.name] = data;\n });\n }\n else if (resources)\n {\n groups = {};\n groupMap = {};\n\n if (gpuProgram)\n {\n const groupData = gpuProgram.structsAndGroups.groups;\n\n groupData.forEach((data) =>\n {\n groupMap[data.group] = groupMap[data.group] || {};\n groupMap[data.group][data.binding] = data.name;\n\n nameHash[data.name] = data;\n });\n }\n\n let bindTick = 0;\n\n for (const i in resources)\n {\n if (nameHash[i]) continue;\n\n // build out a dummy bind group..\n if (!groups[99])\n {\n groups[99] = new BindGroup();\n this._ownedBindGroups.push(groups[99]);\n }\n // Yes i know this is a little strange, but wil line up the shaders neatly\n // basically we want to be driven by how webGPU does things.\n // so making a fake group will work and not affect gpu as it means no gpu shader was provided..\n nameHash[i] = { group: 99, binding: bindTick, name: i };\n\n groupMap[99] = groupMap[99] || {};\n groupMap[99][bindTick] = i;\n\n bindTick++;\n }\n\n for (const i in resources)\n {\n const name = i;\n let value = resources[i];\n\n if (!(value.source) && !(value as BindResource)._resourceType)\n {\n value = new UniformGroup(value);\n }\n\n const data = nameHash[name];\n\n if (data)\n {\n if (!groups[data.group])\n {\n groups[data.group] = new BindGroup();\n\n this._ownedBindGroups.push(groups[data.group]);\n }\n\n groups[data.group].setResource(value, data.binding);\n }\n }\n }\n\n this.groups = groups;\n this._uniformBindMap = groupMap;\n\n this.resources = this._buildResourceAccessor(groups, nameHash);\n }\n\n /**\n * Sometimes a resource group will be provided later (for example global uniforms)\n * In such cases, this method can be used to let the shader know about the group.\n * @param name - the name of the resource group\n * @param groupIndex - the index of the group (should match the webGPU shader group location)\n * @param bindIndex - the index of the bind point (should match the webGPU shader bind point)\n */\n public addResource(name: string, groupIndex: number, bindIndex: number): void\n {\n this._uniformBindMap[groupIndex] ||= {};\n\n this._uniformBindMap[groupIndex][bindIndex] ||= name;\n\n if (!this.groups[groupIndex])\n {\n this.groups[groupIndex] = new BindGroup();\n this._ownedBindGroups.push(this.groups[groupIndex]);\n }\n }\n\n private _buildResourceAccessor(groups: ShaderGroups, nameHash: Record<string, GroupsData>)\n {\n const uniformsOut = {};\n\n for (const i in nameHash)\n {\n const data = nameHash[i];\n\n // add getter setter for uniforms\n Object.defineProperty(uniformsOut, data.name, {\n get()\n {\n return groups[data.group].getResource(data.binding);\n },\n set(value)\n {\n groups[data.group].setResource(value, data.binding);\n }\n });\n }\n\n return uniformsOut;\n }\n\n /**\n * Use to destroy the shader when its not longer needed.\n * It will destroy the resources and remove listeners.\n * @param destroyPrograms - if the programs should be destroyed as well.\n * Make sure its not being used by other shaders!\n */\n public destroy(destroyPrograms = false): void\n {\n if (this._destroyed) return;\n this._destroyed = true;\n\n this.emit('destroy', this);\n\n if (destroyPrograms)\n {\n this.gpuProgram?.destroy();\n this.glProgram?.destroy();\n }\n\n this.gpuProgram = null;\n this.glProgram = null;\n\n this.removeAllListeners();\n\n this._uniformBindMap = null;\n\n this._ownedBindGroups.forEach((bindGroup) =>\n {\n bindGroup.destroy();\n });\n\n (this._ownedBindGroups as null) = null;\n\n this.resources = null;\n this.groups = null;\n }\n\n /**\n * A short hand function to create a shader based of a vertex and fragment shader.\n * @param options\n * @returns A shiny new PixiJS shader!\n */\n public static from(options: ShaderFromGroups): Shader;\n public static from(options: ShaderFromResources): Shader;\n public static from(options: ShaderFromGroups & ShaderFromResources): Shader\n {\n const { gpu, gl, ...rest } = options;\n\n let gpuProgram: GpuProgram;\n let glProgram: GlProgram;\n\n if (gpu)\n {\n gpuProgram = GpuProgram.from(gpu);\n }\n\n if (gl)\n {\n glProgram = GlProgram.from(gl);\n }\n\n return new Shader({\n gpuProgram,\n glProgram,\n ...rest\n });\n }\n}\n", "\nexport default function earcut(data, holeIndices, dim = 2) {\n\n const hasHoles = holeIndices && holeIndices.length;\n const outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n let outerNode = linkedList(data, 0, outerLen, dim, true);\n const triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n let minX, minY, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = data[0];\n minY = data[1];\n let maxX = minX;\n let maxY = minY;\n\n for (let i = dim; i < outerLen; i += dim) {\n const x = data[i];\n const y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 32767 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n let last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (let i = start; i < end; i += dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);\n } else {\n for (let i = end - dim; i >= start; i -= dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n let p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n let stop = ear;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n const prev = ear.prev;\n const next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n triangles.push(prev.i, ear.i, next.i); // cut off the triangle\n\n removeNode(ear);\n\n // skipping the next vertex leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(filterPoints(ear), triangles);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n const a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox\n const x0 = Math.min(ax, bx, cx),\n y0 = Math.min(ay, by, cy),\n x1 = Math.max(ax, bx, cx),\n y1 = Math.max(ay, by, cy);\n\n let p = c.next;\n while (p !== a) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n const a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox\n const x0 = Math.min(ax, bx, cx),\n y0 = Math.min(ay, by, cy),\n x1 = Math.max(ax, bx, cx),\n y1 = Math.max(ay, by, cy);\n\n // z-order range for the current triangle bbox;\n const minZ = zOrder(x0, y0, minX, minY, invSize),\n maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n let p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles) {\n let p = start;\n do {\n const a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i, p.i, b.i);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n let a = start;\n do {\n let b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n let c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize, 0);\n earcutLinked(c, triangles, dim, minX, minY, invSize, 0);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n const queue = [];\n\n for (let i = 0, len = holeIndices.length; i < len; i++) {\n const start = holeIndices[i] * dim;\n const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n const list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareXYSlope);\n\n // process holes from left to right\n for (let i = 0; i < queue.length; i++) {\n outerNode = eliminateHole(queue[i], outerNode);\n }\n\n return outerNode;\n}\n\nfunction compareXYSlope(a, b) {\n let result = a.x - b.x;\n // when the left-most point of 2 holes meet at a vertex, sort the holes counterclockwise so that when we find\n // the bridge to the outer shell is always the point that they meet at.\n if (result === 0) {\n result = a.y - b.y;\n if (result === 0) {\n const aSlope = (a.next.y - a.y) / (a.next.x - a.x);\n const bSlope = (b.next.y - b.y) / (b.next.x - b.x);\n result = aSlope - bSlope;\n }\n }\n return result;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and link it\nfunction eliminateHole(hole, outerNode) {\n const bridge = findHoleBridge(hole, outerNode);\n if (!bridge) {\n return outerNode;\n }\n\n const bridgeReverse = splitPolygon(bridge, hole);\n\n // filter collinear points around the cuts\n filterPoints(bridgeReverse, bridgeReverse.next);\n return filterPoints(bridge, bridge.next);\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n let p = outerNode;\n const hx = hole.x;\n const hy = hole.y;\n let qx = -Infinity;\n let m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n // unless they intersect at a vertex, then choose the vertex\n if (equals(hole, p)) return p;\n do {\n if (equals(hole, p.next)) return p.next;\n else if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n const x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n m = p.x < p.next.x ? p : p.next;\n if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n const stop = m;\n const mx = m.x;\n const my = m.y;\n let tanMin = Infinity;\n\n p = m;\n\n do {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n const tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if (locallyInside(p, hole) &&\n (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n } while (p !== stop);\n\n return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n let p = start;\n do {\n if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n let numMerges;\n let inSize = 1;\n\n do {\n let p = list;\n let e;\n list = null;\n let tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n let q = p;\n let pSize = 0;\n for (let i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n let qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = (x - minX) * invSize | 0;\n y = (y - minY) * invSize | 0;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n let p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&\n (ax - px) * (by - py) >= (bx - px) * (ay - py) &&\n (bx - px) * (cy - py) >= (cx - px) * (by - py);\n}\n\n// check if a point lies within a convex triangle but false if its equal to the first point of the triangle\nfunction pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {\n return !(ax === px && ay === py) && pointInTriangle(ax, ay, bx, by, cx, cy, px, py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // doesn't intersect other edges\n (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n const o1 = sign(area(p1, q1, p2));\n const o2 = sign(area(p1, q1, q2));\n const o3 = sign(area(p2, q2, p1));\n const o4 = sign(area(p2, q2, q1));\n\n if (o1 !== o2 && o3 !== o4) return true; // general case\n\n if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n let p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n let p = a;\n let inside = false;\n const px = (a.x + b.x) / 2;\n const py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n const a2 = createNode(a.i, a.x, a.y),\n b2 = createNode(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n const p = createNode(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction createNode(i, x, y) {\n return {\n i, // vertex index in coordinates array\n x, y, // vertex coordinates\n prev: null, // previous and next vertex nodes in a polygon ring\n next: null,\n z: 0, // z-order curve value\n prevZ: null, // previous and next nodes in z-order\n nextZ: null,\n steiner: false // indicates whether this is a steiner point\n };\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nexport function deviation(data, holeIndices, dim, triangles) {\n const hasHoles = holeIndices && holeIndices.length;\n const outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n let polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (let i = 0, len = holeIndices.length; i < len; i++) {\n const start = holeIndices[i] * dim;\n const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n let trianglesArea = 0;\n for (let i = 0; i < triangles.length; i += 3) {\n const a = triangles[i] * dim;\n const b = triangles[i + 1] * dim;\n const c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n}\n\nfunction signedArea(data, start, end, dim) {\n let sum = 0;\n for (let i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nexport function flatten(data) {\n const vertices = [];\n const holes = [];\n const dimensions = data[0][0].length;\n let holeIndex = 0;\n let prevLen = 0;\n\n for (const ring of data) {\n for (const p of ring) {\n for (let d = 0; d < dimensions; d++) vertices.push(p[d]);\n }\n if (prevLen) {\n holeIndex += prevLen;\n holes.push(holeIndex);\n }\n prevLen = ring.length;\n }\n return {vertices, holes, dimensions};\n}\n", "import earcutModule from 'earcut';\n\n/**\n * A high performance event emitter\n * @see {@link https://github.com/primus/eventemitter3}\n * @class EventEmitter\n * @category utils\n */\nexport { default as EventEmitter } from 'eventemitter3';\n\n/**\n * A polygon triangulation library\n * @see {@link https://github.com/mapbox/earcut}\n * @param {number[]} vertices - A flat array of vertex coordinates\n * @param {number[]} [holes] - An array of hole indices\n * @param {number} [dimensions=2] - The number of coordinates per vertex in the input array\n * @returns {number[]} Triangulated polygon\n * @category utils\n * @advanced\n */\nexport const earcut = ((earcutModule as any).default || earcutModule) as typeof earcutModule;\n", "import type { BLEND_MODES, CULL_MODES } from './const';\n\nconst blendModeIds = {\n normal: 0,\n add: 1,\n multiply: 2,\n screen: 3,\n overlay: 4,\n erase: 5,\n 'normal-npm': 6,\n 'add-npm': 7,\n 'screen-npm': 8,\n min: 9,\n max: 10,\n};\nconst BLEND = 0;\nconst OFFSET = 1;\nconst CULLING = 2;\nconst DEPTH_TEST = 3;\nconst WINDING = 4;\nconst DEPTH_MASK = 5;\n\n/**\n * This is a WebGL state, and is is passed to {@link GlStateSystem}.\n *\n * Each mesh rendered may require WebGL to be in a different state.\n * For example you may want different blend mode or to enable polygon offsets\n * @category rendering\n * @advanced\n */\nexport class State\n{\n /**\n * The data is a unique number based on the states settings.\n * This lets us quickly compare states with a single number rather than looking\n * at all the individual settings.\n */\n public data: number;\n /** @internal */\n public _blendModeId: number;\n private _blendMode: BLEND_MODES;\n private _polygonOffset: number;\n\n constructor()\n {\n this.data = 0;\n\n this.blendMode = 'normal';\n this.polygonOffset = 0;\n\n this.blend = true;\n this.depthMask = true;\n }\n\n /**\n * Activates blending of the computed fragment color values.\n * @default true\n */\n get blend(): boolean\n {\n return !!(this.data & (1 << BLEND));\n }\n\n set blend(value: boolean)\n {\n if (!!(this.data & (1 << BLEND)) !== value)\n {\n this.data ^= (1 << BLEND);\n }\n }\n\n /**\n * Activates adding an offset to depth values of polygon's fragments\n * @default false\n */\n get offsets(): boolean\n {\n return !!(this.data & (1 << OFFSET));\n }\n\n set offsets(value: boolean)\n {\n if (!!(this.data & (1 << OFFSET)) !== value)\n {\n this.data ^= (1 << OFFSET);\n }\n }\n\n /** The culling settings for this state none - No culling back - Back face culling front - Front face culling */\n set cullMode(value: CULL_MODES)\n {\n if (value === 'none')\n {\n this.culling = false;\n\n return;\n }\n\n this.culling = true;\n this.clockwiseFrontFace = value === 'front';\n }\n\n get cullMode(): CULL_MODES\n {\n if (!this.culling)\n {\n return 'none';\n }\n\n return this.clockwiseFrontFace ? 'front' : 'back';\n }\n\n /**\n * Activates culling of polygons.\n * @default false\n */\n get culling(): boolean\n {\n return !!(this.data & (1 << CULLING));\n }\n\n set culling(value: boolean)\n {\n if (!!(this.data & (1 << CULLING)) !== value)\n {\n this.data ^= (1 << CULLING);\n }\n }\n\n /**\n * Activates depth comparisons and updates to the depth buffer.\n * @default false\n */\n get depthTest(): boolean\n {\n return !!(this.data & (1 << DEPTH_TEST));\n }\n\n set depthTest(value: boolean)\n {\n if (!!(this.data & (1 << DEPTH_TEST)) !== value)\n {\n this.data ^= (1 << DEPTH_TEST);\n }\n }\n\n /**\n * Enables or disables writing to the depth buffer.\n * @default true\n */\n get depthMask(): boolean\n {\n return !!(this.data & (1 << DEPTH_MASK));\n }\n\n set depthMask(value: boolean)\n {\n if (!!(this.data & (1 << DEPTH_MASK)) !== value)\n {\n this.data ^= (1 << DEPTH_MASK);\n }\n }\n\n /**\n * Specifies whether or not front or back-facing polygons can be culled.\n * @default false\n */\n get clockwiseFrontFace(): boolean\n {\n return !!(this.data & (1 << WINDING));\n }\n\n set clockwiseFrontFace(value: boolean)\n {\n if (!!(this.data & (1 << WINDING)) !== value)\n {\n this.data ^= (1 << WINDING);\n }\n }\n\n /**\n * The blend mode to be applied when this state is set. Apply a value of `normal` to reset the blend mode.\n * Setting this mode to anything other than NO_BLEND will automatically switch blending on.\n * @default 'normal'\n */\n get blendMode(): BLEND_MODES\n {\n return this._blendMode;\n }\n\n set blendMode(value: BLEND_MODES)\n {\n this.blend = (value !== 'none');\n this._blendMode = value;\n this._blendModeId = blendModeIds[value as keyof typeof blendModeIds] || 0;\n }\n\n /**\n * The polygon offset. Setting this property to anything other than 0 will automatically enable polygon offset fill.\n * @default 0\n */\n get polygonOffset(): number\n {\n return this._polygonOffset;\n }\n\n set polygonOffset(value: number)\n {\n this.offsets = !!value;\n this._polygonOffset = value;\n }\n\n // #if _DEBUG\n public toString(): string\n {\n return `[pixi.js/core:State `\n + `blendMode=${this.blendMode} `\n + `clockwiseFrontFace=${this.clockwiseFrontFace} `\n + `culling=${this.culling} `\n + `depthMask=${this.depthMask} `\n + `polygonOffset=${this.polygonOffset}`\n + `]`;\n }\n // #endif\n\n /**\n * A quickly getting an instance of a State that is configured for 2d rendering.\n * @returns a new State with values set for 2d rendering\n */\n public static for2d(): State\n {\n const state = new State();\n\n state.depthTest = false;\n state.blend = true;\n\n return state;\n }\n\n public static default2d = State.for2d();\n}\n\n", "/** @internal */\nexport const localUniformBit = {\n name: 'local-uniform-bit',\n vertex: {\n header: /* wgsl */`\n\n struct LocalUniforms {\n uTransformMatrix:mat3x3<f32>,\n uColor:vec4<f32>,\n uRound:f32,\n }\n\n @group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;\n `,\n main: /* wgsl */`\n vColor *= localUniforms.uColor;\n modelMatrix *= localUniforms.uTransformMatrix;\n `,\n end: /* wgsl */`\n if(localUniforms.uRound == 1)\n {\n vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n `\n },\n};\n\n// TODO this works, but i think down the road it will be better to manage groups automatically if there are clashes\n/** @internal */\nexport const localUniformBitGroup2 = {\n ...localUniformBit,\n vertex: {\n ...localUniformBit.vertex,\n // replace the group!\n header: localUniformBit.vertex.header.replace('group(1)', 'group(2)'),\n }\n};\n\n/** @internal */\nexport const localUniformBitGl = {\n name: 'local-uniform-bit',\n vertex: {\n header: /* glsl */`\n\n uniform mat3 uTransformMatrix;\n uniform vec4 uColor;\n uniform float uRound;\n `,\n main: /* glsl */`\n vColor *= uColor;\n modelMatrix = uTransformMatrix;\n `,\n end: /* glsl */`\n if(uRound == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n `\n },\n};\n", "/**\n * Represents the update priorities used by internal Pixi classes when registered with\n * the {@link Ticker} object. Higher priority items are updated first and lower\n * priority items, such as render, should go later.\n * @enum {number}\n * @category ticker\n * @standard\n */\nexport enum UPDATE_PRIORITY\n{\n /**\n * Highest priority used for interaction events in {@link EventSystem}\n * @default 50\n */\n INTERACTION = 50,\n /**\n * High priority updating, used by {@link AnimatedSprite}\n * @default 25\n */\n HIGH = 25,\n /**\n * Default priority for ticker events, see {@link Ticker#add}.\n * @default 0\n */\n NORMAL = 0,\n /**\n * Low priority used for {@link Application} rendering.\n * @default -25\n */\n LOW = -25,\n /**\n * Lowest priority used for {@link PrepareBase} utility.\n * @default -50\n */\n UTILITY = -50,\n}\n", "import type { Ticker, TickerCallback } from './Ticker';\n\n/**\n * Internal class for handling the priority sorting of ticker handlers.\n * @private\n * @class\n */\nexport class TickerListener<T = any>\n{\n /** The current priority. */\n public priority: number;\n /** The next item in chain. */\n public next: TickerListener = null;\n /** The previous item in chain. */\n public previous: TickerListener = null;\n\n /** The handler function to execute. */\n private _fn: TickerCallback<T>;\n /** The calling to execute. */\n private _context: T;\n /** If this should only execute once. */\n private readonly _once: boolean;\n /** `true` if this listener has been destroyed already. */\n private _destroyed = false;\n\n /**\n * Constructor\n * @private\n * @param fn - The listener function to be added for one update\n * @param context - The listener context\n * @param priority - The priority for emitting\n * @param once - If the handler should fire once\n */\n constructor(fn: TickerCallback<T>, context: T = null, priority = 0, once = false)\n {\n this._fn = fn;\n this._context = context;\n this.priority = priority;\n this._once = once;\n }\n\n /**\n * Simple compare function to figure out if a function and context match.\n * @param fn - The listener function to be added for one update\n * @param context - The listener context\n * @returns `true` if the listener match the arguments\n */\n public match(fn: TickerCallback<T>, context: any = null): boolean\n {\n return this._fn === fn && this._context === context;\n }\n\n /**\n * Emit by calling the current function.\n * @param ticker - The ticker emitting.\n * @returns Next ticker\n */\n public emit(ticker: Ticker): TickerListener\n {\n if (this._fn)\n {\n if (this._context)\n {\n this._fn.call(this._context, ticker);\n }\n else\n {\n (this as TickerListener<any>)._fn(ticker);\n }\n }\n\n const redirect = this.next;\n\n if (this._once)\n {\n this.destroy(true);\n }\n\n // Soft-destroying should remove\n // the next reference\n if (this._destroyed)\n {\n this.next = null;\n }\n\n return redirect;\n }\n\n /**\n * Connect to the list.\n * @param previous - Input node, previous listener\n */\n public connect(previous: TickerListener): void\n {\n this.previous = previous;\n if (previous.next)\n {\n previous.next.previous = this;\n }\n this.next = previous.next;\n previous.next = this;\n }\n\n /**\n * Destroy and don't use after this.\n * @param hard - `true` to remove the `next` reference, this\n * is considered a hard destroy. Soft destroy maintains the next reference.\n * @returns The listener to redirect while emitting or removing.\n */\n public destroy(hard = false): TickerListener\n {\n this._destroyed = true;\n this._fn = null;\n this._context = null;\n\n // Disconnect, hook up next and previous\n if (this.previous)\n {\n this.previous.next = this.next;\n }\n\n if (this.next)\n {\n this.next.previous = this.previous;\n }\n\n // Redirect to the next item\n const redirect = this.next;\n\n // Remove references\n this.next = hard ? null : redirect;\n this.previous = null;\n\n return redirect;\n }\n}\n", "import { UPDATE_PRIORITY } from './const';\nimport { TickerListener } from './TickerListener';\n\n/**\n * A callback which can be added to a ticker.\n * The callback receives the Ticker instance as its parameter, providing access to timing properties.\n * @example\n * ```ts\n * ticker.add((ticker) => {\n * // Access deltaTime (dimensionless scalar ~1.0 at 60fps)\n * sprite.rotation += 0.1 * ticker.deltaTime;\n *\n * // Access deltaMS (milliseconds elapsed)\n * const progress = ticker.deltaMS / animationDuration;\n * });\n * ```\n * @category ticker\n * @standard\n */\nexport type TickerCallback<T> = (this: T, ticker: Ticker) => any;\n\n/**\n * A Ticker class that runs an update loop that other objects listen to.\n * Used for managing animation frames and timing in a PixiJS application.\n *\n * It provides a way to add listeners that will be called on each frame,\n * allowing for smooth animations and updates.\n *\n * ## Time Units\n * - `deltaTime`: Dimensionless scalar (typically ~1.0 at 60 FPS) for frame-independent animations\n * - `deltaMS`: Milliseconds elapsed (capped and speed-scaled) for time-based calculations\n * - `elapsedMS`: Raw milliseconds elapsed (uncapped, unscaled) for measurements\n * - `lastTime`: Timestamp in milliseconds since epoch (performance.now() format)\n *\n * Animation frames are requested\n * only when necessary, e.g., when the ticker is started and the emitter has listeners.\n * @example\n * ```ts\n * // Basic ticker usage with different time units\n * const ticker = new Ticker();\n * ticker.add((ticker) => {\n * // Frame-independent animation using dimensionless deltaTime\n * sprite.rotation += 0.1 * ticker.deltaTime;\n *\n * // Time-based animation using deltaMS (milliseconds)\n * sprite.x += (100 / 1000) * ticker.deltaMS; // 100 pixels per second\n * });\n * ticker.start();\n *\n * // Control update priority\n * ticker.add(\n * (ticker) => {\n * // High priority updates run first\n * physics.update(ticker.deltaTime);\n * },\n * undefined,\n * UPDATE_PRIORITY.HIGH\n * );\n *\n * // One-time updates\n * ticker.addOnce(() => {\n * console.log('Runs on next frame only');\n * });\n * ```\n * @see {@link TickerPlugin} For use with Application\n * @see {@link UPDATE_PRIORITY} For priority constants\n * @see {@link TickerCallback} For listener function type\n * @category ticker\n * @standard\n */\nexport class Ticker\n{\n /**\n * Target frame rate in frames per millisecond.\n * Used for converting deltaTime to a scalar time delta.\n * @example\n * ```ts\n * // Default is 0.06 (60 FPS)\n * console.log(Ticker.targetFPMS); // 0.06\n *\n * // Calculate target frame duration\n * const frameDuration = 1 / Ticker.targetFPMS; // ≈ 16.67ms\n *\n * // Use in custom timing calculations\n * const deltaTime = elapsedMS * Ticker.targetFPMS;\n * ```\n * @remarks\n * - Default is 0.06 (equivalent to 60 FPS)\n * - Used in deltaTime calculations\n * - Affects all ticker instances\n * @default 0.06\n * @see {@link Ticker#deltaTime} For time scaling\n * @see {@link Ticker#FPS} For actual frame rate\n */\n public static targetFPMS = 0.06;\n\n /** The private shared ticker instance */\n private static _shared: Ticker;\n /** The private system ticker instance */\n private static _system: Ticker;\n\n /**\n * Whether or not this ticker should invoke the method {@link Ticker#start|start}\n * automatically when a listener is added.\n * @example\n * ```ts\n * // Default behavior (manual start)\n * const ticker = new Ticker();\n * ticker.autoStart = false;\n * ticker.add(() => {\n * // Won't run until ticker.start() is called\n * });\n *\n * // Auto-start behavior\n * const autoTicker = new Ticker();\n * autoTicker.autoStart = true;\n * autoTicker.add(() => {\n * // Runs immediately when added\n * });\n * ```\n * @default false\n * @see {@link Ticker#start} For manually starting the ticker\n * @see {@link Ticker#stop} For manually stopping the ticker\n */\n public autoStart = false;\n /**\n * Scalar representing the delta time factor.\n * This is a dimensionless value representing the fraction of a frame at the target framerate.\n * At 60 FPS, this value is typically around 1.0.\n *\n * This is NOT in milliseconds - it's a scalar multiplier for frame-independent animations.\n * For actual milliseconds, use {@link Ticker#deltaMS}.\n * @member {number}\n * @example\n * ```ts\n * // Frame-independent animation using deltaTime scalar\n * ticker.add((ticker) => {\n * // Rotate sprite by 0.1 radians per frame, scaled by deltaTime\n * sprite.rotation += 0.1 * ticker.deltaTime;\n * });\n * ```\n */\n public deltaTime: number = 1;\n /**\n * Scalar time elapsed in milliseconds from last frame to this frame.\n * Provides precise timing for animations and updates.\n *\n * This value is capped by setting {@link Ticker#minFPS|minFPS}\n * and is scaled with {@link Ticker#speed|speed}.\n *\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n *\n * Defaults to target frame time\n *\n * > [!NOTE] The cap may be exceeded by scaling.\n * @example\n * ```ts\n * // Animation timing\n * ticker.add((ticker) => {\n * // Use millisecond timing for precise animations\n * const progress = (ticker.deltaMS / animationDuration);\n * sprite.alpha = Math.min(1, progress);\n * });\n * ```\n * @default 16.66\n */\n public deltaMS: number;\n /**\n * Time elapsed in milliseconds from the last frame to this frame.\n * This value is not capped or scaled and provides raw timing information.\n *\n * Unlike {@link Ticker#deltaMS}, this value is unmodified by speed scaling or FPS capping.\n * @member {number}\n * @example\n * ```ts\n * ticker.add((ticker) => {\n * console.log(`Raw frame time: ${ticker.elapsedMS}ms`);\n * });\n * ```\n */\n public elapsedMS: number;\n /**\n * The last time update was invoked, in milliseconds since epoch.\n * Similar to performance.now() timestamp format.\n *\n * Used internally for calculating time deltas between frames.\n * @member {number}\n * @example\n * ```ts\n * ticker.add((ticker) => {\n * const currentTime = performance.now();\n * const timeSinceLastFrame = currentTime - ticker.lastTime;\n * console.log(`Time since last frame: ${timeSinceLastFrame}ms`);\n * });\n * ```\n */\n public lastTime: number = -1;\n /**\n * Factor of current {@link Ticker#deltaTime|deltaTime}.\n * Used to scale time for slow motion or fast-forward effects.\n * @example\n * ```ts\n * // Basic speed adjustment\n * ticker.speed = 0.5; // Half speed (slow motion)\n * ticker.speed = 2.0; // Double speed (fast forward)\n *\n * // Temporary speed changes\n * function slowMotion() {\n * const normalSpeed = ticker.speed;\n * ticker.speed = 0.2;\n * setTimeout(() => {\n * ticker.speed = normalSpeed;\n * }, 1000);\n * }\n * ```\n */\n public speed = 1;\n /**\n * Whether or not this ticker has been started.\n *\n * `true` if {@link Ticker#start|start} has been called.\n * `false` if {@link Ticker#stop|Stop} has been called.\n *\n * While `false`, this value may change to `true` in the\n * event of {@link Ticker#autoStart|autoStart} being `true`\n * and a listener is added.\n * @example\n * ```ts\n * // Check ticker state\n * const ticker = new Ticker();\n * console.log(ticker.started); // false\n *\n * // Start and verify\n * ticker.start();\n * console.log(ticker.started); // true\n * ```\n */\n public started = false;\n\n /** The first listener. All new listeners added are chained on this. */\n private _head: TickerListener;\n /** Internal current frame request ID */\n private _requestId: number = null;\n /**\n * Internal value managed by minFPS property setter and getter.\n * This is the maximum allowed milliseconds between updates.\n */\n private _maxElapsedMS = 100;\n /**\n * Internal value managed by minFPS property setter and getter.\n * This is the minimum allowed milliseconds between updates.\n */\n private _minElapsedMS = 0;\n /** If enabled, deleting is disabled.*/\n private _protected = false;\n /** The last time keyframe was executed. Maintains a relatively fixed interval with the previous value. */\n private _lastFrame = -1;\n /**\n * Internal tick method bound to ticker instance.\n * This is because in early 2015, Function.bind\n * is still 60% slower in high performance scenarios.\n * Also separating frame requests from update method\n * so listeners may be called at any time and with\n * any animation API, just invoke ticker.update(time).\n * @param time - Time since last tick.\n */\n private readonly _tick: (time: number) => any;\n\n constructor()\n {\n this._head = new TickerListener(null, null, Infinity);\n this.deltaMS = 1 / Ticker.targetFPMS;\n this.elapsedMS = 1 / Ticker.targetFPMS;\n\n this._tick = (time: number): void =>\n {\n this._requestId = null;\n\n if (this.started)\n {\n // Invoke listeners now\n this.update(time);\n // Listener side effects may have modified ticker state.\n if (this.started && this._requestId === null && this._head.next)\n {\n this._requestId = requestAnimationFrame(this._tick);\n }\n }\n };\n }\n\n /**\n * Conditionally requests a new animation frame.\n * If a frame has not already been requested, and if the internal\n * emitter has listeners, a new frame is requested.\n */\n private _requestIfNeeded(): void\n {\n if (this._requestId === null && this._head.next)\n {\n // ensure callbacks get correct delta\n this.lastTime = performance.now();\n this._lastFrame = this.lastTime;\n this._requestId = requestAnimationFrame(this._tick);\n }\n }\n\n /** Conditionally cancels a pending animation frame. */\n private _cancelIfNeeded(): void\n {\n if (this._requestId !== null)\n {\n cancelAnimationFrame(this._requestId);\n this._requestId = null;\n }\n }\n\n /**\n * Conditionally requests a new animation frame.\n * If the ticker has been started it checks if a frame has not already\n * been requested, and if the internal emitter has listeners. If these\n * conditions are met, a new frame is requested. If the ticker has not\n * been started, but autoStart is `true`, then the ticker starts now,\n * and continues with the previous conditions to request a new frame.\n */\n private _startIfPossible(): void\n {\n if (this.started)\n {\n this._requestIfNeeded();\n }\n else if (this.autoStart)\n {\n this.start();\n }\n }\n\n /**\n * Register a handler for tick events.\n * @param fn - The listener function to add. Receives the Ticker instance as parameter\n * @param context - The context for the listener\n * @param priority - The priority of the listener\n * @example\n * ```ts\n * // Access time properties through the ticker parameter\n * ticker.add((ticker) => {\n * // Use deltaTime (dimensionless scalar) for frame-independent animations\n * sprite.rotation += 0.1 * ticker.deltaTime;\n *\n * // Use deltaMS (milliseconds) for time-based calculations\n * const progress = ticker.deltaMS / animationDuration;\n *\n * // Use elapsedMS for raw timing measurements\n * console.log(`Raw frame time: ${ticker.elapsedMS}ms`);\n * });\n * ```\n */\n public add<T = any>(fn: TickerCallback<T>, context?: T, priority: number = UPDATE_PRIORITY.NORMAL): this\n {\n return this._addListener(new TickerListener(fn, context, priority));\n }\n\n /**\n * Add a handler for the tick event which is only executed once on the next frame.\n * @example\n * ```ts\n * // Basic one-time update\n * ticker.addOnce(() => {\n * console.log('Runs next frame only');\n * });\n *\n * // With specific context\n * const game = {\n * init(ticker) {\n * this.loadResources();\n * console.log('Game initialized');\n * }\n * };\n * ticker.addOnce(game.init, game);\n *\n * // With priority\n * ticker.addOnce(\n * () => {\n * // High priority one-time setup\n * physics.init();\n * },\n * undefined,\n * UPDATE_PRIORITY.HIGH\n * );\n * ```\n * @param fn - The listener function to be added for one update\n * @param context - The listener context\n * @param priority - The priority for emitting (default: UPDATE_PRIORITY.NORMAL)\n * @returns This instance of a ticker\n * @see {@link Ticker#add} For continuous updates\n * @see {@link Ticker#remove} For removing handlers\n */\n public addOnce<T = any>(fn: TickerCallback<T>, context?: T, priority: number = UPDATE_PRIORITY.NORMAL): this\n {\n return this._addListener(new TickerListener(fn, context, priority, true));\n }\n\n /**\n * Internally adds the event handler so that it can be sorted by priority.\n * Priority allows certain handler (user, AnimatedSprite, Interaction) to be run\n * before the rendering.\n * @private\n * @param listener - Current listener being added.\n * @returns This instance of a ticker\n */\n private _addListener(listener: TickerListener): this\n {\n // For attaching to head\n let current = this._head.next;\n let previous = this._head;\n\n // Add the first item\n if (!current)\n {\n listener.connect(previous);\n }\n else\n {\n // Go from highest to lowest priority\n while (current)\n {\n if (listener.priority > current.priority)\n {\n listener.connect(previous);\n break;\n }\n previous = current;\n current = current.next;\n }\n\n // Not yet connected\n if (!listener.previous)\n {\n listener.connect(previous);\n }\n }\n\n this._startIfPossible();\n\n return this;\n }\n\n /**\n * Removes any handlers matching the function and context parameters.\n * If no handlers are left after removing, then it cancels the animation frame.\n * @example\n * ```ts\n * // Basic removal\n * const onTick = () => {\n * sprite.rotation += 0.1;\n * };\n * ticker.add(onTick);\n * ticker.remove(onTick);\n *\n * // Remove with context\n * const game = {\n * update(ticker) {\n * this.physics.update(ticker.deltaTime);\n * }\n * };\n * ticker.add(game.update, game);\n * ticker.remove(game.update, game);\n *\n * // Remove all matching handlers\n * // (if same function was added multiple times)\n * ticker.add(onTick);\n * ticker.add(onTick);\n * ticker.remove(onTick); // Removes all instances\n * ```\n * @param fn - The listener function to be removed\n * @param context - The listener context to be removed\n * @returns This instance of a ticker\n * @see {@link Ticker#add} For adding handlers\n * @see {@link Ticker#addOnce} For one-time handlers\n */\n public remove<T = any>(fn: TickerCallback<T>, context?: T): this\n {\n let listener = this._head.next;\n\n while (listener)\n {\n // We found a match, lets remove it\n // no break to delete all possible matches\n // incase a listener was added 2+ times\n if (listener.match(fn, context))\n {\n listener = listener.destroy();\n }\n else\n {\n listener = listener.next;\n }\n }\n\n if (!this._head.next)\n {\n this._cancelIfNeeded();\n }\n\n return this;\n }\n\n /**\n * The number of listeners on this ticker, calculated by walking through linked list.\n * @example\n * ```ts\n * // Check number of active listeners\n * const ticker = new Ticker();\n * console.log(ticker.count); // 0\n *\n * // Add some listeners\n * ticker.add(() => {});\n * ticker.add(() => {});\n * console.log(ticker.count); // 2\n *\n * // Check after cleanup\n * ticker.destroy();\n * console.log(ticker.count); // 0\n * ```\n * @readonly\n * @see {@link Ticker#add} For adding listeners\n * @see {@link Ticker#remove} For removing listeners\n */\n get count(): number\n {\n if (!this._head)\n {\n return 0;\n }\n\n let count = 0;\n let current = this._head;\n\n while ((current = current.next))\n {\n count++;\n }\n\n return count;\n }\n\n /**\n * Starts the ticker. If the ticker has listeners a new animation frame is requested at this point.\n * @example\n * ```ts\n * // Basic manual start\n * const ticker = new Ticker();\n * ticker.add(() => {\n * // Animation code here\n * });\n * ticker.start();\n * ```\n * @see {@link Ticker#stop} For stopping the ticker\n * @see {@link Ticker#autoStart} For automatic starting\n * @see {@link Ticker#started} For checking ticker state\n */\n public start(): void\n {\n if (!this.started)\n {\n this.started = true;\n this._requestIfNeeded();\n }\n }\n\n /**\n * Stops the ticker. If the ticker has requested an animation frame it is canceled at this point.\n * @example\n * ```ts\n * // Basic stop\n * const ticker = new Ticker();\n * ticker.stop();\n * ```\n * @see {@link Ticker#start} For starting the ticker\n * @see {@link Ticker#started} For checking ticker state\n * @see {@link Ticker#destroy} For cleaning up the ticker\n */\n public stop(): void\n {\n if (this.started)\n {\n this.started = false;\n this._cancelIfNeeded();\n }\n }\n\n /**\n * Destroy the ticker and don't use after this. Calling this method removes all references to internal events.\n * @example\n * ```ts\n * // Clean up with active listeners\n * const ticker = new Ticker();\n * ticker.add(() => {});\n * ticker.destroy(); // Removes all listeners\n * ```\n * @see {@link Ticker#stop} For stopping without destroying\n * @see {@link Ticker#remove} For removing specific listeners\n */\n public destroy(): void\n {\n if (!this._protected)\n {\n this.stop();\n\n let listener = this._head.next;\n\n while (listener)\n {\n listener = listener.destroy(true);\n }\n\n this._head.destroy();\n this._head = null;\n }\n }\n\n /**\n * Triggers an update.\n *\n * An update entails setting the\n * current {@link Ticker#elapsedMS|elapsedMS},\n * the current {@link Ticker#deltaTime|deltaTime},\n * invoking all listeners with current deltaTime,\n * and then finally setting {@link Ticker#lastTime|lastTime}\n * with the value of currentTime that was provided.\n *\n * This method will be called automatically by animation\n * frame callbacks if the ticker instance has been started\n * and listeners are added.\n * @example\n * ```ts\n * // Basic manual update\n * const ticker = new Ticker();\n * ticker.update(performance.now());\n * ```\n * @param currentTime - The current time of execution (defaults to performance.now())\n * @see {@link Ticker#deltaTime} For frame delta value\n * @see {@link Ticker#elapsedMS} For raw elapsed time\n */\n public update(currentTime: number = performance.now()): void\n {\n let elapsedMS;\n\n // If the difference in time is zero or negative, we ignore most of the work done here.\n // If there is no valid difference, then should be no reason to let anyone know about it.\n // A zero delta, is exactly that, nothing should update.\n //\n // The difference in time can be negative, and no this does not mean time traveling.\n // This can be the result of a race condition between when an animation frame is requested\n // on the current JavaScript engine event loop, and when the ticker's start method is invoked\n // (which invokes the internal _requestIfNeeded method). If a frame is requested before\n // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests,\n // can receive a time argument that can be less than the lastTime value that was set within\n // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems.\n //\n // This check covers this browser engine timing issue, as well as if consumers pass an invalid\n // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves.\n\n if (currentTime > this.lastTime)\n {\n // Save uncapped elapsedMS for measurement\n elapsedMS = this.elapsedMS = currentTime - this.lastTime;\n\n // cap the milliseconds elapsed used for deltaTime\n if (elapsedMS > this._maxElapsedMS)\n {\n elapsedMS = this._maxElapsedMS;\n }\n\n elapsedMS *= this.speed;\n\n // If not enough time has passed, exit the function.\n // Get ready for next frame by setting _lastFrame, but based on _minElapsedMS\n // adjustment to ensure a relatively stable interval.\n if (this._minElapsedMS)\n {\n const delta = currentTime - this._lastFrame | 0;\n\n if (delta < this._minElapsedMS)\n {\n return;\n }\n\n this._lastFrame = currentTime - (delta % this._minElapsedMS);\n }\n\n this.deltaMS = elapsedMS;\n this.deltaTime = this.deltaMS * Ticker.targetFPMS;\n\n // Cache a local reference, in-case ticker is destroyed\n // during the emit, we can still check for head.next\n const head = this._head;\n\n // Invoke listeners added to internal emitter\n let listener = head.next;\n\n while (listener)\n {\n listener = listener.emit(this);\n }\n\n if (!head.next)\n {\n this._cancelIfNeeded();\n }\n }\n else\n {\n this.deltaTime = this.deltaMS = this.elapsedMS = 0;\n }\n\n this.lastTime = currentTime;\n }\n\n /**\n * The frames per second at which this ticker is running.\n * The default is approximately 60 in most modern browsers.\n * > [!NOTE] This does not factor in the value of\n * > {@link Ticker#speed|speed}, which is specific\n * > to scaling {@link Ticker#deltaTime|deltaTime}.\n * @example\n * ```ts\n * // Basic FPS monitoring\n * ticker.add(() => {\n * console.log(`Current FPS: ${Math.round(ticker.FPS)}`);\n * });\n * ```\n * @readonly\n */\n get FPS(): number\n {\n return 1000 / this.elapsedMS;\n }\n\n /**\n * Manages the maximum amount of milliseconds allowed to\n * elapse between invoking {@link Ticker#update|update}.\n *\n * This value is used to cap {@link Ticker#deltaTime|deltaTime},\n * but does not effect the measured value of {@link Ticker#FPS|FPS}.\n *\n * When setting this property it is clamped to a value between\n * `0` and `Ticker.targetFPMS * 1000`.\n * @example\n * ```ts\n * // Set minimum acceptable frame rate\n * const ticker = new Ticker();\n * ticker.minFPS = 30; // Never go below 30 FPS\n *\n * // Use with maxFPS for frame rate clamping\n * ticker.minFPS = 30;\n * ticker.maxFPS = 60;\n *\n * // Monitor delta capping\n * ticker.add(() => {\n * // Delta time will be capped based on minFPS\n * console.log(`Delta time: ${ticker.deltaTime}`);\n * });\n * ```\n * @default 10\n */\n get minFPS(): number\n {\n return 1000 / this._maxElapsedMS;\n }\n\n set minFPS(fps: number)\n {\n // Minimum must be below the maxFPS\n const minFPS = Math.min(this.maxFPS, fps);\n\n // Must be at least 0, but below 1 / Ticker.targetFPMS\n const minFPMS = Math.min(Math.max(0, minFPS) / 1000, Ticker.targetFPMS);\n\n this._maxElapsedMS = 1 / minFPMS;\n }\n\n /**\n * Manages the minimum amount of milliseconds required to\n * elapse between invoking {@link Ticker#update|update}.\n *\n * This will effect the measured value of {@link Ticker#FPS|FPS}.\n *\n * If it is set to `0`, then there is no limit; PixiJS will render as many frames as it can.\n * Otherwise it will be at least `minFPS`\n * @example\n * ```ts\n * // Set minimum acceptable frame rate\n * const ticker = new Ticker();\n * ticker.maxFPS = 60; // Never go above 60 FPS\n *\n * // Use with maxFPS for frame rate clamping\n * ticker.minFPS = 30;\n * ticker.maxFPS = 60;\n *\n * // Monitor delta capping\n * ticker.add(() => {\n * // Delta time will be capped based on maxFPS\n * console.log(`Delta time: ${ticker.deltaTime}`);\n * });\n * ```\n * @default 0\n */\n get maxFPS(): number\n {\n if (this._minElapsedMS)\n {\n return Math.round(1000 / this._minElapsedMS);\n }\n\n return 0;\n }\n\n set maxFPS(fps: number)\n {\n if (fps === 0)\n {\n this._minElapsedMS = 0;\n }\n else\n {\n // Max must be at least the minFPS\n const maxFPS = Math.max(this.minFPS, fps);\n\n this._minElapsedMS = 1 / (maxFPS / 1000);\n }\n }\n\n /**\n * The shared ticker instance used by {@link AnimatedSprite} and by\n * {@link VideoSource} to update animation frames / video textures.\n *\n * It may also be used by {@link Application} if created with the `sharedTicker` option property set to true.\n *\n * The property {@link Ticker#autoStart|autoStart} is set to `true` for this instance.\n * Please follow the examples for usage, including how to opt-out of auto-starting the shared ticker.\n * @example\n * import { Ticker } from 'pixi.js';\n *\n * const ticker = Ticker.shared;\n * // Set this to prevent starting this ticker when listeners are added.\n * // By default this is true only for the Ticker.shared instance.\n * ticker.autoStart = false;\n *\n * // FYI, call this to ensure the ticker is stopped. It should be stopped\n * // if you have not attempted to render anything yet.\n * ticker.stop();\n *\n * // Call this when you are ready for a running shared ticker.\n * ticker.start();\n * @example\n * import { autoDetectRenderer, Container } from 'pixi.js';\n *\n * // You may use the shared ticker to render...\n * const renderer = autoDetectRenderer();\n * const stage = new Container();\n * document.body.appendChild(renderer.view);\n * ticker.add((time) => renderer.render(stage));\n *\n * // Or you can just update it manually.\n * ticker.autoStart = false;\n * ticker.stop();\n * const animate = (time) => {\n * ticker.update(time);\n * renderer.render(stage);\n * requestAnimationFrame(animate);\n * };\n * animate(performance.now());\n * @type {Ticker}\n * @readonly\n */\n static get shared(): Ticker\n {\n if (!Ticker._shared)\n {\n const shared = Ticker._shared = new Ticker();\n\n shared.autoStart = true;\n shared._protected = true;\n }\n\n return Ticker._shared;\n }\n\n /**\n * The system ticker instance used by {@link PrepareBase} for core timing\n * functionality that shouldn't usually need to be paused, unlike the `shared`\n * ticker which drives visual animations and rendering which may want to be paused.\n *\n * The property {@link Ticker#autoStart|autoStart} is set to `true` for this instance.\n * @type {Ticker}\n * @readonly\n * @advanced\n */\n static get system(): Ticker\n {\n if (!Ticker._system)\n {\n const system = Ticker._system = new Ticker();\n\n system.autoStart = true;\n system._protected = true;\n }\n\n return Ticker._system;\n }\n}\n", "import { type InstructionSet } from '../../rendering/renderers/shared/instructions/InstructionSet';\nimport { type RenderPipe } from '../../rendering/renderers/shared/instructions/RenderPipe';\nimport { type Renderer } from '../../rendering/renderers/types';\nimport { Bounds } from '../container/bounds/Bounds';\nimport { Container, type ContainerOptions } from '../container/Container';\nimport { type RenderLayer } from '../layers/RenderLayer';\n\nimport type { PointData } from '../../maths/point/PointData';\nimport type { View } from '../../rendering/renderers/shared/view/View';\nimport type { DestroyOptions } from '../container/destroyTypes';\n\n/** @internal */\nexport interface GPUData\n{\n destroy: () => void;\n}\n\n/**\n * Options for the construction of a ViewContainer.\n * @category scene\n * @advanced\n */\nexport interface ViewContainerOptions extends ContainerOptions, PixiMixins.ViewContainerOptions {}\n// eslint-disable-next-line requireExport/require-export-jsdoc, requireMemberAPI/require-member-api-doc\nexport interface ViewContainer<GPU_DATA extends GPUData = any> extends PixiMixins.ViewContainer, Container\n{\n // eslint-disable-next-line requireMemberAPI/require-member-api-doc\n _gpuData: Record<number, GPU_DATA>;\n}\n\n/**\n * A ViewContainer is a type of container that represents a view.\n * This view can be a Sprite, a Graphics object, or any other object that can be rendered.\n * This class is abstract and should not be used directly.\n * @category scene\n * @advanced\n */\nexport abstract class ViewContainer<GPU_DATA extends GPUData = any> extends Container implements View\n{\n /** @internal */\n public override readonly renderPipeId: string;\n /** @internal */\n public readonly canBundle = true;\n /** @internal */\n public override allowChildren = false;\n\n /** @internal */\n public _roundPixels: 0 | 1 = 0;\n /** @internal */\n public _lastUsed = -1;\n\n /** @internal */\n public _gpuData: Record<number, GPU_DATA> = Object.create(null);\n\n protected _bounds: Bounds = new Bounds(0, 1, 0, 0);\n protected _boundsDirty = true;\n\n /**\n * The local bounds of the view in its own coordinate space.\n * Bounds are automatically updated when the view's content changes.\n * @example\n * ```ts\n * // Get bounds dimensions\n * const bounds = view.bounds;\n * console.log(`Width: ${bounds.maxX - bounds.minX}`);\n * console.log(`Height: ${bounds.maxY - bounds.minY}`);\n * ```\n * @returns The rectangular bounds of the view\n * @see {@link Bounds} For bounds operations\n */\n public get bounds()\n {\n if (!this._boundsDirty) return this._bounds;\n\n this.updateBounds();\n\n this._boundsDirty = false;\n\n return this._bounds;\n }\n\n /** @private */\n protected abstract updateBounds(): void;\n\n /**\n * Whether or not to round the x/y position of the sprite.\n * @example\n * ```ts\n * // Enable pixel rounding for crisp rendering\n * view.roundPixels = true;\n * ```\n * @default false\n */\n get roundPixels()\n {\n return !!this._roundPixels;\n }\n\n set roundPixels(value: boolean)\n {\n this._roundPixels = value ? 1 : 0;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor(options: ViewContainerOptions)\n {\n super(options);\n }\n\n /**\n * Checks if the object contains the given point in local coordinates.\n * Uses the view's bounds for hit testing.\n * @example\n * ```ts\n * // Basic point check\n * const localPoint = { x: 50, y: 25 };\n * const contains = view.containsPoint(localPoint);\n * console.log('Point is inside:', contains);\n * ```\n * @param point - The point to check in local coordinates\n * @returns True if the point is within the view's bounds\n * @see {@link ViewContainer#bounds} For the bounds used in hit testing\n * @see {@link Container#toLocal} For converting global coordinates to local\n */\n public containsPoint(point: PointData)\n {\n const bounds = this.bounds;\n const { x, y } = point;\n\n return (x >= bounds.minX\n && x <= bounds.maxX\n && y >= bounds.minY\n && y <= bounds.maxY);\n }\n\n /** @private */\n public abstract batched: boolean;\n\n /** @private */\n protected onViewUpdate()\n {\n this._didViewChangeTick++;\n\n this._boundsDirty = true;\n\n if (this.didViewUpdate) return;\n this.didViewUpdate = true;\n\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n if (renderGroup)\n {\n renderGroup.onChildViewUpdate(this);\n }\n }\n\n public override destroy(options?: DestroyOptions): void\n {\n super.destroy(options);\n\n this._bounds = null;\n\n for (const key in this._gpuData)\n {\n (this._gpuData[key] as GPU_DATA).destroy?.();\n }\n\n this._gpuData = null;\n }\n\n /**\n * Collects renderables for the view container.\n * @param instructionSet - The instruction set to collect renderables for.\n * @param renderer - The renderer to collect renderables for.\n * @param currentLayer - The current render layer.\n * @internal\n */\n public override collectRenderablesSimple(\n instructionSet: InstructionSet,\n renderer: Renderer,\n currentLayer: RenderLayer,\n ): void\n {\n const { renderPipes } = renderer;\n\n renderPipes.blendMode.pushBlendMode(this, this.groupBlendMode, instructionSet);\n\n const rp = renderPipes as unknown as Record<string, RenderPipe>;\n\n rp[this.renderPipeId].addRenderable(this, instructionSet);\n\n this.didViewUpdate = false;\n\n const children = this.children;\n const length = children.length;\n\n for (let i = 0; i < length; i++)\n {\n children[i].collectRenderables(instructionSet, renderer, currentLayer);\n }\n renderPipes.blendMode.popBlendMode(instructionSet);\n }\n}\n", "import type { ObservablePoint } from '../../maths/point/ObservablePoint';\nimport type { Texture } from '../../rendering/renderers/shared/texture/Texture';\nimport type { BoundsData } from '../../scene/container/bounds/Bounds';\n\n/**\n * Updates the bounds of a quad (a rectangular area) based on the provided texture and anchor point.\n *\n * This function calculates the minimum and maximum x and y coordinates of the bounds, taking into\n * account the texture's original dimensions and any trimming that may have been applied to it.\n * @param {BoundsData} bounds - The bounds object to be updated. It contains minX, maxX, minY, and maxY properties.\n * @param {ObservablePoint} anchor - The anchor point of the texture, which affects the positioning of the bounds.\n * @param {Texture} texture - The texture whose dimensions and trimming information are used to update the bounds.\n * @internal\n */\nexport function updateQuadBounds(\n bounds: BoundsData,\n anchor: ObservablePoint,\n texture: Texture\n): void\n{\n const { width, height } = texture.orig;\n const trim = texture.trim;\n\n // If the texture has trimming information, adjust the bounds accordingly\n if (trim)\n {\n // Calculate the source width and height from the trim\n const sourceWidth = trim.width;\n const sourceHeight = trim.height;\n\n // Update the bounds using the trim's x and y offsets and the anchor point\n bounds.minX = trim.x - (anchor._x * width);\n bounds.maxX = bounds.minX + sourceWidth;\n\n bounds.minY = trim.y - (anchor._y * height);\n bounds.maxY = bounds.minY + sourceHeight;\n }\n // If there is no trimming, calculate the bounds based solely on the texture's original dimensions\n else\n {\n bounds.minX = -anchor._x * width;\n bounds.maxX = bounds.minX + width;\n\n bounds.minY = -anchor._y * height;\n bounds.maxY = bounds.minY + height;\n }\n}\n", "import { ObservablePoint } from '../../maths/point/ObservablePoint';\nimport { Texture } from '../../rendering/renderers/shared/texture/Texture';\nimport { updateQuadBounds } from '../../utils/data/updateQuadBounds';\nimport { deprecation } from '../../utils/logging/deprecation';\nimport { ViewContainer, type ViewContainerOptions } from '../view/ViewContainer';\nimport { type BatchableSprite } from './BatchableSprite';\n\nimport type { Size } from '../../maths/misc/Size';\nimport type { PointData } from '../../maths/point/PointData';\nimport type { TextureSourceLike } from '../../rendering/renderers/shared/texture/Texture';\nimport type { BoundsData } from '../container/bounds/Bounds';\nimport type { Optional } from '../container/container-mixins/measureMixin';\nimport type { DestroyOptions } from '../container/destroyTypes';\n\n/**\n * Options for configuring a Sprite instance. Defines the texture, anchor point, and rendering behavior.\n * @example\n * ```ts\n * // Create a basic sprite with texture\n * const sprite = new Sprite({\n * texture: Texture.from('sprite.png')\n * });\n *\n * // Create a centered sprite with rounded position\n * const centeredSprite = new Sprite({\n * texture: Texture.from('centered.png'),\n * anchor: 0.5, // Center point\n * roundPixels: true, // Crisp rendering\n * x: 100, // Position from ViewContainerOptions\n * y: 100\n * });\n *\n * // Create a sprite with specific anchor points\n * const anchoredSprite = new Sprite({\n * texture: Texture.from('corner.png'),\n * anchor: {\n * x: 1, // Right-aligned\n * y: 0 // Top-aligned\n * }\n * });\n * ```\n * @extends ViewContainerOptions\n * @category scene\n * @standard\n * @noInheritDoc\n */\nexport interface SpriteOptions extends PixiMixins.SpriteOptions, ViewContainerOptions\n{\n /**\n * The texture to use for the sprite. If not provided, uses Texture.EMPTY\n * @default Texture.EMPTY\n * @example\n * ```ts\n * // Create a sprite with a texture\n * const sprite = new Sprite({\n * texture: Texture.from('path/to/image.png')\n * });\n * // Update the texture later\n * sprite.texture = Texture.from('path/to/another-image.png');\n * ```\n */\n texture?: Texture;\n\n /**\n * The anchor point of the sprite (0-1 range).\n * Controls the origin point for rotation, scaling, and positioning.\n * Can be a number for uniform anchor or a PointData for separate x/y values.\n * @default 0\n * @example\n * ```ts\n * // Centered anchor\n * anchor: 0.5\n * // Separate x/y anchor\n * anchor: { x: 0.5, y: 0.5 }\n * // Right-aligned anchor\n * anchor: { x: 1, y: 0 }\n * ```\n */\n anchor?: PointData | number;\n\n /**\n * Whether or not to round the x/y position to whole pixels.\n * Useful for crisp pixel art style rendering.\n * @default false\n * @example\n * ```ts\n * const sprite = new Sprite({\n * texture: Texture.from('sprite.png'),\n * roundPixels: true // Ensures crisp rendering\n * });\n * ```\n */\n roundPixels?: boolean;\n}\n// eslint-disable-next-line requireExport/require-export-jsdoc, requireMemberAPI/require-member-api-doc\nexport interface Sprite extends PixiMixins.Sprite, ViewContainer<BatchableSprite> {}\n\n/**\n * The Sprite object is one of the most important objects in PixiJS. It is a\n * drawing item that can be added to a scene and rendered to the screen.\n * Sprites can display images, handle input events, and be transformed in various ways.\n * @example\n * ```ts\n * // Create a sprite directly from an image path\n * const sprite = Sprite.from('assets/image.png');\n * sprite.position.set(100, 100);\n * app.stage.addChild(sprite);\n *\n * // Create from a spritesheet (more efficient)\n * const sheet = await Assets.load('assets/spritesheet.json');\n * const sprite = new Sprite(sheet.textures['image.png']);\n *\n * // Create with specific options\n * const configuredSprite = new Sprite({\n * texture: Texture.from('sprite.png'),\n * anchor: 0.5, // Center anchor point\n * position: { x: 100, y: 100 },\n * scale: { x: 2, y: 2 }, // Double size\n * rotation: Math.PI / 4 // 45 degrees\n * });\n *\n * // Animate sprite properties\n * app.ticker.add(() => {\n * sprite.rotation += 0.1; // Rotate\n * sprite.scale.x = Math.sin(performance.now() / 1000) + 1; // Pulse scale\n * });\n * ```\n * @category scene\n * @standard\n * @see {@link SpriteOptions} For configuration options\n * @see {@link Texture} For texture management\n * @see {@link Assets} For asset loading\n */\nexport class Sprite extends ViewContainer<BatchableSprite>\n{\n /**\n * Creates a new sprite based on a source texture, image, video, or canvas element.\n * This is a convenience method that automatically creates and manages textures.\n * @example\n * ```ts\n * // Create from path or URL\n * const sprite = Sprite.from('assets/image.png');\n *\n * // Create from existing texture\n * const sprite = Sprite.from(texture);\n *\n * // Create from canvas\n * const canvas = document.createElement('canvas');\n * const sprite = Sprite.from(canvas, true); // Skip caching new texture\n * ```\n * @param source - The source to create the sprite from. Can be a path to an image, a texture,\n * or any valid texture source (canvas, video, etc.)\n * @param skipCache - Whether to skip adding to the texture cache when creating a new texture\n * @returns A new sprite based on the source\n * @see {@link Texture.from} For texture creation details\n * @see {@link Assets} For asset loading and management\n */\n public static from(source: Texture | TextureSourceLike, skipCache = false): Sprite\n {\n if (source instanceof Texture)\n {\n return new Sprite(source);\n }\n\n return new Sprite(Texture.from(source, skipCache));\n }\n\n /** @internal */\n public override readonly renderPipeId: string = 'sprite';\n\n /** @internal */\n public batched = true;\n /** @internal */\n public readonly _anchor: ObservablePoint;\n\n /** @internal */\n public _texture: Texture;\n\n private readonly _visualBounds: BoundsData = { minX: 0, maxX: 1, minY: 0, maxY: 0 };\n\n private _width: number;\n private _height: number;\n\n /**\n * @param options - The options for creating the sprite.\n */\n constructor(options: SpriteOptions | Texture = Texture.EMPTY)\n {\n if (options instanceof Texture)\n {\n options = { texture: options };\n }\n\n // split out\n const { texture = Texture.EMPTY, anchor, roundPixels, width, height, ...rest } = options;\n\n super({\n label: 'Sprite',\n ...rest\n });\n\n this._anchor = new ObservablePoint(\n {\n _onUpdate: () =>\n {\n this.onViewUpdate();\n }\n },\n );\n\n if (anchor)\n {\n this.anchor = anchor;\n }\n else if (texture.defaultAnchor)\n {\n this.anchor = texture.defaultAnchor;\n }\n\n this.texture = texture;\n\n this.allowChildren = false;\n this.roundPixels = roundPixels ?? false;\n\n // needs to be set after the container has initiated\n if (width !== undefined) this.width = width;\n if (height !== undefined) this.height = height;\n }\n\n set texture(value: Texture)\n {\n value ||= Texture.EMPTY;\n\n const currentTexture = this._texture;\n\n if (currentTexture === value) return;\n\n if (currentTexture && currentTexture.dynamic) currentTexture.off('update', this.onViewUpdate, this);\n if (value.dynamic) value.on('update', this.onViewUpdate, this);\n\n this._texture = value;\n\n if (this._width)\n {\n this._setWidth(this._width, this._texture.orig.width);\n }\n\n if (this._height)\n {\n this._setHeight(this._height, this._texture.orig.height);\n }\n\n this.onViewUpdate();\n }\n\n /**\n * The texture that is displayed by the sprite. When changed, automatically updates\n * the sprite dimensions and manages texture event listeners.\n * @example\n * ```ts\n * // Create sprite with texture\n * const sprite = new Sprite({\n * texture: Texture.from('sprite.png')\n * });\n *\n * // Update texture\n * sprite.texture = Texture.from('newSprite.png');\n *\n * // Use texture from spritesheet\n * const sheet = await Assets.load('spritesheet.json');\n * sprite.texture = sheet.textures['frame1.png'];\n *\n * // Reset to empty texture\n * sprite.texture = Texture.EMPTY;\n * ```\n * @see {@link Texture} For texture creation and management\n * @see {@link Assets} For asset loading\n */\n get texture()\n {\n return this._texture;\n }\n\n /**\n * The bounds of the sprite, taking into account the texture's trim area.\n * @example\n * ```ts\n * const texture = new Texture({\n * source: new TextureSource({ width: 300, height: 300 }),\n * frame: new Rectangle(196, 66, 58, 56),\n * trim: new Rectangle(4, 4, 58, 56),\n * orig: new Rectangle(0, 0, 64, 64),\n * rotate: 2,\n * });\n * const sprite = new Sprite(texture);\n * const visualBounds = sprite.visualBounds;\n * // console.log(visualBounds); // { minX: -4, maxX: 62, minY: -4, maxY: 60 }\n */\n get visualBounds()\n {\n updateQuadBounds(this._visualBounds, this._anchor, this._texture);\n\n return this._visualBounds;\n }\n\n /**\n * @deprecated\n * @ignore\n */\n get sourceBounds()\n {\n // #if _DEBUG\n deprecation('8.6.1', 'Sprite.sourceBounds is deprecated, use visualBounds instead.');\n // #endif\n\n return this.visualBounds;\n }\n\n /** @private */\n protected updateBounds()\n {\n const anchor = this._anchor;\n const texture = this._texture;\n\n const bounds = this._bounds;\n\n const { width, height } = texture.orig;\n\n bounds.minX = -anchor._x * width;\n bounds.maxX = bounds.minX + width;\n\n bounds.minY = -anchor._y * height;\n bounds.maxY = bounds.minY + height;\n }\n\n /**\n * Destroys this sprite renderable and optionally its texture.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @example\n * sprite.destroy();\n * sprite.destroy(true);\n * sprite.destroy({ texture: true, textureSource: true });\n */\n public override destroy(options: DestroyOptions = false)\n {\n super.destroy(options);\n\n const destroyTexture = typeof options === 'boolean' ? options : options?.texture;\n\n if (destroyTexture)\n {\n const destroyTextureSource = typeof options === 'boolean' ? options : options?.textureSource;\n\n this._texture.destroy(destroyTextureSource);\n }\n\n this._texture = null;\n (this._visualBounds as null) = null;\n (this._bounds as null) = null;\n (this._anchor as null) = null;\n this._gpuData = null;\n }\n\n /**\n * The anchor sets the origin point of the sprite. The default value is taken from the {@link Texture}\n * and passed to the constructor.\n *\n * - The default is `(0,0)`, this means the sprite's origin is the top left.\n * - Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.\n * - Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner.\n *\n * If you pass only single parameter, it will set both x and y to the same value as shown in the example below.\n * @example\n * ```ts\n * // Center the anchor point\n * sprite.anchor = 0.5; // Sets both x and y to 0.5\n * sprite.position.set(400, 300); // Sprite will be centered at this position\n *\n * // Set specific x/y anchor points\n * sprite.anchor = {\n * x: 1, // Right edge\n * y: 0 // Top edge\n * };\n *\n * // Using individual coordinates\n * sprite.anchor.set(0.5, 1); // Center-bottom\n *\n * // For rotation around center\n * sprite.anchor.set(0.5);\n * sprite.rotation = Math.PI / 4; // 45 degrees around center\n *\n * // For scaling from center\n * sprite.anchor.set(0.5);\n * sprite.scale.set(2); // Scales from center point\n * ```\n */\n get anchor(): ObservablePoint\n {\n return this._anchor;\n }\n\n set anchor(value: PointData | number)\n {\n typeof value === 'number' ? this._anchor.set(value) : this._anchor.copyFrom(value);\n }\n\n /**\n * The width of the sprite, setting this will actually modify the scale to achieve the value set.\n * @example\n * ```ts\n * // Set width directly\n * sprite.width = 200;\n * console.log(sprite.scale.x); // Scale adjusted to match width\n *\n * // Set width while preserving aspect ratio\n * const ratio = sprite.height / sprite.width;\n * sprite.width = 300;\n * sprite.height = 300 * ratio;\n *\n * // For better performance when setting both width and height\n * sprite.setSize(300, 400); // Avoids recalculating bounds twice\n *\n * // Reset to original texture size\n * sprite.width = sprite.texture.orig.width;\n * ```\n */\n override get width(): number\n {\n return Math.abs(this.scale.x) * this._texture.orig.width;\n }\n\n override set width(value: number)\n {\n this._setWidth(value, this._texture.orig.width);\n this._width = value;\n }\n\n /**\n * The height of the sprite, setting this will actually modify the scale to achieve the value set.\n * @example\n * ```ts\n * // Set height directly\n * sprite.height = 150;\n * console.log(sprite.scale.y); // Scale adjusted to match height\n *\n * // Set height while preserving aspect ratio\n * const ratio = sprite.width / sprite.height;\n * sprite.height = 200;\n * sprite.width = 200 * ratio;\n *\n * // For better performance when setting both width and height\n * sprite.setSize(300, 400); // Avoids recalculating bounds twice\n *\n * // Reset to original texture size\n * sprite.height = sprite.texture.orig.height;\n * ```\n */\n override get height(): number\n {\n return Math.abs(this.scale.y) * this._texture.orig.height;\n }\n\n override set height(value: number)\n {\n this._setHeight(value, this._texture.orig.height);\n this._height = value;\n }\n\n /**\n * Retrieves the size of the Sprite as a [Size]{@link Size} object based on the texture dimensions and scale.\n * This is faster than getting width and height separately as it only calculates the bounds once.\n * @example\n * ```ts\n * // Basic size retrieval\n * const sprite = new Sprite(Texture.from('sprite.png'));\n * const size = sprite.getSize();\n * console.log(`Size: ${size.width}x${size.height}`);\n *\n * // Reuse existing size object\n * const reuseSize = { width: 0, height: 0 };\n * sprite.getSize(reuseSize);\n * ```\n * @param out - Optional object to store the size in, to avoid allocating a new object\n * @returns The size of the Sprite\n * @see {@link Sprite#width} For getting just the width\n * @see {@link Sprite#height} For getting just the height\n * @see {@link Sprite#setSize} For setting both width and height\n */\n public override getSize(out?: Size): Size\n {\n out ||= {} as Size;\n out.width = Math.abs(this.scale.x) * this._texture.orig.width;\n out.height = Math.abs(this.scale.y) * this._texture.orig.height;\n\n return out;\n }\n\n /**\n * Sets the size of the Sprite to the specified width and height.\n * This is faster than setting width and height separately as it only recalculates bounds once.\n * @example\n * ```ts\n * // Basic size setting\n * const sprite = new Sprite(Texture.from('sprite.png'));\n * sprite.setSize(100, 200); // Width: 100, Height: 200\n *\n * // Set uniform size\n * sprite.setSize(100); // Sets both width and height to 100\n *\n * // Set size with object\n * sprite.setSize({\n * width: 200,\n * height: 300\n * });\n *\n * // Reset to texture size\n * sprite.setSize(\n * sprite.texture.orig.width,\n * sprite.texture.orig.height\n * );\n * ```\n * @param value - This can be either a number or a {@link Size} object\n * @param height - The height to set. Defaults to the value of `width` if not provided\n * @see {@link Sprite#width} For setting width only\n * @see {@link Sprite#height} For setting height only\n * @see {@link Sprite#texture} For the source dimensions\n */\n public override setSize(value: number | Optional<Size, 'height'>, height?: number)\n {\n if (typeof value === 'object')\n {\n height = value.height ?? value.width;\n value = value.width;\n }\n else\n {\n height ??= value;\n }\n\n value !== undefined && this._setWidth(value, this._texture.orig.width);\n height !== undefined && this._setHeight(height, this._texture.orig.height);\n }\n}\n", "import { type TypedArray } from '../../rendering/renderers/shared/buffer/Buffer';\n\n/**\n * Flexible wrapper around `ArrayBuffer` that also provides typed array views on demand.\n * @category utils\n * @advanced\n */\nexport class ViewableBuffer\n{\n /** The size of the buffer in bytes. */\n public size: number;\n\n /** Underlying `ArrayBuffer` that holds all the data and is of capacity `this.size`. */\n public rawBinaryData: ArrayBuffer;\n\n /** View on the raw binary data as a `Uint32Array`. */\n public uint32View: Uint32Array;\n\n /** View on the raw binary data as a `Float32Array`. */\n public float32View: Float32Array;\n /** View on the raw binary data as a `Uint16Array`. */\n public uint16View: Uint16Array;\n\n private _int8View: Int8Array;\n private _uint8View: Uint8Array;\n private _int16View: Int16Array;\n private _int32View: Int32Array;\n private _float64Array: Float64Array;\n private _bigUint64Array: BigUint64Array;\n\n /**\n * @param length - The size of the buffer in bytes.\n */\n constructor(length: number);\n\n /**\n * @param arrayBuffer - The source array buffer.\n */\n constructor(arrayBuffer: ArrayBuffer);\n\n constructor(sizeOrBuffer: number | ArrayBuffer | Uint8Array)\n {\n if (typeof sizeOrBuffer === 'number')\n {\n this.rawBinaryData = new ArrayBuffer(sizeOrBuffer);\n }\n else if (sizeOrBuffer instanceof Uint8Array)\n {\n this.rawBinaryData = sizeOrBuffer.buffer;\n }\n else\n {\n this.rawBinaryData = sizeOrBuffer;\n }\n\n this.uint32View = new Uint32Array(this.rawBinaryData);\n this.float32View = new Float32Array(this.rawBinaryData);\n\n this.size = this.rawBinaryData.byteLength;\n }\n\n /** View on the raw binary data as a `Int8Array`. */\n get int8View(): Int8Array\n {\n if (!this._int8View)\n {\n this._int8View = new Int8Array(this.rawBinaryData);\n }\n\n return this._int8View;\n }\n\n /** View on the raw binary data as a `Uint8Array`. */\n get uint8View(): Uint8Array\n {\n if (!this._uint8View)\n {\n this._uint8View = new Uint8Array(this.rawBinaryData);\n }\n\n return this._uint8View;\n }\n\n /** View on the raw binary data as a `Int16Array`. */\n get int16View(): Int16Array\n {\n if (!this._int16View)\n {\n this._int16View = new Int16Array(this.rawBinaryData);\n }\n\n return this._int16View;\n }\n\n /** View on the raw binary data as a `Int32Array`. */\n get int32View(): Int32Array\n {\n if (!this._int32View)\n {\n this._int32View = new Int32Array(this.rawBinaryData);\n }\n\n return this._int32View;\n }\n\n /** View on the raw binary data as a `Float64Array`. */\n get float64View(): Float64Array\n {\n if (!this._float64Array)\n {\n this._float64Array = new Float64Array(this.rawBinaryData);\n }\n\n return this._float64Array;\n }\n\n /** View on the raw binary data as a `BigUint64Array`. */\n get bigUint64View(): BigUint64Array\n {\n if (!this._bigUint64Array)\n {\n this._bigUint64Array = new BigUint64Array(this.rawBinaryData);\n }\n\n return this._bigUint64Array;\n }\n\n /**\n * Returns the view of the given type.\n * @param type - One of `int8`, `uint8`, `int16`,\n * `uint16`, `int32`, `uint32`, and `float32`.\n * @returns - typed array of given type\n */\n public view(type: string): TypedArray\n {\n return (this as any)[`${type}View`];\n }\n\n /** Destroys all buffer references. Do not use after calling this. */\n public destroy(): void\n {\n this.rawBinaryData = null;\n this.uint32View = null;\n this.float32View = null;\n this.uint16View = null;\n this._int8View = null;\n this._uint8View = null;\n this._int16View = null;\n this._int32View = null;\n this._float64Array = null;\n this._bigUint64Array = null;\n }\n\n /**\n * Returns the size of the given type in bytes.\n * @param type - One of `int8`, `uint8`, `int16`,\n * `uint16`, `int32`, `uint32`, and `float32`.\n * @returns - size of the type in bytes\n */\n public static sizeOf(type: string): number\n {\n switch (type)\n {\n case 'int8':\n case 'uint8':\n return 1;\n case 'int16':\n case 'uint16':\n return 2;\n case 'int32':\n case 'uint32':\n case 'float32':\n return 4;\n default:\n throw new Error(`${type} isn't a valid view type`);\n }\n }\n}\n", "import { type BLEND_MODES, BLEND_TO_NPM } from './const';\n\nimport type { TextureSource } from '../texture/sources/TextureSource';\n\n/**\n * Adjusts a blend mode for the current alpha mode. Returns the blend mode that works with that format.\n * eg 'normal' blend mode will return 'normal-npm' when rendering with premultiplied alpha.\n * and 'normal' if the texture is already premultiplied (the default)\n * @param blendMode - The blend mode to get the adjusted blend mode for.\n * @param textureSource - The texture to test the format of.\n * @returns - the blend mode that should be used to render this texture correctly based on its alphaMode\n * @internal\n */\nexport function getAdjustedBlendModeBlend(blendMode: BLEND_MODES, textureSource: TextureSource): BLEND_MODES\n{\n if (textureSource.alphaMode === 'no-premultiply-alpha')\n {\n return (BLEND_TO_NPM[blendMode as keyof typeof BLEND_TO_NPM] || blendMode) as BLEND_MODES;\n }\n\n return blendMode;\n}\n", "import { getTestContext } from '../../../renderers/gl/shader/program/getTestContext';\nimport { checkMaxIfStatementsInShader } from './checkMaxIfStatementsInShader';\n\nlet maxTexturesPerBatchCache: number | null = null;\n\n/**\n * Returns the maximum number of textures that can be batched. This uses WebGL1's `MAX_TEXTURE_IMAGE_UNITS`.\n * The response for this is that to get this info via WebGPU, we would need to make a context, which\n * would make this function async, and we want to avoid that.\n * @private\n * @deprecated Use `Renderer.limits.maxBatchableTextures` instead.\n * @returns {number} The maximum number of textures that can be batched\n */\nexport function getMaxTexturesPerBatch(): number\n{\n if (maxTexturesPerBatchCache) return maxTexturesPerBatchCache;\n\n const gl = getTestContext();\n\n // step 1: first check max textures the GPU can handle.\n maxTexturesPerBatchCache = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n\n // step 2: check the maximum number of if statements the shader can have too..\n maxTexturesPerBatchCache = checkMaxIfStatementsInShader(\n maxTexturesPerBatchCache, gl);\n\n gl.getExtension('WEBGL_lose_context')?.loseContext();\n\n return maxTexturesPerBatchCache;\n}\n", "import type { TextureSource } from '../../renderers/shared/texture/sources/TextureSource';\n\n/**\n * Used by the batcher to build texture batches. Holds list of textures and their respective locations.\n * @category rendering\n * @advanced\n */\nexport class BatchTextureArray\n{\n /** Inside textures array. */\n public textures: TextureSource[];\n\n /** Respective locations for textures. */\n public ids: Record<number, number> = Object.create(null);\n\n /** Number of filled elements. */\n public count: number;\n\n constructor()\n {\n this.textures = [];\n this.count = 0;\n }\n\n /** Clear the textures and their locations. */\n public clear(): void\n {\n for (let i = 0; i < this.count; i++)\n {\n const t = this.textures[i];\n\n this.textures[i] = null;\n this.ids[t.uid] = null;\n }\n\n this.count = 0;\n }\n}\n", "import { uid } from '../../../utils/data/uid';\nimport { ViewableBuffer } from '../../../utils/data/ViewableBuffer';\nimport { deprecation } from '../../../utils/logging/deprecation';\nimport { GlobalResourceRegistry } from '../../../utils/pool/GlobalResourceRegistry';\nimport { fastCopy } from '../../renderers/shared/buffer/utils/fastCopy';\nimport { type BLEND_MODES } from '../../renderers/shared/state/const';\nimport { getAdjustedBlendModeBlend } from '../../renderers/shared/state/getAdjustedBlendModeBlend';\nimport { getMaxTexturesPerBatch } from '../gl/utils/maxRecommendedTextures';\nimport { BatchTextureArray } from './BatchTextureArray';\n\nimport type { BoundsData } from '../../../scene/container/bounds/Bounds';\nimport type { BindGroup } from '../../renderers/gpu/shader/BindGroup';\nimport type { Topology } from '../../renderers/shared/geometry/const';\nimport type { Geometry, IndexBufferArray } from '../../renderers/shared/geometry/Geometry';\nimport type { Instruction } from '../../renderers/shared/instructions/Instruction';\nimport type { InstructionSet } from '../../renderers/shared/instructions/InstructionSet';\nimport type { Shader } from '../../renderers/shared/shader/Shader';\nimport type { Texture } from '../../renderers/shared/texture/Texture';\n\n/**\n * The action types for a batch.\n * @category rendering\n * @advanced\n */\nexport type BatchAction = 'startBatch' | 'renderBatch';\n\n/**\n * A batch pool is used to store batches when they are not currently in use.\n * @category rendering\n * @advanced\n */\nexport class Batch implements Instruction\n{\n public renderPipeId = 'batch';\n public action: BatchAction = 'startBatch';\n\n // TODO - eventually this could be useful for flagging batches as dirty and then only rebuilding those ones\n // public elementStart = 0;\n // public elementSize = 0;\n\n // for drawing..\n public start = 0;\n public size = 0;\n public textures: BatchTextureArray = new BatchTextureArray();\n\n public blendMode: BLEND_MODES = 'normal';\n public topology: Topology = 'triangle-strip';\n\n public canBundle = true;\n\n /**\n * breaking rules slightly here in the name of performance..\n * storing references to these bindgroups here is just faster for access!\n * keeps a reference to the GPU bind group to set when rendering this batch for WebGPU. Will be null is using WebGL.\n */\n public gpuBindGroup: GPUBindGroup;\n /**\n * breaking rules slightly here in the name of performance..\n * storing references to these bindgroups here is just faster for access!\n * keeps a reference to the bind group to set when rendering this batch for WebGPU. Will be null if using WebGl.\n */\n public bindGroup: BindGroup;\n\n public batcher: Batcher;\n\n public destroy()\n {\n this.textures = null;\n this.gpuBindGroup = null;\n this.bindGroup = null;\n this.batcher = null;\n }\n}\n\n// inlined pool for SPEEEEEEEEEED :D\nconst batchPool: Batch[] = [];\nlet batchPoolIndex = 0;\n\nGlobalResourceRegistry.register({\n clear: () =>\n {\n // check if the first element has a destroy method\n if (batchPool.length > 0)\n {\n for (const item of batchPool)\n {\n if (item) item.destroy();\n }\n }\n batchPool.length = 0; // clear the array\n batchPoolIndex = 0;\n },\n});\n\nfunction getBatchFromPool()\n{\n return batchPoolIndex > 0 ? batchPool[--batchPoolIndex] : new Batch();\n}\n\nfunction returnBatchToPool(batch: Batch)\n{\n batchPool[batchPoolIndex++] = batch;\n}\n\n/**\n * Represents an element that can be batched for rendering.\n * @interface\n * @category rendering\n * @advanced\n */\nexport interface BatchableElement\n{\n /**\n * The name of the batcher to use. Must be registered.\n * @type {string}\n */\n batcherName: string;\n\n /**\n * The texture to be used for rendering.\n * @type {Texture}\n */\n texture: Texture;\n\n /**\n * The blend mode to be applied.\n * @type {BLEND_MODES}\n */\n blendMode: BLEND_MODES;\n\n /**\n * The size of the index data.\n * @type {number}\n */\n indexSize: number;\n\n /**\n * The size of the attribute data.\n * @type {number}\n */\n attributeSize: number;\n\n /**\n * The topology to be used for rendering.\n * @type {Topology}\n */\n topology: Topology\n\n /**\n * Whether the element should be packed as a quad for better performance.\n * @type {boolean}\n */\n packAsQuad: boolean;\n\n /**\n * The texture ID, stored for efficient updating.\n * @type {number}\n * @private\n */\n _textureId: number;\n\n /**\n * The starting position in the attribute buffer.\n * @type {number}\n * @private\n */\n _attributeStart: number;\n\n /**\n * The starting position in the index buffer.\n * @type {number}\n * @private\n */\n _indexStart: number;\n\n /**\n * Reference to the batcher.\n * @type {Batcher}\n * @private\n */\n _batcher: Batcher;\n\n /**\n * Reference to the batch.\n * @type {Batch}\n * @private\n */\n _batch: Batch;\n\n}\n\n/**\n * Represents a batchable quad element.\n * @extends BatchableElement\n * @category rendering\n * @advanced\n */\nexport interface BatchableQuadElement extends BatchableElement\n{\n /**\n * Indicates that this element should be packed as a quad.\n * @type {true}\n */\n packAsQuad: true;\n\n /**\n * The size of the attribute data for this quad element.\n * @type {4}\n */\n attributeSize: 4;\n\n /**\n * The size of the index data for this quad element.\n * @type {6}\n */\n indexSize: 6;\n\n /**\n * The bounds data for this quad element.\n * @type {BoundsData}\n */\n bounds: BoundsData;\n}\n\n/**\n * Represents a batchable mesh element.\n * @extends BatchableElement\n * @category rendering\n * @advanced\n */\nexport interface BatchableMeshElement extends BatchableElement\n{\n /**\n * The UV coordinates of the mesh.\n * @type {number[] | Float32Array}\n */\n uvs: number[] | Float32Array;\n\n /**\n * The vertex positions of the mesh.\n * @type {number[] | Float32Array}\n */\n positions: number[] | Float32Array;\n\n /**\n * The indices of the mesh.\n * @type {number[] | Uint16Array | Uint32Array}\n */\n indices: number[] | Uint16Array | Uint32Array;\n\n /**\n * The offset in the index buffer.\n * @type {number}\n */\n indexOffset: number;\n\n /**\n * The offset in the attribute buffer.\n * @type {number}\n */\n attributeOffset: number;\n\n /**\n * Indicates that this element should not be packed as a quad.\n * @type {false}\n */\n packAsQuad: false;\n}\n\nlet BATCH_TICK = 0;\n\n/**\n * The options for the batcher.\n * @category rendering\n * @advanced\n */\nexport interface BatcherOptions\n{\n /** The maximum number of textures per batch. */\n maxTextures: number;\n /** The initial size of the attribute buffer. */\n attributesInitialSize?: number;\n /** The initial size of the index buffer. */\n indicesInitialSize?: number;\n}\n\n/**\n * A batcher is used to batch together objects with the same texture.\n * It is an abstract class that must be extended. see DefaultBatcher for an example.\n * @category rendering\n * @advanced\n */\nexport abstract class Batcher\n{\n public static defaultOptions: Partial<BatcherOptions> = {\n maxTextures: null,\n attributesInitialSize: 4,\n indicesInitialSize: 6,\n };\n\n /** unique id for this batcher */\n public readonly uid: number = uid('batcher');\n\n /** The buffer containing attribute data for all elements in the batch. */\n public attributeBuffer: ViewableBuffer;\n\n /** The buffer containing index data for all elements in the batch. */\n public indexBuffer: IndexBufferArray;\n\n /** The current size of the attribute data in the batch. */\n public attributeSize: number;\n\n /** The current size of the index data in the batch. */\n public indexSize: number;\n\n /** The total number of elements currently in the batch. */\n public elementSize: number;\n\n /** The starting index of elements in the current batch. */\n public elementStart: number;\n\n /** Indicates whether the batch data has been modified and needs updating. */\n public dirty = true;\n\n /** The current index of the batch being processed. */\n public batchIndex = 0;\n\n /** An array of all batches created during the current rendering process. */\n public batches: Batch[] = [];\n\n private _elements: BatchableElement[] = [];\n\n private _batchIndexStart: number;\n private _batchIndexSize: number;\n\n /** The maximum number of textures per batch. */\n public readonly maxTextures: number;\n\n /** The name of the batcher. Must be implemented by subclasses. */\n public abstract name: string;\n /** The vertex size of the batcher. Must be implemented by subclasses. */\n protected abstract vertexSize: number;\n\n /** The geometry used by this batcher. Must be implemented by subclasses. */\n public abstract geometry: Geometry;\n\n /**\n * The shader used by this batcher. Must be implemented by subclasses.\n * this can be shared by multiple batchers of the same type.\n */\n public abstract shader: Shader;\n\n /**\n * Packs the attributes of a BatchableMeshElement into the provided views.\n * Must be implemented by subclasses.\n * @param element - The BatchableMeshElement to pack.\n * @param float32View - The Float32Array view to pack into.\n * @param uint32View - The Uint32Array view to pack into.\n * @param index - The starting index in the views.\n * @param textureId - The texture ID to use.\n */\n public abstract packAttributes(\n element: BatchableMeshElement,\n float32View: Float32Array,\n uint32View: Uint32Array,\n index: number,\n textureId: number\n ): void;\n\n /**\n * Packs the attributes of a BatchableQuadElement into the provided views.\n * Must be implemented by subclasses.\n * @param element - The BatchableQuadElement to pack.\n * @param float32View - The Float32Array view to pack into.\n * @param uint32View - The Uint32Array view to pack into.\n * @param index - The starting index in the views.\n * @param textureId - The texture ID to use.\n */\n public abstract packQuadAttributes(\n element: BatchableQuadElement,\n float32View: Float32Array,\n uint32View: Uint32Array,\n index: number,\n textureId: number\n ): void;\n\n constructor(options: BatcherOptions)\n {\n options = { ...Batcher.defaultOptions, ...options };\n\n if (!options.maxTextures)\n {\n deprecation('v8.8.0', 'maxTextures is a required option for Batcher now, please pass it in the options');\n options.maxTextures = getMaxTexturesPerBatch();\n }\n\n const { maxTextures, attributesInitialSize, indicesInitialSize } = options;\n\n this.attributeBuffer = new ViewableBuffer(attributesInitialSize * 4);\n\n this.indexBuffer = new Uint16Array(indicesInitialSize);\n\n this.maxTextures = maxTextures;\n }\n\n public begin()\n {\n this.elementSize = 0;\n this.elementStart = 0;\n this.indexSize = 0;\n this.attributeSize = 0;\n\n for (let i = 0; i < this.batchIndex; i++)\n {\n returnBatchToPool(this.batches[i]);\n }\n\n this.batchIndex = 0;\n this._batchIndexStart = 0;\n this._batchIndexSize = 0;\n\n this.dirty = true;\n }\n\n public add(batchableObject: BatchableElement)\n {\n this._elements[this.elementSize++] = batchableObject;\n\n batchableObject._indexStart = this.indexSize;\n batchableObject._attributeStart = this.attributeSize;\n batchableObject._batcher = this;\n\n this.indexSize += batchableObject.indexSize;\n this.attributeSize += ((batchableObject.attributeSize) * this.vertexSize);\n }\n\n public checkAndUpdateTexture(batchableObject: BatchableElement, texture: Texture): boolean\n {\n const textureId = batchableObject._batch.textures.ids[texture._source.uid];\n\n // TODO could try to be a bit smarter if there are spare textures..\n // but need to figure out how to alter the bind groups too..\n if (!textureId && textureId !== 0) return false;\n\n batchableObject._textureId = textureId;\n batchableObject.texture = texture;\n\n return true;\n }\n\n public updateElement(batchableObject: BatchableElement)\n {\n this.dirty = true;\n\n const attributeBuffer = this.attributeBuffer;\n\n if (batchableObject.packAsQuad)\n {\n this.packQuadAttributes(\n batchableObject as BatchableQuadElement,\n attributeBuffer.float32View,\n attributeBuffer.uint32View,\n batchableObject._attributeStart, batchableObject._textureId);\n }\n else\n {\n this.packAttributes(\n batchableObject as BatchableMeshElement,\n attributeBuffer.float32View,\n attributeBuffer.uint32View,\n batchableObject._attributeStart, batchableObject._textureId);\n }\n }\n\n /**\n * breaks the batcher. This happens when a batch gets too big,\n * or we need to switch to a different type of rendering (a filter for example)\n * @param instructionSet\n */\n public break(instructionSet: InstructionSet)\n {\n const elements = this._elements;\n\n // length 0??!! (we broke without adding anything)\n if (!elements[this.elementStart]) return;\n\n let batch = getBatchFromPool();\n let textureBatch = batch.textures;\n\n textureBatch.clear();\n\n const firstElement = elements[this.elementStart];\n let blendMode = getAdjustedBlendModeBlend(firstElement.blendMode, firstElement.texture._source);\n let topology = firstElement.topology;\n\n if (this.attributeSize * 4 > this.attributeBuffer.size)\n {\n this._resizeAttributeBuffer(this.attributeSize * 4);\n }\n\n if (this.indexSize > this.indexBuffer.length)\n {\n this._resizeIndexBuffer(this.indexSize);\n }\n\n const f32 = this.attributeBuffer.float32View;\n const u32 = this.attributeBuffer.uint32View;\n const indexBuffer = this.indexBuffer;\n\n let size = this._batchIndexSize;\n let start = this._batchIndexStart;\n\n let action: BatchAction = 'startBatch';\n\n const maxTextures = this.maxTextures;\n\n for (let i = this.elementStart; i < this.elementSize; ++i)\n {\n const element = elements[i];\n\n elements[i] = null;\n\n const texture = element.texture;\n const source = texture._source;\n\n const adjustedBlendMode = getAdjustedBlendModeBlend(element.blendMode, source);\n\n const breakRequired = blendMode !== adjustedBlendMode || topology !== element.topology;\n\n if (source._batchTick === BATCH_TICK && !breakRequired)\n {\n element._textureId = source._textureBindLocation;\n\n size += element.indexSize;\n\n if (element.packAsQuad)\n {\n this.packQuadAttributes(\n element as BatchableQuadElement,\n f32, u32,\n element._attributeStart, element._textureId\n );\n this.packQuadIndex(\n indexBuffer,\n element._indexStart,\n element._attributeStart / this.vertexSize\n );\n }\n else\n {\n this.packAttributes(\n element as BatchableMeshElement,\n f32, u32,\n element._attributeStart,\n element._textureId\n );\n this.packIndex(\n element as BatchableMeshElement,\n indexBuffer,\n element._indexStart,\n element._attributeStart / this.vertexSize\n );\n }\n\n element._batch = batch;\n\n continue;\n }\n\n source._batchTick = BATCH_TICK;\n\n if (textureBatch.count >= maxTextures || breakRequired)\n {\n this._finishBatch(\n batch,\n start,\n size - start,\n textureBatch,\n blendMode,\n topology,\n instructionSet,\n action\n );\n\n action = 'renderBatch';\n start = size;\n // create a batch...\n blendMode = adjustedBlendMode;\n topology = element.topology;\n\n batch = getBatchFromPool();\n textureBatch = batch.textures;\n textureBatch.clear();\n\n ++BATCH_TICK;\n }\n\n element._textureId = source._textureBindLocation = textureBatch.count;\n textureBatch.ids[source.uid] = textureBatch.count;\n textureBatch.textures[textureBatch.count++] = source;\n element._batch = batch;\n\n size += element.indexSize;\n\n if (element.packAsQuad)\n {\n this.packQuadAttributes(\n element as BatchableQuadElement,\n f32, u32,\n element._attributeStart, element._textureId\n );\n this.packQuadIndex(\n indexBuffer,\n element._indexStart,\n element._attributeStart / this.vertexSize\n );\n }\n else\n {\n this.packAttributes(element as BatchableMeshElement,\n f32, u32,\n element._attributeStart, element._textureId\n );\n\n this.packIndex(\n element as BatchableMeshElement,\n indexBuffer,\n element._indexStart,\n element._attributeStart / this.vertexSize\n );\n }\n }\n\n if (textureBatch.count > 0)\n {\n this._finishBatch(\n batch,\n start,\n size - start,\n textureBatch,\n blendMode,\n topology,\n instructionSet,\n action\n );\n\n start = size;\n ++BATCH_TICK;\n }\n\n this.elementStart = this.elementSize;\n this._batchIndexStart = start;\n this._batchIndexSize = size;\n }\n\n private _finishBatch(\n batch: Batch,\n indexStart: number,\n indexSize: number,\n textureBatch: BatchTextureArray,\n blendMode: BLEND_MODES,\n topology: Topology,\n instructionSet: InstructionSet,\n action: BatchAction\n )\n {\n batch.gpuBindGroup = null;\n batch.bindGroup = null;\n batch.action = action;\n\n batch.batcher = this;\n batch.textures = textureBatch;\n batch.blendMode = blendMode;\n batch.topology = topology;\n batch.start = indexStart;\n batch.size = indexSize;\n\n ++BATCH_TICK;\n\n // track for returning later!\n this.batches[this.batchIndex++] = batch;\n instructionSet.add(batch);\n }\n\n public finish(instructionSet: InstructionSet)\n {\n this.break(instructionSet);\n }\n\n /**\n * Resizes the attribute buffer to the given size (1 = 1 float32)\n * @param size - the size in vertices to ensure (not bytes!)\n */\n public ensureAttributeBuffer(size: number)\n {\n if (size * 4 <= this.attributeBuffer.size) return;\n\n this._resizeAttributeBuffer(size * 4);\n }\n\n /**\n * Resizes the index buffer to the given size (1 = 1 float32)\n * @param size - the size in vertices to ensure (not bytes!)\n */\n public ensureIndexBuffer(size: number)\n {\n if (size <= this.indexBuffer.length) return;\n\n this._resizeIndexBuffer(size);\n }\n\n private _resizeAttributeBuffer(size: number)\n {\n const newSize = Math.max(size, this.attributeBuffer.size * 2);\n\n const newArrayBuffer = new ViewableBuffer(newSize);\n\n fastCopy(this.attributeBuffer.rawBinaryData, newArrayBuffer.rawBinaryData);\n\n this.attributeBuffer = newArrayBuffer;\n }\n\n private _resizeIndexBuffer(size: number)\n {\n const indexBuffer = this.indexBuffer;\n\n let newSize = Math.max(size, indexBuffer.length * 1.5);\n\n newSize += newSize % 2;\n\n // this, is technically not 100% accurate, as really we should\n // be checking the maximum value in the buffer. This approximation\n // does the trick though...\n\n // make sure buffer is always an even number..\n const newIndexBuffer = (newSize > 65535) ? new Uint32Array(newSize) : new Uint16Array(newSize);\n\n if (newIndexBuffer.BYTES_PER_ELEMENT !== indexBuffer.BYTES_PER_ELEMENT)\n {\n for (let i = 0; i < indexBuffer.length; i++)\n {\n newIndexBuffer[i] = indexBuffer[i];\n }\n }\n else\n {\n fastCopy(indexBuffer.buffer, newIndexBuffer.buffer);\n }\n\n this.indexBuffer = newIndexBuffer;\n }\n\n public packQuadIndex(indexBuffer: IndexBufferArray, index: number, indicesOffset: number)\n {\n indexBuffer[index] = indicesOffset + 0;\n indexBuffer[index + 1] = indicesOffset + 1;\n indexBuffer[index + 2] = indicesOffset + 2;\n\n indexBuffer[index + 3] = indicesOffset + 0;\n indexBuffer[index + 4] = indicesOffset + 2;\n indexBuffer[index + 5] = indicesOffset + 3;\n }\n\n public packIndex(element: BatchableMeshElement, indexBuffer: IndexBufferArray, index: number, indicesOffset: number)\n {\n const indices = element.indices;\n const size = element.indexSize;\n const indexOffset = element.indexOffset;\n const attributeOffset = element.attributeOffset;\n\n for (let i = 0; i < size; i++)\n {\n indexBuffer[index++] = indicesOffset + indices[i + indexOffset] - attributeOffset;\n }\n }\n\n /**\n * Destroys the batch and its resources.\n * @param options - destruction options\n * @param options.shader - whether to destroy the associated shader\n */\n public destroy(options: {shader?: boolean} = {})\n {\n if (this.batches === null) return;\n\n for (let i = 0; i < this.batches.length; i++)\n {\n returnBatchToPool(this.batches[i]);\n }\n\n this.batches = null;\n this.geometry.destroy(true);\n this.geometry = null;\n\n if (options.shader)\n {\n this.shader?.destroy();\n this.shader = null;\n }\n\n for (let i = 0; i < this._elements.length; i++)\n {\n if (this._elements[i]) this._elements[i]._batch = null;\n }\n\n this._elements = null;\n\n this.indexBuffer = null;\n\n this.attributeBuffer.destroy();\n this.attributeBuffer = null;\n }\n}\n\n", "import { Buffer } from '../../renderers/shared/buffer/Buffer';\nimport { BufferUsage } from '../../renderers/shared/buffer/const';\nimport { Geometry } from '../../renderers/shared/geometry/Geometry';\n\nconst placeHolderBufferData = new Float32Array(1);\nconst placeHolderIndexData = new Uint32Array(1);\n\n/**\n * This class represents a geometry used for batching in the rendering system.\n * It defines the structure of vertex attributes and index buffers for batched rendering.\n * @category rendering\n * @advanced\n */\nexport class BatchGeometry extends Geometry\n{\n constructor()\n {\n const vertexSize = 6;\n\n const attributeBuffer = new Buffer({\n data: placeHolderBufferData,\n label: 'attribute-batch-buffer',\n usage: BufferUsage.VERTEX | BufferUsage.COPY_DST,\n shrinkToFit: false,\n });\n\n const indexBuffer = new Buffer({\n data: placeHolderIndexData,\n label: 'index-batch-buffer',\n usage: BufferUsage.INDEX | BufferUsage.COPY_DST, // | BufferUsage.STATIC,\n shrinkToFit: false,\n });\n\n const stride = vertexSize * 4;\n\n super({\n attributes: {\n aPosition: {\n buffer: attributeBuffer,\n format: 'float32x2',\n stride,\n offset: 0,\n },\n aUV: {\n buffer: attributeBuffer,\n format: 'float32x2',\n stride,\n offset: 2 * 4,\n },\n aColor: {\n buffer: attributeBuffer,\n format: 'unorm8x4',\n stride,\n offset: 4 * 4,\n },\n aTextureIdAndRound: {\n buffer: attributeBuffer,\n format: 'uint16x2',\n stride,\n offset: 5 * 4,\n },\n },\n indexBuffer\n });\n }\n}\n\n", "import { compileHighShaderGlProgram, compileHighShaderGpuProgram } from '../../high-shader/compileHighShaderToProgram';\nimport { colorBit, colorBitGl } from '../../high-shader/shader-bits/colorBit';\nimport { generateTextureBatchBit, generateTextureBatchBitGl } from '../../high-shader/shader-bits/generateTextureBatchBit';\nimport { roundPixelsBit, roundPixelsBitGl } from '../../high-shader/shader-bits/roundPixelsBit';\nimport { getBatchSamplersUniformGroup } from '../../renderers/gl/shader/getBatchSamplersUniformGroup';\nimport { Shader } from '../../renderers/shared/shader/Shader';\n\n/**\n * DefaultShader is a specialized shader class designed for batch rendering.\n * It extends the base Shader class and provides functionality for handling\n * color, texture batching, and pixel rounding in both WebGL and WebGPU contexts.\n *\n * It is used by the default batcher\n * @extends Shader\n * @category rendering\n * @advanced\n */\nexport class DefaultShader extends Shader\n{\n /** @internal */\n public maxTextures?: number;\n\n constructor(maxTextures: number)\n {\n const glProgram = compileHighShaderGlProgram({\n name: 'batch',\n bits: [\n colorBitGl,\n generateTextureBatchBitGl(maxTextures),\n roundPixelsBitGl,\n ]\n });\n\n const gpuProgram = compileHighShaderGpuProgram({\n name: 'batch',\n bits: [\n colorBit,\n generateTextureBatchBit(maxTextures),\n roundPixelsBit,\n ]\n });\n\n super({\n glProgram,\n gpuProgram,\n resources: {\n batchSamplers: getBatchSamplersUniformGroup(maxTextures),\n }\n });\n\n this.maxTextures = maxTextures;\n }\n}\n", "import { ExtensionType } from '../../../extensions/Extensions';\nimport { Batcher } from './Batcher';\nimport { BatchGeometry } from './BatchGeometry';\nimport { DefaultShader } from './DefaultShader';\n\nimport type { Matrix } from '../../../maths/matrix/Matrix';\nimport type { Shader } from '../../renderers/shared/shader/Shader';\nimport type { BatchableMeshElement, BatchableQuadElement, BatcherOptions } from './Batcher';\n\nlet defaultShader: Shader = null;\n\n/**\n * Represents the common elements for default batch rendering.\n * This interface defines the properties that are used by the DefaultBatcher\n * to render elements efficiently in a batch.\n * @category rendering\n * @advanced\n */\nexport interface DefaultBatchElements\n{\n /**\n * The color of the element that will be multiplied with the texture color.\n * This is typically represented as a 32-bit integer in RGBA format.\n */\n color: number;\n\n /**\n * Determines whether the element should be rounded to the nearest pixel.\n * - 0: No rounding (default)\n * - 1: Round to nearest pixel\n * This can help with visual consistency, especially for pixel art styles.\n */\n roundPixels: 0 | 1;\n\n /**\n * The transform matrix of the element.\n * This matrix represents the position, scale, rotation, and skew of the element.\n */\n transform: Matrix;\n}\n\n/**\n * Represents a batchable quad element with default batch properties.\n * @category rendering\n * @advanced\n */\nexport interface DefaultBatchableQuadElement extends BatchableQuadElement, DefaultBatchElements {}\n\n/**\n * Represents a batchable mesh element with default batch properties.\n * @category rendering\n * @advanced\n */\nexport interface DefaultBatchableMeshElement extends BatchableMeshElement, DefaultBatchElements {}\n\n/**\n * The default batcher is used to batch quads and meshes. This batcher will batch the following elements:\n * - tints\n * - roundPixels\n * - texture\n * - transform\n * @category rendering\n * @advanced\n */\nexport class DefaultBatcher extends Batcher\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.Batcher,\n ],\n name: 'default',\n } as const;\n\n public geometry = new BatchGeometry();\n public shader: DefaultShader;\n\n public name = DefaultBatcher.extension.name;\n\n /** The size of one attribute. 1 = 32 bit. x, y, u, v, color, textureIdAndRound -> total = 6 */\n public vertexSize = 6;\n\n constructor(options: BatcherOptions)\n {\n super(options);\n\n defaultShader ??= new DefaultShader(options.maxTextures);\n\n this.shader = defaultShader;\n }\n\n /**\n * Packs the attributes of a DefaultBatchableMeshElement into the provided views.\n * @param element - The DefaultBatchableMeshElement to pack.\n * @param float32View - The Float32Array view to pack into.\n * @param uint32View - The Uint32Array view to pack into.\n * @param index - The starting index in the views.\n * @param textureId - The texture ID to use.\n */\n public packAttributes(\n element: DefaultBatchableMeshElement,\n float32View: Float32Array,\n uint32View: Uint32Array,\n index: number,\n textureId: number\n )\n {\n const textureIdAndRound = (textureId << 16) | (element.roundPixels & 0xFFFF);\n\n const wt = element.transform;\n\n const a = wt.a;\n const b = wt.b;\n const c = wt.c;\n const d = wt.d;\n const tx = wt.tx;\n const ty = wt.ty;\n\n const { positions, uvs } = element;\n\n const argb = element.color;\n\n const offset = element.attributeOffset;\n const end = offset + element.attributeSize;\n\n for (let i = offset; i < end; i++)\n {\n const i2 = i * 2;\n\n const x = positions[i2];\n const y = positions[(i2) + 1];\n\n float32View[index++] = (a * x) + (c * y) + tx;\n float32View[index++] = (d * y) + (b * x) + ty;\n\n float32View[index++] = uvs[i2];\n float32View[index++] = uvs[(i2) + 1];\n\n uint32View[index++] = argb;\n uint32View[index++] = textureIdAndRound;\n }\n }\n\n /**\n * Packs the attributes of a DefaultBatchableQuadElement into the provided views.\n * @param element - The DefaultBatchableQuadElement to pack.\n * @param float32View - The Float32Array view to pack into.\n * @param uint32View - The Uint32Array view to pack into.\n * @param index - The starting index in the views.\n * @param textureId - The texture ID to use.\n */\n public packQuadAttributes(\n element: DefaultBatchableQuadElement,\n float32View: Float32Array,\n uint32View: Uint32Array,\n index: number,\n textureId: number\n )\n {\n const texture = element.texture;\n\n const wt = element.transform;\n\n const a = wt.a;\n const b = wt.b;\n const c = wt.c;\n const d = wt.d;\n const tx = wt.tx;\n const ty = wt.ty;\n\n const bounds = element.bounds;\n\n const w0 = bounds.maxX;\n const w1 = bounds.minX;\n const h0 = bounds.maxY;\n const h1 = bounds.minY;\n\n const uvs = texture.uvs;\n\n // _ _ _ _\n // a b g r\n const argb = element.color;\n\n const textureIdAndRound = (textureId << 16) | (element.roundPixels & 0xFFFF);\n\n float32View[index + 0] = (a * w1) + (c * h1) + tx;\n float32View[index + 1] = (d * h1) + (b * w1) + ty;\n\n float32View[index + 2] = uvs.x0;\n float32View[index + 3] = uvs.y0;\n\n uint32View[index + 4] = argb;\n uint32View[index + 5] = textureIdAndRound;\n\n // xy\n float32View[index + 6] = (a * w0) + (c * h1) + tx;\n float32View[index + 7] = (d * h1) + (b * w0) + ty;\n\n float32View[index + 8] = uvs.x1;\n float32View[index + 9] = uvs.y1;\n\n uint32View[index + 10] = argb;\n uint32View[index + 11] = textureIdAndRound;\n\n // xy\n float32View[index + 12] = (a * w0) + (c * h0) + tx;\n float32View[index + 13] = (d * h0) + (b * w0) + ty;\n\n float32View[index + 14] = uvs.x2;\n float32View[index + 15] = uvs.y2;\n\n uint32View[index + 16] = argb;\n uint32View[index + 17] = textureIdAndRound;\n\n // xy\n float32View[index + 18] = (a * w1) + (c * h0) + tx;\n float32View[index + 19] = (d * h0) + (b * w1) + ty;\n\n float32View[index + 20] = uvs.x3;\n float32View[index + 21] = uvs.y3;\n\n uint32View[index + 22] = argb;\n uint32View[index + 23] = textureIdAndRound;\n }\n\n /**\n * Updates the maximum number of textures that can be used in the shader.\n * @param maxTextures - The maximum number of textures that can be used in the shader.\n * @internal\n */\n public _updateMaxTextures(maxTextures: number): void\n {\n if (this.shader.maxTextures === maxTextures) return;\n defaultShader = new DefaultShader(maxTextures);\n this.shader = defaultShader;\n }\n\n public override destroy(): void\n {\n // do not destroy default shader!\n this.shader = null;\n super.destroy();\n }\n}\n\n", "/**\n * @param rgb\n * @param alpha\n * @param out\n * @param offset\n * @internal\n */\nexport function colorToUniform(rgb: number, alpha: number, out: Float32Array, offset: number)\n{\n // TODO replace with Color..\n out[offset++] = ((rgb >> 16) & 0xFF) / 255;\n out[offset++] = ((rgb >> 8) & 0xFF) / 255;\n out[offset++] = (rgb & 0xFF) / 255;\n out[offset++] = alpha;\n}\n\n/**\n * @param abgr\n * @param out\n * @param offset\n * @internal\n */\nexport function color32BitToUniform(abgr: number, out: Float32Array, offset: number)\n{\n const alpha = ((abgr >> 24) & 0xFF) / 255;\n\n out[offset++] = ((abgr & 0xFF) / 255) * alpha;\n out[offset++] = (((abgr >> 8) & 0xFF) / 255) * alpha;\n out[offset++] = (((abgr >> 16) & 0xFF) / 255) * alpha;\n out[offset++] = alpha;\n}\n", "import type { Matrix } from '../../maths/matrix/Matrix';\nimport type { Batch, Batcher } from '../../rendering/batcher/shared/Batcher';\nimport type { DefaultBatchableQuadElement } from '../../rendering/batcher/shared/DefaultBatcher';\nimport type { Topology } from '../../rendering/renderers/shared/geometry/const';\nimport type { Texture } from '../../rendering/renderers/shared/texture/Texture';\nimport type { BoundsData } from '../container/bounds/Bounds';\nimport type { Container } from '../container/Container';\n\n/**\n * A batchable sprite object.\n * @internal\n */\nexport class BatchableSprite implements DefaultBatchableQuadElement\n{\n public batcherName = 'default';\n public topology: Topology = 'triangle-list';\n\n // batch specific..\n public readonly attributeSize = 4;\n public readonly indexSize = 6;\n public readonly packAsQuad = true;\n\n public transform: Matrix;\n\n public renderable: Container;\n public texture: Texture;\n public bounds: BoundsData;\n\n public roundPixels: 0 | 1 = 0;\n\n public _indexStart: number;\n public _textureId: number;\n public _attributeStart = 0; // location in the buffer\n public _batcher: Batcher = null;\n public _batch: Batch = null;\n\n get blendMode() { return this.renderable.groupBlendMode; }\n get color() { return this.renderable.groupColorAlpha; }\n\n public reset()\n {\n this.renderable = null;\n this.texture = null;\n this._batcher = null;\n this._batch = null;\n this.bounds = null;\n }\n\n public destroy()\n {\n // BOOM!\n }\n}\n", "import { GlProgram } from '../rendering/renderers/gl/shader/GlProgram';\nimport { GpuProgram } from '../rendering/renderers/gpu/shader/GpuProgram';\nimport { Shader } from '../rendering/renderers/shared/shader/Shader';\nimport { State } from '../rendering/renderers/shared/state/State';\n\nimport type { RenderSurface } from '../rendering/renderers/shared/renderTarget/RenderTargetSystem';\nimport type {\n IShaderWithResources,\n ShaderFromResources,\n ShaderWithResources\n} from '../rendering/renderers/shared/shader/Shader';\nimport type { BLEND_MODES } from '../rendering/renderers/shared/state/const';\nimport type { Texture } from '../rendering/renderers/shared/texture/Texture';\nimport type { FilterSystem } from './FilterSystem';\n\n/**\n * The options to use when creating a new filter.\n * @category filters\n * @advanced\n */\nexport interface FilterOptions\n{\n /** optional blend mode used by the filter when rendering (defaults to 'normal') */\n blendMode?: BLEND_MODES;\n /**\n * the resolution the filter should be rendered at. The lower the resolution, the more performant\n * the filter will be, but the lower the quality of the output. (default 1)\n * If 'inherit', the resolution of the render target is used.\n * Consider lowering this for things like blurs filters\n */\n resolution?: number | 'inherit';\n /**\n * the amount of pixels to pad the container with when applying the filter. For example a blur extends the\n * container out as it blurs, so padding is applied to ensure that extra detail is rendered as well\n * without clipping occurring. (default 0)\n */\n padding?: number;\n /**\n * If true the filter will make use of antialiasing. Although it looks better this can have a performance impact.\n * If set to 'inherit', the filter will detect the antialiasing of the render target and change this automatically.\n * Definitely don't set this to true if the render target has antialiasing set to false. As it will antialias,\n * but you won't see the difference. (default 'off')\n *\n * This can be a boolean or [FilterAntialias]{@link FilterAntialias} string.\n */\n antialias?: FilterAntialias | boolean;\n /**\n * If this is set to true, the filter system will grab a snap shot of the area being rendered\n * to and pass this into the shader. This is useful for blend modes that need to be aware of the pixels\n * they are rendering to. Only use if you need that data, otherwise its an extra gpu copy you don't need!\n * (default false)\n *\n * If given, the shader should have a uniform named `uBackTexture`, which is where the pixels of the\n * area being rendered to can be sampled from.\n */\n blendRequired?: boolean;\n /**\n * If this is set to true, the filter system will clip filter texture into viewport\n * This is useful for filters that applied to whole texture.\n * (default true)\n */\n clipToViewport?: boolean;\n}\n\n/**\n * Filter options mixed with shader resources. A filter needs a shader and some resources to work.\n * @category filters\n * @advanced\n * @see {@link FilterOptions}\n */\nexport type FilterWithShader = FilterOptions & IShaderWithResources;\n\n/**\n * The antialiasing mode of the filter. This can be either:\n * - `on` - the filter is always antialiased regardless of the render target settings\n * - `off` - (default) the filter is never antialiased regardless of the render target settings\n * - `inherit` - the filter uses the antialias settings of the render target\n * @category filters\n * @advanced\n */\nexport type FilterAntialias = 'on' | 'off' | 'inherit';\n\n/**\n * The Filter class is the base for all filter effects used in Pixi.js\n * As it extends a shader, it requires that a glProgram is parsed in to work with WebGL and a gpuProgram for WebGPU.\n * If you don't proved one, then the filter is skipped and just rendered as if it wasn't there for that renderer.\n *\n * A filter can be applied to anything that extends Container in Pixi.js which also includes Sprites, Graphics etc.\n *\n * Its worth noting Performance-wise filters can be pretty expensive if used too much in a single scene.\n * The following happens under the hood when a filter is applied:\n *\n * .1. Break the current batch\n * <br>\n * .2. The target is measured using getGlobalBounds\n * (recursively go through all children and figure out how big the object is)\n * <br>\n * .3. Get the closest Po2 Textures from the texture pool\n * <br>\n * .4. Render the target to that texture\n * <br>\n * .5. Render that texture back to the main frame buffer as a quad using the filters program.\n * <br>\n * <br>\n * Some filters (such as blur) require multiple passes too which can result in an even bigger performance hit. So be careful!\n * Its not generally the complexity of the shader that is the bottle neck,\n * but all the framebuffer / shader switching that has to take place.\n * One filter applied to a container with many objects is MUCH faster than many filter applied to many objects.\n * @category filters\n * @advanced\n * @example\n * import { Filter } from 'pixi.js';\n *\n * const customFilter = new Filter({\n * glProgram: new GlProgram({\n * fragment,\n * vertex,\n * }),\n * resources: {\n * timeUniforms: {\n * uTime: { value: 0.0, type: 'f32' },\n * },\n * },\n * });\n *\n * // Apply the filter\n * sprite.filters = [customFilter];\n *\n * // Update uniform\n * app.ticker.add((ticker) => {\n * filter.resources.timeUniforms.uniforms.uTime += 0.04 * ticker.deltaTime;\n * });\n */\nexport class Filter extends Shader\n{\n /** The default filter settings */\n public static defaultOptions: FilterOptions = {\n blendMode: 'normal',\n resolution: 1,\n padding: 0,\n antialias: 'off',\n blendRequired: false,\n clipToViewport: true,\n };\n\n /**\n * The padding of the filter. Some filters require extra space to breath such as a blur.\n * Increasing this will add extra width and height to the bounds of the object that the\n * filter is applied to.\n * @default 0\n */\n public padding: number;\n\n /**\n * should the filter use antialiasing?\n * @default inherit\n */\n public antialias: FilterAntialias;\n\n /** If enabled is true the filter is applied, if false it will not. */\n public enabled = true;\n\n /**\n * The gpu state the filter requires to render.\n * @internal\n */\n public _state = State.for2d();\n\n /**\n * The resolution of the filter. Setting this to be lower will lower the quality but\n * increase the performance of the filter.\n * @default 1\n */\n public resolution: number | 'inherit';\n\n /**\n * Whether or not this filter requires the previous render texture for blending.\n * @default false\n */\n public blendRequired: boolean;\n\n /**\n * Clip texture into viewport or not\n * @default true\n */\n public clipToViewport: boolean;\n\n /**\n * @param options - The optional parameters of this filter.\n */\n constructor(options: FilterWithShader)\n {\n options = { ...Filter.defaultOptions, ...options };\n\n super(options as ShaderWithResources);\n\n this.blendMode = options.blendMode;\n this.padding = options.padding;\n\n // check if is boolean\n if (typeof options.antialias === 'boolean')\n {\n this.antialias = options.antialias ? 'on' : 'off';\n }\n else\n {\n this.antialias = options.antialias;\n }\n\n this.resolution = options.resolution;\n this.blendRequired = options.blendRequired;\n this.clipToViewport = options.clipToViewport;\n\n // this is where the filter system will attach the filter texture\n this.addResource('uTexture', 0, 1);\n\n if (options.blendRequired)\n {\n // this is where the filter system will attach the back texture\n this.addResource('uBackTexture', 0, 3);\n }\n }\n\n /**\n * Applies the filter\n * @param filterManager - The renderer to retrieve the filter from\n * @param input - The input render target.\n * @param output - The target to output to.\n * @param clearMode - Should the output be cleared before rendering to it\n */\n public apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * Get the blend mode of the filter.\n * @default \"normal\"\n */\n get blendMode(): BLEND_MODES\n {\n return this._state.blendMode;\n }\n\n /** Sets the blend mode of the filter. */\n set blendMode(value: BLEND_MODES)\n {\n this._state.blendMode = value;\n }\n\n /**\n * A short hand function to create a filter based of a vertex and fragment shader src.\n * @param options\n * @returns A shiny new PixiJS filter!\n */\n public static from(options: FilterOptions & ShaderFromResources): Filter\n {\n const { gpu, gl, ...rest } = options;\n\n let gpuProgram: GpuProgram;\n let glProgram: GlProgram;\n\n if (gpu)\n {\n gpuProgram = GpuProgram.from(gpu);\n }\n\n if (gl)\n {\n glProgram = GlProgram.from(gl);\n }\n\n return new Filter({\n gpuProgram,\n glProgram,\n ...rest\n });\n }\n}\n"],
5
+ "mappings": "0hBAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,cAEA,IAAIC,GAAM,OAAO,UAAU,eACvBC,EAAS,IASb,SAASC,IAAS,CAAC,CASf,OAAO,SACTA,GAAO,UAAY,OAAO,OAAO,IAAI,EAMhC,IAAIA,GAAO,EAAE,YAAWD,EAAS,KAYxC,SAASE,GAAGC,EAAIC,EAASC,EAAM,CAC7B,KAAK,GAAKF,EACV,KAAK,QAAUC,EACf,KAAK,KAAOC,GAAQ,EACtB,CAaA,SAASC,GAAYC,EAASC,EAAOL,EAAIC,EAASC,EAAM,CACtD,GAAI,OAAOF,GAAO,WAChB,MAAM,IAAI,UAAU,iCAAiC,EAGvD,IAAIM,EAAW,IAAIP,GAAGC,EAAIC,GAAWG,EAASF,CAAI,EAC9CK,EAAMV,EAASA,EAASQ,EAAQA,EAEpC,OAAKD,EAAQ,QAAQG,CAAG,EACdH,EAAQ,QAAQG,CAAG,EAAE,GAC1BH,EAAQ,QAAQG,CAAG,EAAI,CAACH,EAAQ,QAAQG,CAAG,EAAGD,CAAQ,EADxBF,EAAQ,QAAQG,CAAG,EAAE,KAAKD,CAAQ,GAD1CF,EAAQ,QAAQG,CAAG,EAAID,EAAUF,EAAQ,gBAI7DA,CACT,CASA,SAASI,GAAWJ,EAASG,EAAK,CAC5B,EAAEH,EAAQ,eAAiB,EAAGA,EAAQ,QAAU,IAAIN,GACnD,OA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EAAQ,QAGnB,OAAOA,EAAQ,WAAc,UAExB,KAAA,UAAYA,EAAQ,UAAY,KAAO,MAI5C,KAAK,UAAYA,EAAQ,UAG7B,KAAK,WAAaA,EAAQ,WAC1B,KAAK,cAAgBA,EAAQ,cAC7B,KAAK,eAAiBA,EAAQ,eAGzB,KAAA,YAAY,WAAY,EAAG,CAAC,EAE7BA,EAAQ,eAGH,KAAA,YAAY,eAAgB,EAAG,CAAC,CACzC,CAUG,MACHE,EACAC,EACAC,EACAC,EAEJ,CACIH,EAAc,YAAY,KAAMC,EAAOC,EAAQC,CAAS,CAAA,CAO5D,IAAI,WACJ,CACI,OAAO,KAAK,OAAO,SAAA,CAIvB,IAAI,UAAUC,EACd,CACI,KAAK,OAAO,UAAYA,CAAA,CAQ5B,OAAc,KAAKN,EACnB,CACI,GAAM,CAAE,IAAAO,EAAK,GAAAC,EAAI,GAAGC,CAAA,EAAST,EAEzBU,EACAC,EAEJ,OAAIJ,IAEaG,EAAAE,EAAW,KAAKL,CAAG,GAGhCC,IAEYG,EAAAE,GAAU,KAAKL,CAAE,GAG1B,IAAIV,GAAO,CACd,WAAAY,EACA,UAAAC,EACA,GAAGF,CAAA,CACN,CAAA,CAET,EAtJaX,GAGK,eAAgC,CAC1C,UAAW,SACX,WAAY,EACZ,QAAS,EACT,UAAW,MACX,cAAe,GACf,eAAgB,EACpB,EAVG,IAAMgB,GAANhB",
6
+ "names": ["require_eventemitter3", "__commonJSMin", "exports", "module", "has", "prefix", "Events", "EE", "fn", "context", "once", "addListener", "emitter", "event", "listener", "evt", "clearEvent", "EventEmitter", "names", "events", "name", "handlers", "i", "l", "ee", "listeners", "a1", "a2", "a3", "a4", "a5", "len", "args", "length", "j", "ExtensionType", "normalizeExtension", "ext", "normalizeExtensionPriority", "defaultPriority", "extensions", "type", "handlers", "queue", "onAdd", "onRemove", "addHandlers", "removeHandlers", "map", "extension", "item", "a", "b", "index", "list", "Target", "sources", "source", "RendererType", "import_index", "eventemitter3_default", "EventEmitter", "r", "t", "n", "e", "u", "a", "o", "i", "s", "h", "b", "g", "d", "f", "c", "l", "p", "v", "m", "y", "N", "x", "M", "r", "n", "c", "e", "H", "$", "j", "x", "o", "t", "u", "i", "a", "s", "d", "h", "w", "S", "k", "y", "names_default", "e", "f", "a", "d", "l", "i", "n", "o", "t", "b", "c", "g", "u", "r", "k", "names_default", "_Color", "value", "value1", "value2", "type1", "v", "i", "keys1", "keys2", "key", "r", "g", "b", "a", "out", "alpha", "applyToRGB", "hexString", "alphaString", "int", "match", "color", "w", "min", "max", "Color", "PI_2", "RAD_TO_DEG", "DEG_TO_RAD", "Point", "_Point", "x", "y", "p", "tempPoint", "Matrix", "_Matrix", "a", "b", "c", "d", "tx", "ty", "array", "transpose", "out", "pos", "newPos", "Point", "x", "y", "id", "angle", "cos", "sin", "a1", "c1", "tx1", "matrix", "b1", "d1", "a2", "b2", "c2", "d2", "pivotX", "pivotY", "scaleX", "scaleY", "rotation", "skewX", "skewY", "transform", "pivot", "delta", "PI_2", "n", "identityMatrix", "tempMatrix", "uidCache", "uid", "name", "warnings", "v8_0_0", "v8_3_4", "deprecationState", "deprecation", "version", "message", "ignoreDepth", "stack", "deprecationMessage", "useGroup", "value", "warnCount", "maxWarnings", "warn", "args", "GlobalResourceRegistry", "pool", "Pool", "ClassType", "initialSize", "total", "i", "data", "item", "PoolGroupClass", "Class", "total", "data", "item", "ClassType", "Pool", "stats", "pool", "name", "BigPool", "GlobalResourceRegistry", "MaskEffectManagerClass", "test", "item", "i", "BigPool", "effect", "MaskEffectManager", "extensions", "ExtensionType", "nextPow2", "v", "isPow2", "definedProps", "obj", "result", "key", "idHash", "createResourceIdFromString", "value", "id", "uid", "_TextureStyle", "eventemitter3_default", "options", "deprecation", "v8_0_0", "bigKey", "TextureStyle", "_TextureSource", "eventemitter3_default", "options", "uid", "TextureStyle", "definedProps", "value", "resolution", "resource", "width", "height", "newPixelWidth", "newPixelHeight", "isPow2", "_resource", "TextureSource", "BufferImageSource", "TextureSource", "options", "buffer", "format", "resource", "ExtensionType", "ux", "uy", "vx", "vy", "rotationCayley", "rotationMatrices", "signum", "init", "row", "j", "_ux", "_uy", "_vx", "_vy", "k", "mat", "Matrix", "groupD8", "ind", "rotation", "rotationSecond", "rotationFirst", "dx", "dy", "matrix", "tx", "ty", "rect", "sourceFrame", "out", "x", "y", "width", "height", "frameX", "frameY", "frameWidth", "frameHeight", "tempPoints", "Point", "Rectangle", "_Rectangle", "x", "y", "width", "height", "bounds", "rectangle", "strokeWidth", "alignment", "_x", "_y", "strokeWidthOuter", "strokeWidthInner", "outerLeft", "outerRight", "outerTop", "outerBottom", "innerLeft", "innerRight", "innerTop", "innerBottom", "other", "transform", "x0", "y0", "x1", "y1", "lt", "lb", "rt", "rb", "s", "nx", "ny", "n00", "n10", "n01", "n11", "mx", "my", "m00", "m10", "m01", "m11", "paddingX", "paddingY", "x2", "y2", "resolution", "eps", "out", "NOOP", "tempMat", "Matrix", "TextureMatrix", "texture", "clampMargin", "value", "uvs", "out", "mat", "i", "x", "y", "tex", "orig", "trim", "texBase", "frame", "margin", "offset", "Texture", "eventemitter3_default", "source", "label", "frame", "orig", "trim", "defaultAnchor", "defaultBorders", "rotate", "dynamic", "uid", "Rectangle", "TextureSource", "width", "height", "value", "TextureMatrix", "uvs", "nX", "nY", "nW", "nH", "w2", "h2", "cX", "cY", "groupD8", "destroySource", "deprecation", "v8_0_0", "NOOP", "BufferImageSource", "cullingMixin", "ObservablePoint", "_ObservablePoint", "observer", "x", "y", "p", "value", "cacheAsTextureMixin", "val", "deprecation", "removeItems", "arr", "startIdx", "removeCount", "length", "i", "len", "childrenHelperMixin", "beginIndex", "endIndex", "end", "range", "removed", "i", "child", "removeItems", "renderGroup", "index", "deprecation", "v8_0_0", "children", "currentIndex", "child2", "index1", "index2", "c", "childMat", "newMatrix", "oldChild", "newChild", "collectRenderablesMixin", "instructionSet", "renderer", "currentLayer", "children", "length", "i", "renderPipes", "effect", "FilterEffect", "i", "effectsMixin", "renderGroup", "effect", "a", "b", "index", "value", "MaskEffectManager", "options", "FilterEffect", "hasFilters", "hadFilters", "didChange", "findMixin", "deprecation", "v8_0_0", "value", "name", "deep", "label", "children", "i", "child", "found", "out", "defaultMatrix", "Matrix", "Bounds", "_Bounds", "minX", "minY", "maxX", "maxY", "Rectangle", "rectangle", "x0", "y0", "x1", "y1", "matrix", "a", "b", "c", "d", "tx", "ty", "x", "y", "rect", "bounds", "mask", "left", "right", "top", "bottom", "paddingX", "paddingY", "value", "width", "height", "vertexData", "beginOffset", "endOffset", "i", "localX", "localY", "matrixPool", "BigPool", "Matrix", "boundsPool", "Bounds", "tempMatrix", "Matrix", "getFastGlobalBoundsMixin", "factorRenderLayers", "bounds", "Bounds", "renderGroup", "currentLayer", "localBounds", "manageEffects", "boundsPool", "viewBounds", "children", "i", "advanced", "getGlobalBounds", "target", "skipUpdateTransform", "bounds", "parentTransform", "pooledMatrix", "matrixPool", "updateTransformBackwards", "Matrix", "_getGlobalBounds", "worldTransform", "parentBounds", "preserveBounds", "boundsPool", "renderableBounds", "i", "parent", "multiplyHexColors", "color1", "color2", "r1", "g1", "b1", "r2", "g2", "b2", "r", "g", "b", "WHITE_BGR", "multiplyColors", "localBGRColor", "parentBGRColor", "multiplyHexColors", "bgr2rgb", "color", "getGlobalMixin", "skipUpdate", "alpha", "current", "matrix", "Matrix", "parentTransform", "updateTransformBackwards", "matrixPool", "multiplyColors", "parent", "getLocalBounds", "target", "bounds", "relativeMatrix", "Matrix", "_getLocalBounds", "parentTransform", "rootContainer", "isRoot", "relativeTransform", "matrixPool", "localTransform", "parentBounds", "preserveBounds", "boundsPool", "children", "i", "checkChildrenDidChange", "container", "previousData", "children", "i", "child", "uid", "didChange", "index", "tempMatrix", "Matrix", "measureMixin", "value", "localWidth", "sign", "localHeight", "Bounds", "localBoundsCacheData", "checkChildrenDidChange", "getLocalBounds", "skipUpdate", "bounds", "getGlobalBounds", "onRenderMixin", "func", "renderGroup", "sortMixin", "value", "sortChildren", "a", "b", "toLocalGlobalMixin", "point", "Point", "skipUpdate", "position", "globalMatrix", "matrixPool", "from", "InstructionSet", "uid", "instruction", "count", "TexturePoolClass", "textureOptions", "TextureStyle", "pixelWidth", "pixelHeight", "antialias", "textureSource", "TextureSource", "Texture", "frameWidth", "frameHeight", "resolution", "po2Width", "po2Height", "nextPow2", "key", "texture", "source", "renderTexture", "resetStyle", "destroyTextures", "i", "textures", "j", "TexturePool", "GlobalResourceRegistry", "RenderGroup", "Matrix", "InstructionSet", "root", "children", "i", "child", "options", "TexturePool", "cachedParent", "childrenAtDepth", "renderGroupChild", "index", "childrenToUpdate", "renderable", "container", "renderer", "out", "parentCacheAsTexture", "assignWithIgnore", "target", "options", "ignore", "key", "defaultSkew", "ObservablePoint", "defaultPivot", "defaultScale", "defaultOrigin", "UPDATE_COLOR", "UPDATE_BLEND", "UPDATE_VISIBLE", "Container", "_Container", "eventemitter3_default", "options", "uid", "Matrix", "ObservablePoint", "defaultScale", "defaultPivot", "defaultOrigin", "defaultSkew", "assignWithIgnore", "child", "source", "deprecation", "extensions", "value", "children", "v8_0_0", "i", "renderGroup", "index", "point", "parentRenderGroup", "BigPool", "RenderGroup", "RAD_TO_DEG", "DEG_TO_RAD", "warn", "localWidth", "localHeight", "out", "bounds", "height", "size", "rotation", "skew", "opts", "matrix", "localTransformChangeId", "lt", "scale", "pivot", "origin", "position", "sx", "sy", "px", "py", "ox", "oy", "UPDATE_COLOR", "bgr", "Color", "bgr2rgb", "UPDATE_BLEND", "valueNumber", "UPDATE_VISIBLE", "oldChildren", "childrenHelperMixin", "getFastGlobalBoundsMixin", "toLocalGlobalMixin", "onRenderMixin", "measureMixin", "effectsMixin", "findMixin", "sortMixin", "cullingMixin", "cacheAsTextureMixin", "getGlobalMixin", "collectRenderablesMixin", "BrowserAdapter", "width", "height", "canvas", "url", "options", "xml", "currentAdapter", "BrowserAdapter", "DOMAdapter", "adapter", "CanvasSource", "TextureSource", "options", "DOMAdapter", "width", "height", "resolution", "didResize", "resource", "ExtensionType", "BindGroup", "resources", "index", "i", "resource", "keyParts", "currentResource", "tick", "fastCopy", "sourceBuffer", "destinationBuffer", "lengthDouble", "sourceFloat64View", "remainingBytes", "sourceUint8View", "BLEND_TO_NPM", "STENCIL_MODES", "fragTemplate", "generateIfTestSrc", "maxIfs", "src", "i", "checkMaxIfStatementsInShader", "gl", "shader", "fragmentSrc", "BufferUsage", "Buffer", "eventemitter3_default", "options", "data", "size", "usage", "label", "shrinkToFit", "uid", "mappedAtCreation", "value", "BufferUsage", "syncGPU", "oldData", "sizeInBytes", "ensureIsBuffer", "buffer", "index", "Buffer", "usage", "BufferUsage", "getGeometryBounds", "geometry", "attributeId", "bounds", "attribute", "data", "minX", "minY", "maxX", "maxY", "byteSize", "offset", "stride", "i", "x", "y", "ensureIsAttribute", "attribute", "Buffer", "ensureIsBuffer", "Geometry", "eventemitter3_default", "options", "uid", "Bounds", "attributes", "indexBuffer", "topology", "i", "id", "name", "attributeOption", "getGeometryBounds", "destroyBuffers", "buffer", "idCounts", "idHash", "createIdFromString", "value", "groupId", "id", "context", "getTestContext", "DOMAdapter", "maxFragmentPrecision", "getMaxFragmentPrecision", "gl", "getTestContext", "addProgramDefines", "src", "isES300", "isFragment", "ensurePrecision", "src", "options", "isFragment", "maxSupportedPrecision", "precision", "insertVersion", "src", "isES300", "fragmentNameCache", "VertexNameCache", "setProgramName", "src", "name", "isFragment", "nameCache", "stripVersion", "src", "isES300", "processes", "stripVersion", "ensurePrecision", "addProgramDefines", "setProgramName", "insertVersion", "programCache", "_GlProgram", "options", "isES300", "preprocessorOptions", "getMaxFragmentPrecision", "fragment", "vertex", "processKey", "processOptions", "createIdFromString", "key", "GlProgram", "attributeFormatData", "getAttributeInfoFromFormat", "format", "WGSL_TO_VERTEX_TYPES", "extractAttributesFromGpuProgram", "source", "entryPoint", "results", "mainVertStart", "arrowFunctionStart", "functionArgsSubstring", "inputsRegex", "match", "format", "getAttributeInfoFromFormat", "extractStructAndGroups", "wgsl", "linePattern", "groupPattern", "bindingPattern", "namePattern", "typePattern", "structPattern", "structMemberPattern", "structName", "groups", "item", "structs", "struct", "name", "members", "acc", "member", "type", "group", "ShaderStage", "generateGpuLayoutGroups", "groups", "layout", "i", "group", "ShaderStage", "generateLayoutHash", "groups", "layout", "i", "group", "removeStructAndGroupDuplicates", "vertexStructsAndGroups", "fragmentStructsAndGroups", "structNameSet", "dupeGroupKeySet", "structs", "struct", "groups", "group", "key", "programCache", "GpuProgram", "_GpuProgram", "options", "fragment", "vertex", "layout", "gpuLayout", "name", "structsAndGroups", "extractStructAndGroups", "vertexStructsAndGroups", "fragmentStructsAndGroups", "removeStructAndGroupDuplicates", "generateLayoutHash", "generateGpuLayoutGroups", "bigKey", "createIdFromString", "extractAttributesFromGpuProgram", "key", "addBits", "srcParts", "parts", "name", "i", "id", "part", "sanitisedPart", "warn", "findHooksRx", "compileHooks", "programSrc", "parts", "hook", "extractInputs", "fragmentSource", "out", "match", "regex", "compileInputs", "fragments", "template", "sort", "results", "fragment", "mainInput", "finalString", "inValue", "i", "cleanedString", "extractOutputs", "fragmentSource", "out", "match", "regex", "extractVariableName", "value", "stripVariable", "compileOutputs", "fragments", "template", "results", "fragment", "index", "mainStruct", "inValue", "mainStart", "mainEnd", "compiledCode", "injectBits", "templateSrc", "fragmentParts", "out", "i", "parts", "cacheMap", "bitCacheMap", "CACHE_UID", "compileHighShader", "template", "bits", "cacheId", "generateCacheId", "vertex", "fragment", "compileInputsAndOutputs", "compileBits", "compileHighShaderGl", "vertexFragments", "shaderBit", "v", "fragmentFragments", "compiledVertex", "compileInputs", "compileOutputs", "compiledFragment", "highFragment", "a", "b", "vertexParts", "compileHooks", "fragmentParts", "addBits", "injectBits", "vertexGPUTemplate", "fragmentGPUTemplate", "vertexGlTemplate", "fragmentGlTemplate", "globalUniformsBit", "globalUniformsBitGl", "compileHighShaderGpuProgram", "bits", "name", "source", "compileHighShader", "fragmentGPUTemplate", "vertexGPUTemplate", "globalUniformsBit", "GpuProgram", "compileHighShaderGlProgram", "GlProgram", "compileHighShaderGl", "vertexGlTemplate", "fragmentGlTemplate", "globalUniformsBitGl", "colorBit", "colorBitGl", "textureBatchBitGpuCache", "generateBindingSrc", "maxTextures", "src", "bindingIndex", "i", "generateSampleSrc", "generateTextureBatchBit", "textureBatchBitGlCache", "generateSampleGlSrc", "generateTextureBatchBitGl", "roundPixelsBit", "roundPixelsBitGl", "UNIFORM_TYPES_VALUES", "UNIFORM_TYPES_MAP", "acc", "type", "getDefaultUniformValue", "type", "size", "_UniformGroup", "uniformStructures", "options", "uid", "uniforms", "i", "uniformData", "UNIFORM_TYPES_MAP", "arrayMatch", "innerType", "size", "UNIFORM_TYPES_VALUES", "getDefaultUniformValue", "createIdFromString", "UniformGroup", "batchSamplersUniformGroupHash", "getBatchSamplersUniformGroup", "maxTextures", "batchSamplersUniformGroup", "sampleValues", "i", "UniformGroup", "Shader", "_Shader", "eventemitter3_default", "options", "uid", "gpuProgram", "glProgram", "groups", "resources", "compatibleRenderers", "groupMap", "RendererType", "nameHash", "i", "j", "uniformName", "groupData", "data", "bindTick", "BindGroup", "name", "value", "UniformGroup", "groupIndex", "bindIndex", "_a", "_b", "uniformsOut", "destroyPrograms", "bindGroup", "gpu", "gl", "rest", "GpuProgram", "GlProgram", "earcut", "data", "holeIndices", "dim", "hasHoles", "outerLen", "outerNode", "linkedList", "triangles", "minX", "minY", "invSize", "eliminateHoles", "maxX", "maxY", "i", "x", "y", "earcutLinked", "start", "end", "clockwise", "last", "signedArea", "insertNode", "equals", "removeNode", "filterPoints", "p", "again", "area", "ear", "pass", "indexCurve", "stop", "prev", "next", "isEarHashed", "isEar", "cureLocalIntersections", "splitEarcut", "a", "b", "c", "ax", "bx", "cx", "ay", "by", "cy", "x0", "y0", "x1", "y1", "pointInTriangleExceptFirst", "minZ", "zOrder", "maxZ", "n", "intersects", "locallyInside", "isValidDiagonal", "splitPolygon", "queue", "len", "list", "getLeftmost", "compareXYSlope", "eliminateHole", "result", "aSlope", "bSlope", "hole", "bridge", "findHoleBridge", "bridgeReverse", "hx", "hy", "qx", "m", "mx", "my", "tanMin", "pointInTriangle", "tan", "sectorContainsSector", "sortLinked", "numMerges", "inSize", "e", "tail", "q", "pSize", "qSize", "leftmost", "px", "py", "intersectsPolygon", "middleInside", "r", "p1", "p2", "q1", "q2", "o1", "sign", "o2", "o3", "o4", "onSegment", "num", "inside", "a2", "createNode", "b2", "an", "bp", "signedArea", "data", "start", "end", "dim", "sum", "i", "j", "earcut", "blendModeIds", "BLEND", "OFFSET", "CULLING", "DEPTH_TEST", "WINDING", "DEPTH_MASK", "_State", "value", "state", "State", "localUniformBit", "localUniformBitGroup2", "localUniformBitGl", "UPDATE_PRIORITY", "TickerListener", "fn", "context", "priority", "once", "ticker", "redirect", "previous", "hard", "_Ticker", "TickerListener", "time", "fn", "context", "priority", "UPDATE_PRIORITY", "listener", "current", "previous", "count", "currentTime", "elapsedMS", "delta", "head", "fps", "minFPS", "minFPMS", "maxFPS", "shared", "system", "Ticker", "ViewContainer", "Container", "options", "Bounds", "value", "point", "bounds", "x", "y", "renderGroup", "key", "instructionSet", "renderer", "currentLayer", "renderPipes", "children", "length", "i", "updateQuadBounds", "bounds", "anchor", "texture", "width", "height", "trim", "sourceWidth", "sourceHeight", "Sprite", "_Sprite", "ViewContainer", "options", "Texture", "texture", "anchor", "roundPixels", "width", "height", "rest", "ObservablePoint", "source", "skipCache", "value", "currentTexture", "updateQuadBounds", "deprecation", "bounds", "destroyTextureSource", "out", "ViewableBuffer", "sizeOrBuffer", "type", "getAdjustedBlendModeBlend", "blendMode", "textureSource", "BLEND_TO_NPM", "maxTexturesPerBatchCache", "getMaxTexturesPerBatch", "gl", "getTestContext", "checkMaxIfStatementsInShader", "BatchTextureArray", "i", "t", "Batch", "BatchTextureArray", "batchPool", "batchPoolIndex", "GlobalResourceRegistry", "item", "getBatchFromPool", "returnBatchToPool", "batch", "BATCH_TICK", "_Batcher", "options", "uid", "deprecation", "getMaxTexturesPerBatch", "maxTextures", "attributesInitialSize", "indicesInitialSize", "ViewableBuffer", "i", "batchableObject", "texture", "textureId", "attributeBuffer", "instructionSet", "elements", "textureBatch", "firstElement", "blendMode", "getAdjustedBlendModeBlend", "topology", "f32", "u32", "indexBuffer", "size", "start", "action", "element", "source", "adjustedBlendMode", "breakRequired", "indexStart", "indexSize", "newSize", "newArrayBuffer", "fastCopy", "newIndexBuffer", "index", "indicesOffset", "indices", "indexOffset", "attributeOffset", "Batcher", "placeHolderBufferData", "placeHolderIndexData", "BatchGeometry", "Geometry", "attributeBuffer", "Buffer", "BufferUsage", "indexBuffer", "stride", "DefaultShader", "Shader", "maxTextures", "glProgram", "compileHighShaderGlProgram", "colorBitGl", "generateTextureBatchBitGl", "roundPixelsBitGl", "gpuProgram", "compileHighShaderGpuProgram", "colorBit", "generateTextureBatchBit", "roundPixelsBit", "getBatchSamplersUniformGroup", "defaultShader", "_DefaultBatcher", "Batcher", "options", "BatchGeometry", "DefaultShader", "element", "float32View", "uint32View", "index", "textureId", "textureIdAndRound", "wt", "b", "d", "tx", "ty", "positions", "uvs", "argb", "offset", "end", "i", "i2", "x", "y", "texture", "bounds", "w0", "w1", "h0", "h1", "maxTextures", "ExtensionType", "DefaultBatcher", "color32BitToUniform", "abgr", "out", "offset", "alpha", "BatchableSprite", "_Filter", "Shader", "options", "State", "filterManager", "input", "output", "clearMode", "value", "gpu", "gl", "rest", "gpuProgram", "glProgram", "GpuProgram", "GlProgram", "Filter"]
7
+ }