@vpmedia/phaser 1.102.0 → 1.103.0

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 (481) hide show
  1. package/dist/index.d.ts +38 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +20112 -0
  4. package/dist/index.js.map +1 -0
  5. package/{types → dist}/phaser/core/animation.d.ts +41 -83
  6. package/dist/phaser/core/animation.d.ts.map +1 -0
  7. package/{types → dist}/phaser/core/animation_manager.d.ts +37 -55
  8. package/dist/phaser/core/animation_manager.d.ts.map +1 -0
  9. package/dist/phaser/core/animation_parser.d.ts +21 -0
  10. package/dist/phaser/core/animation_parser.d.ts.map +1 -0
  11. package/{types → dist}/phaser/core/array_set.d.ts +13 -13
  12. package/dist/phaser/core/array_set.d.ts.map +1 -0
  13. package/{types → dist}/phaser/core/cache.d.ts +78 -91
  14. package/dist/phaser/core/cache.d.ts.map +1 -0
  15. package/dist/phaser/core/const.d.ts +262 -0
  16. package/dist/phaser/core/const.d.ts.map +1 -0
  17. package/dist/phaser/core/device.d.ts +8 -0
  18. package/dist/phaser/core/device.d.ts.map +1 -0
  19. package/dist/phaser/core/device_util.d.ts +65 -0
  20. package/dist/phaser/core/device_util.d.ts.map +1 -0
  21. package/dist/phaser/core/dom.d.ts +75 -0
  22. package/dist/phaser/core/dom.d.ts.map +1 -0
  23. package/dist/phaser/core/error_code.d.ts +9 -0
  24. package/dist/phaser/core/error_code.d.ts.map +1 -0
  25. package/{types → dist}/phaser/core/event_manager.d.ts +17 -35
  26. package/dist/phaser/core/event_manager.d.ts.map +1 -0
  27. package/{types → dist}/phaser/core/factory.d.ts +9 -15
  28. package/dist/phaser/core/factory.d.ts.map +1 -0
  29. package/{types → dist}/phaser/core/frame.d.ts +7 -28
  30. package/dist/phaser/core/frame.d.ts.map +1 -0
  31. package/{types → dist}/phaser/core/frame_data.d.ts +12 -15
  32. package/dist/phaser/core/frame_data.d.ts.map +1 -0
  33. package/dist/phaser/core/frame_util.d.ts +15 -0
  34. package/dist/phaser/core/frame_util.d.ts.map +1 -0
  35. package/{types → dist}/phaser/core/game.d.ts +7 -74
  36. package/dist/phaser/core/game.d.ts.map +1 -0
  37. package/dist/phaser/core/input.d.ts +160 -0
  38. package/dist/phaser/core/input.d.ts.map +1 -0
  39. package/{types → dist}/phaser/core/input_handler.d.ts +32 -93
  40. package/dist/phaser/core/input_handler.d.ts.map +1 -0
  41. package/dist/phaser/core/input_mouse.d.ts +61 -0
  42. package/dist/phaser/core/input_mouse.d.ts.map +1 -0
  43. package/dist/phaser/core/input_mspointer.d.ts +51 -0
  44. package/dist/phaser/core/input_mspointer.d.ts.map +1 -0
  45. package/dist/phaser/core/input_pointer.d.ts +106 -0
  46. package/dist/phaser/core/input_pointer.d.ts.map +1 -0
  47. package/dist/phaser/core/input_touch.d.ts +55 -0
  48. package/dist/phaser/core/input_touch.d.ts.map +1 -0
  49. package/{types → dist}/phaser/core/loader.d.ts +39 -78
  50. package/dist/phaser/core/loader.d.ts.map +1 -0
  51. package/dist/phaser/core/loader_parser.d.ts +35 -0
  52. package/dist/phaser/core/loader_parser.d.ts.map +1 -0
  53. package/{types → dist}/phaser/core/raf.d.ts +5 -5
  54. package/dist/phaser/core/raf.d.ts.map +1 -0
  55. package/{types → dist}/phaser/core/scale_manager.d.ts +41 -124
  56. package/dist/phaser/core/scale_manager.d.ts.map +1 -0
  57. package/{types → dist}/phaser/core/scene.d.ts +6 -4
  58. package/dist/phaser/core/scene.d.ts.map +1 -0
  59. package/{types → dist}/phaser/core/scene_manager.d.ts +12 -29
  60. package/dist/phaser/core/scene_manager.d.ts.map +1 -0
  61. package/{types → dist}/phaser/core/signal.d.ts +21 -17
  62. package/dist/phaser/core/signal.d.ts.map +1 -0
  63. package/{types → dist}/phaser/core/signal_binding.d.ts +15 -15
  64. package/dist/phaser/core/signal_binding.d.ts.map +1 -0
  65. package/{types → dist}/phaser/core/sound.d.ts +22 -75
  66. package/dist/phaser/core/sound.d.ts.map +1 -0
  67. package/{types → dist}/phaser/core/sound_manager.d.ts +20 -43
  68. package/dist/phaser/core/sound_manager.d.ts.map +1 -0
  69. package/dist/phaser/core/sound_sprite.d.ts +27 -0
  70. package/dist/phaser/core/sound_sprite.d.ts.map +1 -0
  71. package/{types → dist}/phaser/core/stage.d.ts +29 -17
  72. package/dist/phaser/core/stage.d.ts.map +1 -0
  73. package/{types → dist}/phaser/core/time.d.ts +12 -64
  74. package/dist/phaser/core/time.d.ts.map +1 -0
  75. package/{types → dist}/phaser/core/timer.d.ts +14 -54
  76. package/dist/phaser/core/timer.d.ts.map +1 -0
  77. package/{types → dist}/phaser/core/timer_event.d.ts +2 -11
  78. package/dist/phaser/core/timer_event.d.ts.map +1 -0
  79. package/{types → dist}/phaser/core/tween.d.ts +21 -62
  80. package/dist/phaser/core/tween.d.ts.map +1 -0
  81. package/{types → dist}/phaser/core/tween_data.d.ts +9 -35
  82. package/dist/phaser/core/tween_data.d.ts.map +1 -0
  83. package/dist/phaser/core/tween_easing.d.ts +187 -0
  84. package/dist/phaser/core/tween_easing.d.ts.map +1 -0
  85. package/{types → dist}/phaser/core/tween_manager.d.ts +9 -18
  86. package/dist/phaser/core/tween_manager.d.ts.map +1 -0
  87. package/{types → dist}/phaser/core/world.d.ts +3 -3
  88. package/dist/phaser/core/world.d.ts.map +1 -0
  89. package/{types → dist}/phaser/display/bitmap_text.d.ts +52 -71
  90. package/dist/phaser/display/bitmap_text.d.ts.map +1 -0
  91. package/{types → dist}/phaser/display/button.d.ts +25 -37
  92. package/dist/phaser/display/button.d.ts.map +1 -0
  93. package/{types → dist}/phaser/display/canvas/buffer.d.ts +3 -7
  94. package/dist/phaser/display/canvas/buffer.d.ts.map +1 -0
  95. package/dist/phaser/display/canvas/graphics.d.ts +18 -0
  96. package/dist/phaser/display/canvas/graphics.d.ts.map +1 -0
  97. package/dist/phaser/display/canvas/masker.d.ts +12 -0
  98. package/dist/phaser/display/canvas/masker.d.ts.map +1 -0
  99. package/dist/phaser/display/canvas/pool.d.ts +40 -0
  100. package/dist/phaser/display/canvas/pool.d.ts.map +1 -0
  101. package/{types → dist}/phaser/display/canvas/renderer.d.ts +6 -28
  102. package/dist/phaser/display/canvas/renderer.d.ts.map +1 -0
  103. package/dist/phaser/display/canvas/tinter.d.ts +41 -0
  104. package/dist/phaser/display/canvas/tinter.d.ts.map +1 -0
  105. package/dist/phaser/display/canvas/util.d.ts +70 -0
  106. package/dist/phaser/display/canvas/util.d.ts.map +1 -0
  107. package/{types → dist}/phaser/display/display_object.d.ts +63 -124
  108. package/dist/phaser/display/display_object.d.ts.map +1 -0
  109. package/{types → dist}/phaser/display/graphics.d.ts +59 -65
  110. package/dist/phaser/display/graphics.d.ts.map +1 -0
  111. package/{types → dist}/phaser/display/graphics_data.d.ts +2 -12
  112. package/dist/phaser/display/graphics_data.d.ts.map +1 -0
  113. package/dist/phaser/display/graphics_data_util.d.ts +8 -0
  114. package/dist/phaser/display/graphics_data_util.d.ts.map +1 -0
  115. package/{types → dist}/phaser/display/group.d.ts +27 -45
  116. package/dist/phaser/display/group.d.ts.map +1 -0
  117. package/{types → dist}/phaser/display/image.d.ts +54 -53
  118. package/dist/phaser/display/image.d.ts.map +1 -0
  119. package/dist/phaser/display/sprite_batch.d.ts +9 -0
  120. package/dist/phaser/display/sprite_batch.d.ts.map +1 -0
  121. package/dist/phaser/display/sprite_util.d.ts +35 -0
  122. package/dist/phaser/display/sprite_util.d.ts.map +1 -0
  123. package/{types → dist}/phaser/display/text.d.ts +176 -181
  124. package/dist/phaser/display/text.d.ts.map +1 -0
  125. package/{types → dist}/phaser/display/webgl/abstract_filter.d.ts +2 -8
  126. package/dist/phaser/display/webgl/abstract_filter.d.ts.map +1 -0
  127. package/{types → dist}/phaser/display/webgl/base_texture.d.ts +3 -15
  128. package/dist/phaser/display/webgl/base_texture.d.ts.map +1 -0
  129. package/{types → dist}/phaser/display/webgl/blend_manager.d.ts +7 -5
  130. package/dist/phaser/display/webgl/blend_manager.d.ts.map +1 -0
  131. package/{types → dist}/phaser/display/webgl/earcut.d.ts +28 -27
  132. package/dist/phaser/display/webgl/earcut.d.ts.map +1 -0
  133. package/{types → dist}/phaser/display/webgl/earcut_node.d.ts +11 -11
  134. package/dist/phaser/display/webgl/earcut_node.d.ts.map +1 -0
  135. package/{types → dist}/phaser/display/webgl/fast_sprite_batch.d.ts +6 -28
  136. package/dist/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -0
  137. package/{types → dist}/phaser/display/webgl/filter_manager.d.ts +6 -7
  138. package/dist/phaser/display/webgl/filter_manager.d.ts.map +1 -0
  139. package/{types → dist}/phaser/display/webgl/filter_texture.d.ts +3 -9
  140. package/dist/phaser/display/webgl/filter_texture.d.ts.map +1 -0
  141. package/dist/phaser/display/webgl/graphics.d.ts +78 -0
  142. package/dist/phaser/display/webgl/graphics.d.ts.map +1 -0
  143. package/dist/phaser/display/webgl/graphics_data.d.ts +16 -0
  144. package/dist/phaser/display/webgl/graphics_data.d.ts.map +1 -0
  145. package/dist/phaser/display/webgl/mask_manager.d.ts +13 -0
  146. package/dist/phaser/display/webgl/mask_manager.d.ts.map +1 -0
  147. package/{types → dist}/phaser/display/webgl/render_texture.d.ts +5 -13
  148. package/dist/phaser/display/webgl/render_texture.d.ts.map +1 -0
  149. package/dist/phaser/display/webgl/renderer.d.ts +51 -0
  150. package/dist/phaser/display/webgl/renderer.d.ts.map +1 -0
  151. package/dist/phaser/display/webgl/shader/complex.d.ts +16 -0
  152. package/dist/phaser/display/webgl/shader/complex.d.ts.map +1 -0
  153. package/dist/phaser/display/webgl/shader/fast.d.ts +16 -0
  154. package/dist/phaser/display/webgl/shader/fast.d.ts.map +1 -0
  155. package/dist/phaser/display/webgl/shader/normal.d.ts +29 -0
  156. package/dist/phaser/display/webgl/shader/normal.d.ts.map +1 -0
  157. package/dist/phaser/display/webgl/shader/primitive.d.ts +16 -0
  158. package/dist/phaser/display/webgl/shader/primitive.d.ts.map +1 -0
  159. package/dist/phaser/display/webgl/shader/strip.d.ts +16 -0
  160. package/dist/phaser/display/webgl/shader/strip.d.ts.map +1 -0
  161. package/dist/phaser/display/webgl/shader_manager.d.ts +27 -0
  162. package/dist/phaser/display/webgl/shader_manager.d.ts.map +1 -0
  163. package/{types → dist}/phaser/display/webgl/sprite_batch.d.ts +9 -32
  164. package/dist/phaser/display/webgl/sprite_batch.d.ts.map +1 -0
  165. package/{types → dist}/phaser/display/webgl/stencil_manager.d.ts +9 -9
  166. package/dist/phaser/display/webgl/stencil_manager.d.ts.map +1 -0
  167. package/dist/phaser/display/webgl/texture.d.ts +36 -0
  168. package/dist/phaser/display/webgl/texture.d.ts.map +1 -0
  169. package/dist/phaser/display/webgl/texture_util.d.ts +17 -0
  170. package/dist/phaser/display/webgl/texture_util.d.ts.map +1 -0
  171. package/dist/phaser/display/webgl/util.d.ts +54 -0
  172. package/dist/phaser/display/webgl/util.d.ts.map +1 -0
  173. package/{types → dist}/phaser/geom/circle.d.ts +35 -41
  174. package/dist/phaser/geom/circle.d.ts.map +1 -0
  175. package/{types → dist}/phaser/geom/ellipse.d.ts +12 -18
  176. package/dist/phaser/geom/ellipse.d.ts.map +1 -0
  177. package/{types → dist}/phaser/geom/line.d.ts +20 -23
  178. package/dist/phaser/geom/line.d.ts.map +1 -0
  179. package/{types → dist}/phaser/geom/matrix.d.ts +21 -29
  180. package/dist/phaser/geom/matrix.d.ts.map +1 -0
  181. package/{types → dist}/phaser/geom/point.d.ts +30 -33
  182. package/dist/phaser/geom/point.d.ts.map +1 -0
  183. package/{types → dist}/phaser/geom/polygon.d.ts +18 -24
  184. package/dist/phaser/geom/polygon.d.ts.map +1 -0
  185. package/{types → dist}/phaser/geom/rectangle.d.ts +74 -79
  186. package/dist/phaser/geom/rectangle.d.ts.map +1 -0
  187. package/{types → dist}/phaser/geom/rounded_rectangle.d.ts +9 -9
  188. package/dist/phaser/geom/rounded_rectangle.d.ts.map +1 -0
  189. package/dist/phaser/geom/util/circle.d.ts +55 -0
  190. package/dist/phaser/geom/util/circle.d.ts.map +1 -0
  191. package/dist/phaser/geom/util/ellipse.d.ts +9 -0
  192. package/dist/phaser/geom/util/ellipse.d.ts.map +1 -0
  193. package/dist/phaser/geom/util/line.d.ts +42 -0
  194. package/dist/phaser/geom/util/line.d.ts.map +1 -0
  195. package/dist/phaser/geom/util/matrix.d.ts +18 -0
  196. package/dist/phaser/geom/util/matrix.d.ts.map +1 -0
  197. package/dist/phaser/geom/util/point.d.ts +159 -0
  198. package/dist/phaser/geom/util/point.d.ts.map +1 -0
  199. package/dist/phaser/geom/util/polygon.d.ts +8 -0
  200. package/dist/phaser/geom/util/polygon.d.ts.map +1 -0
  201. package/dist/phaser/geom/util/rectangle.d.ts +123 -0
  202. package/dist/phaser/geom/util/rectangle.d.ts.map +1 -0
  203. package/dist/phaser/geom/util/rounded_rectangle.d.ts +8 -0
  204. package/dist/phaser/geom/util/rounded_rectangle.d.ts.map +1 -0
  205. package/dist/phaser/util/math.d.ts +154 -0
  206. package/dist/phaser/util/math.d.ts.map +1 -0
  207. package/package.json +25 -11
  208. package/src/phaser/core/{animation.js → animation.ts} +2 -1
  209. package/src/phaser/core/{animation_manager.js → animation_manager.ts} +2 -1
  210. package/src/phaser/core/{array_set.js → array_set.ts} +4 -1
  211. package/src/phaser/core/{cache.js → cache.ts} +2 -1
  212. package/src/phaser/core/{device.js → device.ts} +2 -1
  213. package/src/phaser/core/{dom.js → dom.ts} +7 -0
  214. package/src/phaser/core/{event_manager.js → event_manager.ts} +2 -1
  215. package/src/phaser/core/{factory.js → factory.ts} +1 -0
  216. package/src/phaser/core/{frame.js → frame.ts} +2 -1
  217. package/src/phaser/core/{frame_data.js → frame_data.ts} +2 -1
  218. package/src/phaser/core/{frame_util.js → frame_util.ts} +2 -1
  219. package/src/phaser/core/{game.js → game.ts} +1 -0
  220. package/src/phaser/core/{input.js → input.ts} +1 -0
  221. package/src/phaser/core/{input_handler.js → input_handler.ts} +1 -0
  222. package/src/phaser/core/{input_mouse.js → input_mouse.ts} +1 -0
  223. package/src/phaser/core/{input_mspointer.js → input_mspointer.ts} +1 -0
  224. package/src/phaser/core/{input_pointer.js → input_pointer.ts} +1 -0
  225. package/src/phaser/core/{input_touch.js → input_touch.ts} +1 -0
  226. package/src/phaser/core/{loader.js → loader.ts} +2 -1
  227. package/src/phaser/core/{loader_parser.js → loader_parser.ts} +2 -1
  228. package/src/phaser/core/{raf.js → raf.ts} +3 -0
  229. package/src/phaser/core/{scale_manager.js → scale_manager.ts} +1 -0
  230. package/src/phaser/core/{scene.js → scene.ts} +1 -0
  231. package/src/phaser/core/{scene_manager.js → scene_manager.ts} +1 -0
  232. package/src/phaser/core/{signal.js → signal.ts} +7 -0
  233. package/src/phaser/core/{signal_binding.js → signal_binding.ts} +10 -0
  234. package/src/phaser/core/{sound.js → sound.ts} +2 -1
  235. package/src/phaser/core/{sound_manager.js → sound_manager.ts} +2 -1
  236. package/src/phaser/core/{sound_sprite.js → sound_sprite.ts} +2 -1
  237. package/src/phaser/core/{stage.js → stage.ts} +1 -0
  238. package/src/phaser/core/{time.js → time.ts} +2 -1
  239. package/src/phaser/core/{timer.js → timer.ts} +2 -1
  240. package/src/phaser/core/{timer_event.js → timer_event.ts} +2 -1
  241. package/src/phaser/core/{tween.js → tween.ts} +2 -1
  242. package/src/phaser/core/{tween_data.js → tween_data.ts} +2 -1
  243. package/src/phaser/core/{tween_manager.js → tween_manager.ts} +2 -1
  244. package/src/phaser/core/{world.js → world.ts} +1 -0
  245. package/src/phaser/display/{bitmap_text.js → bitmap_text.ts} +1 -0
  246. package/src/phaser/display/{button.js → button.ts} +1 -0
  247. package/src/phaser/display/canvas/{buffer.js → buffer.ts} +1 -0
  248. package/src/phaser/display/canvas/{graphics.js → graphics.ts} +1 -0
  249. package/src/phaser/display/canvas/{masker.js → masker.ts} +1 -0
  250. package/src/phaser/display/canvas/{pool.js → pool.ts} +1 -0
  251. package/src/phaser/display/canvas/{renderer.js → renderer.ts} +1 -0
  252. package/src/phaser/display/canvas/{tinter.js → tinter.ts} +1 -0
  253. package/src/phaser/display/{display_object.js → display_object.ts} +1 -0
  254. package/src/phaser/display/{graphics.js → graphics.ts} +1 -0
  255. package/src/phaser/display/{graphics_data.js → graphics_data.ts} +1 -0
  256. package/src/phaser/display/{graphics_data_util.js → graphics_data_util.ts} +1 -0
  257. package/src/phaser/display/{group.js → group.ts} +1 -0
  258. package/src/phaser/display/{image.js → image.ts} +1 -0
  259. package/src/phaser/display/{sprite_batch.js → sprite_batch.ts} +1 -0
  260. package/src/phaser/display/{sprite_util.js → sprite_util.ts} +1 -0
  261. package/src/phaser/display/{text.js → text.ts} +1 -0
  262. package/src/phaser/display/webgl/{abstract_filter.js → abstract_filter.ts} +1 -0
  263. package/src/phaser/display/webgl/{base_texture.js → base_texture.ts} +1 -0
  264. package/src/phaser/display/webgl/{blend_manager.js → blend_manager.ts} +1 -0
  265. package/src/phaser/display/webgl/{earcut.js → earcut.ts} +2 -2
  266. package/src/phaser/display/webgl/{earcut_node.js → earcut_node.ts} +10 -0
  267. package/src/phaser/display/webgl/{fast_sprite_batch.js → fast_sprite_batch.ts} +1 -0
  268. package/src/phaser/display/webgl/{filter_manager.js → filter_manager.ts} +1 -0
  269. package/src/phaser/display/webgl/{filter_texture.js → filter_texture.ts} +1 -0
  270. package/src/phaser/display/webgl/{graphics.js → graphics.ts} +1 -0
  271. package/src/phaser/display/webgl/{graphics_data.js → graphics_data.ts} +1 -0
  272. package/src/phaser/display/webgl/{mask_manager.js → mask_manager.ts} +1 -0
  273. package/src/phaser/display/webgl/{render_texture.js → render_texture.ts} +1 -0
  274. package/src/phaser/display/webgl/{renderer.js → renderer.ts} +1 -0
  275. package/src/phaser/display/webgl/shader/{complex.js → complex.ts} +1 -0
  276. package/src/phaser/display/webgl/shader/{fast.js → fast.ts} +1 -0
  277. package/src/phaser/display/webgl/shader/{normal.js → normal.ts} +1 -0
  278. package/src/phaser/display/webgl/shader/{primitive.js → primitive.ts} +1 -0
  279. package/src/phaser/display/webgl/shader/{strip.js → strip.ts} +1 -0
  280. package/src/phaser/display/webgl/{shader_manager.js → shader_manager.ts} +1 -0
  281. package/src/phaser/display/webgl/{sprite_batch.js → sprite_batch.ts} +1 -0
  282. package/src/phaser/display/webgl/{stencil_manager.js → stencil_manager.ts} +1 -0
  283. package/src/phaser/display/webgl/{texture.js → texture.ts} +1 -0
  284. package/src/phaser/display/webgl/{texture_util.js → texture_util.ts} +1 -0
  285. package/src/phaser/geom/{circle.js → circle.ts} +7 -1
  286. package/src/phaser/geom/{ellipse.js → ellipse.ts} +6 -0
  287. package/src/phaser/geom/{line.js → line.ts} +4 -0
  288. package/src/phaser/geom/{matrix.js → matrix.ts} +8 -0
  289. package/src/phaser/geom/{point.js → point.ts} +5 -1
  290. package/src/phaser/geom/{polygon.js → polygon.ts} +6 -0
  291. package/src/phaser/geom/{rectangle.js → rectangle.ts} +10 -4
  292. package/src/phaser/geom/{rounded_rectangle.js → rounded_rectangle.ts} +7 -0
  293. package/.vscode/extensions.json +0 -6
  294. package/.vscode/settings.json +0 -27
  295. package/AGENTS.md +0 -1
  296. package/CHANGELOG.md +0 -336
  297. package/CLAUDE.md +0 -1
  298. package/SECURITY.md +0 -5
  299. package/typedefs/global.d.ts +0 -7
  300. package/types/index.d.ts +0 -38
  301. package/types/index.d.ts.map +0 -1
  302. package/types/phaser/core/animation.d.ts.map +0 -1
  303. package/types/phaser/core/animation_manager.d.ts.map +0 -1
  304. package/types/phaser/core/animation_parser.d.ts +0 -4
  305. package/types/phaser/core/animation_parser.d.ts.map +0 -1
  306. package/types/phaser/core/array_set.d.ts.map +0 -1
  307. package/types/phaser/core/cache.d.ts.map +0 -1
  308. package/types/phaser/core/const.d.ts +0 -262
  309. package/types/phaser/core/const.d.ts.map +0 -1
  310. package/types/phaser/core/device.d.ts +0 -96
  311. package/types/phaser/core/device.d.ts.map +0 -1
  312. package/types/phaser/core/device_util.d.ts +0 -13
  313. package/types/phaser/core/device_util.d.ts.map +0 -1
  314. package/types/phaser/core/dom.d.ts +0 -180
  315. package/types/phaser/core/dom.d.ts.map +0 -1
  316. package/types/phaser/core/error_code.d.ts +0 -9
  317. package/types/phaser/core/error_code.d.ts.map +0 -1
  318. package/types/phaser/core/event_manager.d.ts.map +0 -1
  319. package/types/phaser/core/factory.d.ts.map +0 -1
  320. package/types/phaser/core/frame.d.ts.map +0 -1
  321. package/types/phaser/core/frame_data.d.ts.map +0 -1
  322. package/types/phaser/core/frame_util.d.ts +0 -5
  323. package/types/phaser/core/frame_util.d.ts.map +0 -1
  324. package/types/phaser/core/game.d.ts.map +0 -1
  325. package/types/phaser/core/input.d.ts +0 -219
  326. package/types/phaser/core/input.d.ts.map +0 -1
  327. package/types/phaser/core/input_handler.d.ts.map +0 -1
  328. package/types/phaser/core/input_mouse.d.ts +0 -86
  329. package/types/phaser/core/input_mouse.d.ts.map +0 -1
  330. package/types/phaser/core/input_mspointer.d.ts +0 -67
  331. package/types/phaser/core/input_mspointer.d.ts.map +0 -1
  332. package/types/phaser/core/input_pointer.d.ts +0 -170
  333. package/types/phaser/core/input_pointer.d.ts.map +0 -1
  334. package/types/phaser/core/input_touch.d.ts +0 -73
  335. package/types/phaser/core/input_touch.d.ts.map +0 -1
  336. package/types/phaser/core/loader.d.ts.map +0 -1
  337. package/types/phaser/core/loader_parser.d.ts +0 -5
  338. package/types/phaser/core/loader_parser.d.ts.map +0 -1
  339. package/types/phaser/core/raf.d.ts.map +0 -1
  340. package/types/phaser/core/scale_manager.d.ts.map +0 -1
  341. package/types/phaser/core/scene.d.ts.map +0 -1
  342. package/types/phaser/core/scene_manager.d.ts.map +0 -1
  343. package/types/phaser/core/signal.d.ts.map +0 -1
  344. package/types/phaser/core/signal_binding.d.ts.map +0 -1
  345. package/types/phaser/core/sound.d.ts.map +0 -1
  346. package/types/phaser/core/sound_manager.d.ts.map +0 -1
  347. package/types/phaser/core/sound_sprite.d.ts +0 -36
  348. package/types/phaser/core/sound_sprite.d.ts.map +0 -1
  349. package/types/phaser/core/stage.d.ts.map +0 -1
  350. package/types/phaser/core/time.d.ts.map +0 -1
  351. package/types/phaser/core/timer.d.ts.map +0 -1
  352. package/types/phaser/core/timer_event.d.ts.map +0 -1
  353. package/types/phaser/core/tween.d.ts.map +0 -1
  354. package/types/phaser/core/tween_data.d.ts.map +0 -1
  355. package/types/phaser/core/tween_easing.d.ts +0 -32
  356. package/types/phaser/core/tween_easing.d.ts.map +0 -1
  357. package/types/phaser/core/tween_manager.d.ts.map +0 -1
  358. package/types/phaser/core/world.d.ts.map +0 -1
  359. package/types/phaser/display/bitmap_text.d.ts.map +0 -1
  360. package/types/phaser/display/button.d.ts.map +0 -1
  361. package/types/phaser/display/canvas/buffer.d.ts.map +0 -1
  362. package/types/phaser/display/canvas/graphics.d.ts +0 -4
  363. package/types/phaser/display/canvas/graphics.d.ts.map +0 -1
  364. package/types/phaser/display/canvas/masker.d.ts +0 -3
  365. package/types/phaser/display/canvas/masker.d.ts.map +0 -1
  366. package/types/phaser/display/canvas/pool.d.ts +0 -11
  367. package/types/phaser/display/canvas/pool.d.ts.map +0 -1
  368. package/types/phaser/display/canvas/renderer.d.ts.map +0 -1
  369. package/types/phaser/display/canvas/tinter.d.ts +0 -7
  370. package/types/phaser/display/canvas/tinter.d.ts.map +0 -1
  371. package/types/phaser/display/canvas/util.d.ts +0 -10
  372. package/types/phaser/display/canvas/util.d.ts.map +0 -1
  373. package/types/phaser/display/display_object.d.ts.map +0 -1
  374. package/types/phaser/display/graphics.d.ts.map +0 -1
  375. package/types/phaser/display/graphics_data.d.ts.map +0 -1
  376. package/types/phaser/display/graphics_data_util.d.ts +0 -3
  377. package/types/phaser/display/graphics_data_util.d.ts.map +0 -1
  378. package/types/phaser/display/group.d.ts.map +0 -1
  379. package/types/phaser/display/image.d.ts.map +0 -1
  380. package/types/phaser/display/sprite_batch.d.ts +0 -4
  381. package/types/phaser/display/sprite_batch.d.ts.map +0 -1
  382. package/types/phaser/display/sprite_util.d.ts +0 -6
  383. package/types/phaser/display/sprite_util.d.ts.map +0 -1
  384. package/types/phaser/display/text.d.ts.map +0 -1
  385. package/types/phaser/display/webgl/abstract_filter.d.ts.map +0 -1
  386. package/types/phaser/display/webgl/base_texture.d.ts.map +0 -1
  387. package/types/phaser/display/webgl/blend_manager.d.ts.map +0 -1
  388. package/types/phaser/display/webgl/earcut.d.ts.map +0 -1
  389. package/types/phaser/display/webgl/earcut_node.d.ts.map +0 -1
  390. package/types/phaser/display/webgl/fast_sprite_batch.d.ts.map +0 -1
  391. package/types/phaser/display/webgl/filter_manager.d.ts.map +0 -1
  392. package/types/phaser/display/webgl/filter_texture.d.ts.map +0 -1
  393. package/types/phaser/display/webgl/graphics.d.ts +0 -16
  394. package/types/phaser/display/webgl/graphics.d.ts.map +0 -1
  395. package/types/phaser/display/webgl/graphics_data.d.ts +0 -27
  396. package/types/phaser/display/webgl/graphics_data.d.ts.map +0 -1
  397. package/types/phaser/display/webgl/mask_manager.d.ts +0 -3
  398. package/types/phaser/display/webgl/mask_manager.d.ts.map +0 -1
  399. package/types/phaser/display/webgl/render_texture.d.ts.map +0 -1
  400. package/types/phaser/display/webgl/renderer.d.ts +0 -87
  401. package/types/phaser/display/webgl/renderer.d.ts.map +0 -1
  402. package/types/phaser/display/webgl/shader/complex.d.ts +0 -33
  403. package/types/phaser/display/webgl/shader/complex.d.ts.map +0 -1
  404. package/types/phaser/display/webgl/shader/fast.d.ts +0 -36
  405. package/types/phaser/display/webgl/shader/fast.d.ts.map +0 -1
  406. package/types/phaser/display/webgl/shader/normal.d.ts +0 -52
  407. package/types/phaser/display/webgl/shader/normal.d.ts.map +0 -1
  408. package/types/phaser/display/webgl/shader/primitive.d.ts +0 -32
  409. package/types/phaser/display/webgl/shader/primitive.d.ts.map +0 -1
  410. package/types/phaser/display/webgl/shader/strip.d.ts +0 -33
  411. package/types/phaser/display/webgl/shader/strip.d.ts.map +0 -1
  412. package/types/phaser/display/webgl/shader_manager.d.ts +0 -44
  413. package/types/phaser/display/webgl/shader_manager.d.ts.map +0 -1
  414. package/types/phaser/display/webgl/sprite_batch.d.ts.map +0 -1
  415. package/types/phaser/display/webgl/stencil_manager.d.ts.map +0 -1
  416. package/types/phaser/display/webgl/texture.d.ts +0 -63
  417. package/types/phaser/display/webgl/texture.d.ts.map +0 -1
  418. package/types/phaser/display/webgl/texture_util.d.ts +0 -5
  419. package/types/phaser/display/webgl/texture_util.d.ts.map +0 -1
  420. package/types/phaser/display/webgl/util.d.ts +0 -15
  421. package/types/phaser/display/webgl/util.d.ts.map +0 -1
  422. package/types/phaser/geom/circle.d.ts.map +0 -1
  423. package/types/phaser/geom/ellipse.d.ts.map +0 -1
  424. package/types/phaser/geom/line.d.ts.map +0 -1
  425. package/types/phaser/geom/matrix.d.ts.map +0 -1
  426. package/types/phaser/geom/point.d.ts.map +0 -1
  427. package/types/phaser/geom/polygon.d.ts.map +0 -1
  428. package/types/phaser/geom/rectangle.d.ts.map +0 -1
  429. package/types/phaser/geom/rounded_rectangle.d.ts.map +0 -1
  430. package/types/phaser/geom/util/circle.d.ts +0 -10
  431. package/types/phaser/geom/util/circle.d.ts.map +0 -1
  432. package/types/phaser/geom/util/ellipse.d.ts +0 -2
  433. package/types/phaser/geom/util/ellipse.d.ts.map +0 -1
  434. package/types/phaser/geom/util/line.d.ts +0 -8
  435. package/types/phaser/geom/util/line.d.ts.map +0 -1
  436. package/types/phaser/geom/util/matrix.d.ts +0 -5
  437. package/types/phaser/geom/util/matrix.d.ts.map +0 -1
  438. package/types/phaser/geom/util/point.d.ts +0 -22
  439. package/types/phaser/geom/util/point.d.ts.map +0 -1
  440. package/types/phaser/geom/util/polygon.d.ts +0 -3
  441. package/types/phaser/geom/util/polygon.d.ts.map +0 -1
  442. package/types/phaser/geom/util/rectangle.d.ts +0 -19
  443. package/types/phaser/geom/util/rectangle.d.ts.map +0 -1
  444. package/types/phaser/geom/util/rounded_rectangle.d.ts +0 -3
  445. package/types/phaser/geom/util/rounded_rectangle.d.ts.map +0 -1
  446. package/types/phaser/util/math.d.ts +0 -58
  447. package/types/phaser/util/math.d.ts.map +0 -1
  448. /package/src/{index.js → index.ts} +0 -0
  449. /package/src/phaser/core/{animation_parser.js → animation_parser.ts} +0 -0
  450. /package/src/phaser/core/{const.js → const.ts} +0 -0
  451. /package/src/phaser/core/{device_util.js → device_util.ts} +0 -0
  452. /package/src/phaser/core/{error_code.js → error_code.ts} +0 -0
  453. /package/src/phaser/core/{signal.test.js → signal.test.ts} +0 -0
  454. /package/src/phaser/core/{tween_easing.js → tween_easing.ts} +0 -0
  455. /package/src/phaser/display/canvas/{util.js → util.ts} +0 -0
  456. /package/src/phaser/display/webgl/{util.js → util.ts} +0 -0
  457. /package/src/phaser/geom/{circle.test.js → circle.test.ts} +0 -0
  458. /package/src/phaser/geom/{ellipse.test.js → ellipse.test.ts} +0 -0
  459. /package/src/phaser/geom/{line.test.js → line.test.ts} +0 -0
  460. /package/src/phaser/geom/{matrix.test.js → matrix.test.ts} +0 -0
  461. /package/src/phaser/geom/{point.test.js → point.test.ts} +0 -0
  462. /package/src/phaser/geom/{rectangle.test.js → rectangle.test.ts} +0 -0
  463. /package/src/phaser/geom/{rounded_rectangle.test.js → rounded_rectangle.test.ts} +0 -0
  464. /package/src/phaser/geom/util/{circle.test.js → circle.test.ts} +0 -0
  465. /package/src/phaser/geom/util/{circle.js → circle.ts} +0 -0
  466. /package/src/phaser/geom/util/{ellipse.test.js → ellipse.test.ts} +0 -0
  467. /package/src/phaser/geom/util/{ellipse.js → ellipse.ts} +0 -0
  468. /package/src/phaser/geom/util/{line.test.js → line.test.ts} +0 -0
  469. /package/src/phaser/geom/util/{line.js → line.ts} +0 -0
  470. /package/src/phaser/geom/util/{matrix.test.js → matrix.test.ts} +0 -0
  471. /package/src/phaser/geom/util/{matrix.js → matrix.ts} +0 -0
  472. /package/src/phaser/geom/util/{point.test.js → point.test.ts} +0 -0
  473. /package/src/phaser/geom/util/{point.js → point.ts} +0 -0
  474. /package/src/phaser/geom/util/{polygon.test.js → polygon.test.ts} +0 -0
  475. /package/src/phaser/geom/util/{polygon.js → polygon.ts} +0 -0
  476. /package/src/phaser/geom/util/{rectangle.test.js → rectangle.test.ts} +0 -0
  477. /package/src/phaser/geom/util/{rectangle.js → rectangle.ts} +0 -0
  478. /package/src/phaser/geom/util/{rounded_rectangle.test.js → rounded_rectangle.test.ts} +0 -0
  479. /package/src/phaser/geom/util/{rounded_rectangle.js → rounded_rectangle.ts} +0 -0
  480. /package/src/phaser/util/{math.test.js → math.test.ts} +0 -0
  481. /package/src/phaser/util/{math.js → math.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["IMAGE","TEXT","RENDER_TEXTURE","distance","clone","clone","distance","clone","clone","clone","contains","equals","intersects","clone","contains","equals","intersects","create","create","Image","clone","Image","Image","clone","contains","clone","contains","clone","clone","clone","clone","create","renderGraphics","clone","GraphicsData","GraphicsData","clone","Image","GraphicsData","Image","Image","create","Image","pushMask","popMask","createCanvas","CanvasMaskManager","uuidv4","uuidv4","uuidv4","uuidv4","uuidv4","WebGLMaskManager","create","Image","MathUtils.linearInterpolation","MathUtils","MathUtils"],"sources":["../src/phaser/core/const.ts","../src/phaser/geom/util/point.ts","../src/phaser/geom/point.ts","../src/phaser/geom/util/matrix.ts","../src/phaser/geom/matrix.ts","../src/phaser/geom/util/rectangle.ts","../src/phaser/geom/rectangle.ts","../src/phaser/util/math.ts","../src/phaser/core/error_code.ts","../src/phaser/display/canvas/pool.ts","../src/phaser/display/canvas/tinter.ts","../src/phaser/display/sprite_util.ts","../src/phaser/display/display_object.ts","../src/phaser/core/signal_binding.ts","../src/phaser/core/signal.ts","../src/phaser/core/animation.ts","../src/phaser/core/animation_manager.ts","../src/phaser/core/event_manager.ts","../src/phaser/display/webgl/texture.ts","../src/phaser/display/image.ts","../src/phaser/display/bitmap_text.ts","../src/phaser/core/input_handler.ts","../src/phaser/display/button.ts","../src/phaser/geom/util/circle.ts","../src/phaser/geom/circle.ts","../src/phaser/geom/util/ellipse.ts","../src/phaser/geom/ellipse.ts","../src/phaser/geom/util/polygon.ts","../src/phaser/geom/polygon.ts","../src/phaser/geom/util/rounded_rectangle.ts","../src/phaser/geom/rounded_rectangle.ts","../src/phaser/display/canvas/buffer.ts","../src/phaser/display/canvas/graphics.ts","../src/phaser/display/graphics_data_util.ts","../src/phaser/display/graphics_data.ts","../src/phaser/display/webgl/earcut_node.ts","../src/phaser/display/webgl/earcut.ts","../src/phaser/display/webgl/graphics_data.ts","../src/phaser/display/webgl/graphics.ts","../src/phaser/display/webgl/base_texture.ts","../src/phaser/display/webgl/texture_util.ts","../src/phaser/display/graphics.ts","../src/phaser/display/group.ts","../src/phaser/display/text.ts","../src/phaser/core/factory.ts","../src/phaser/display/canvas/masker.ts","../src/phaser/display/canvas/util.ts","../src/phaser/display/canvas/renderer.ts","../src/phaser/display/webgl/blend_manager.ts","../src/phaser/display/webgl/filter_manager.ts","../src/phaser/display/webgl/mask_manager.ts","../src/phaser/display/webgl/util.ts","../src/phaser/display/webgl/shader/complex.ts","../src/phaser/display/webgl/shader/fast.ts","../src/phaser/display/webgl/shader/normal.ts","../src/phaser/display/webgl/shader/primitive.ts","../src/phaser/display/webgl/shader/strip.ts","../src/phaser/display/webgl/shader_manager.ts","../src/phaser/display/webgl/abstract_filter.ts","../src/phaser/display/webgl/sprite_batch.ts","../src/phaser/display/webgl/stencil_manager.ts","../src/phaser/display/webgl/renderer.ts","../src/phaser/core/frame_data.ts","../src/phaser/core/frame_util.ts","../src/phaser/core/frame.ts","../src/phaser/core/animation_parser.ts","../src/phaser/core/loader_parser.ts","../src/phaser/core/cache.ts","../src/phaser/core/device.ts","../src/phaser/core/device_util.ts","../src/phaser/core/array_set.ts","../src/phaser/core/input_mouse.ts","../src/phaser/core/input_mspointer.ts","../src/phaser/core/input_pointer.ts","../src/phaser/core/input_touch.ts","../src/phaser/core/input.ts","../src/phaser/core/loader.ts","../src/phaser/core/raf.ts","../src/phaser/core/dom.ts","../src/phaser/core/scale_manager.ts","../src/phaser/core/scene.ts","../src/phaser/core/scene_manager.ts","../src/phaser/core/sound.ts","../src/phaser/core/sound_sprite.ts","../src/phaser/core/sound_manager.ts","../src/phaser/core/stage.ts","../src/phaser/core/timer_event.ts","../src/phaser/core/timer.ts","../src/phaser/core/time.ts","../src/phaser/core/tween_data.ts","../src/phaser/core/tween.ts","../src/phaser/core/tween_easing.ts","../src/phaser/core/tween_manager.ts","../src/phaser/core/world.ts","../src/phaser/core/game.ts","../src/phaser/geom/util/line.ts","../src/phaser/geom/line.ts"],"sourcesContent":["// rectangle\n/**\n * @type {number}\n */\nexport const TOP_LEFT = 0;\n/**\n * @type {number}\n */\nexport const TOP_CENTER = 1;\n/**\n * @type {number}\n */\nexport const TOP_RIGHT = 2;\n/**\n * @type {number}\n */\nexport const LEFT_TOP = 3;\n/**\n * @type {number}\n */\nexport const LEFT_CENTER = 4;\n/**\n * @type {number}\n */\nexport const LEFT_BOTTOM = 5;\n/**\n * @type {number}\n */\nexport const CENTER = 6;\n/**\n * @type {number}\n */\nexport const RIGHT_TOP = 7;\n/**\n * @type {number}\n */\nexport const RIGHT_CENTER = 8;\n/**\n * @type {number}\n */\nexport const RIGHT_BOTTOM = 9;\n/**\n * @type {number}\n */\nexport const BOTTOM_LEFT = 10;\n/**\n * @type {number}\n */\nexport const BOTTOM_CENTER = 11;\n/**\n * @type {number}\n */\nexport const BOTTOM_RIGHT = 12;\n// scale modes\n/**\n * @type {number}\n */\nexport const SCALE_LINEAR = 0;\n/**\n * @type {number}\n */\nexport const SCALE_NEAREST = 1;\n// scale manager modes\n/**\n * @type {number}\n */\nexport const SCALE_EXACT_FIT = 0;\n/**\n * @type {number}\n */\nexport const SCALE_OFF = 1;\n/**\n * @type {number}\n */\nexport const SCALE_SHOW_ALL = 2;\n/**\n * @type {number}\n */\nexport const SCALE_RESIZE = 3;\n/**\n * @type {number}\n */\nexport const SCALE_USER = 4;\n// times\n/**\n * @type {number}\n */\nexport const TIME_MINUTE = 60000;\n/**\n * @type {number}\n */\nexport const TIME_SECOND = 1000;\n/**\n * @type {number}\n */\nexport const TIME_HALF = 500;\n/**\n * @type {number}\n */\nexport const TIME_QUARTER = 250;\n// tween statuses\n/**\n * @type {number}\n */\nexport const TWEEN_PENDING = 0;\n/**\n * @type {number}\n */\nexport const TWEEN_RUNNING = 1;\n/**\n * @type {number}\n */\nexport const TWEEN_LOOPED = 2;\n/**\n * @type {number}\n */\nexport const TWEEN_COMPLETE = 3;\n// blend modes\nexport const BLEND_NORMAL = 0;\nexport const BLEND_ADD = 1;\nexport const BLEND_MULTIPLY = 2;\nexport const BLEND_SCREEN = 3;\nexport const BLEND_OVERLAY = 4;\nexport const BLEND_DARKEN = 5;\nexport const BLEND_LIGHTEN = 6;\nexport const BLEND_COLOR_DODGE = 7;\nexport const BLEND_COLOR_BURN = 8;\nexport const BLEND_HARD_LIGHT = 9;\nexport const BLEND_SOFT_LIGHT = 10;\nexport const BLEND_DIFFERENCE = 11;\nexport const BLEND_EXCLUSION = 12;\nexport const BLEND_HUE = 13;\nexport const BLEND_SATURATION = 14;\nexport const BLEND_COLOR = 15;\nexport const BLEND_LUMINOSITY = 16;\n// render modes\n/**\n * @type {number}\n */\nexport const RENDER_AUTO = 0;\n/**\n * @type {number}\n */\nexport const RENDER_CANVAS = 1;\n/**\n * @type {number}\n */\nexport const RENDER_WEBGL = 2;\n// audio modes\n/**\n * @type {number}\n */\nexport const AUDIO_DISABLED = 0;\n/**\n * @type {number}\n */\nexport const AUDIO_STANDARD = 1;\n/**\n * @type {number}\n */\nexport const AUDIO_WEBKIT = 2;\n// pointer modes\n/**\n * @type {number}\n */\nexport const POINTER_CURSOR = 1;\n/**\n * @type {number}\n */\nexport const POINTER_CONTACT = 2;\n// input modes\n/**\n * @type {number}\n */\nexport const MOUSE_OVERRIDES_TOUCH = 0;\n/**\n * @type {number}\n */\nexport const TOUCH_OVERRIDES_MOUSE = 1;\n/**\n * @type {number}\n */\nexport const MOUSE_TOUCH_COMBINE = 2;\n// game objects\n/**\n * @type {number}\n */\nexport const GROUP = 7;\n/**\n * @type {number}\n */\nexport const SPRITE = 0;\n/**\n * @type {number}\n */\nexport const SPRITE_BATCH = 17;\n/**\n * @type {number}\n */\nexport const BUTTON = 1;\n/**\n * @type {number}\n */\nexport const IMAGE = 2;\n/**\n * @type {number}\n */\nexport const GRAPHICS = 3;\n/**\n * @type {number}\n */\nexport const TEXT = 4;\n/**\n * @type {number}\n */\nexport const BITMAP_TEXT = 6;\n/**\n * @type {number}\n */\nexport const TILE_SPRITE = 5;\n/**\n * @type {number}\n */\nexport const RENDER_TEXTURE = 8;\n/**\n * @type {number}\n */\nexport const FILTER_CANVAS = 14;\n/**\n * @type {number}\n */\nexport const FILTER_WEBGL = 15;\n/**\n * @type {number}\n */\nexport const POINTER = 19;\n/**\n * @type {number}\n */\nexport const GEOM_POLYGON = 12;\n/**\n * @type {number}\n */\nexport const GEOM_RECTANGLE = 22;\n/**\n * @type {number}\n */\nexport const GEOM_CIRCLE = 21;\n/**\n * @type {number}\n */\nexport const GEOM_ELLIPSE = 16;\n/**\n * @type {number}\n */\nexport const GEOM_ROUNDED_RECTANGLE = 26;\n/**\n * @type {number}\n */\nexport const GEOM_LINE = 23;\n/**\n * @type {number}\n */\nexport const GEOM_MATRIX = 24;\n/**\n * @type {number}\n */\nexport const GEOM_POINT = 25;\n/**\n * @type {number}\n */\nexport const PENDING_ATLAS = -1;\n","import { Point } from '../point.js';\n\n/**\n * Adds two points together.\n * @param {Point} a - The first point to add.\n * @param {Point} b - The second point to add.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point containing the sum of the two points.\n */\nexport const add = (a, b, output = null) => {\n const result = output || new Point();\n result.x = a.x + b.x;\n result.y = a.y + b.y;\n return result;\n};\n\n/**\n * Subtracts the second point from the first point.\n * @param {Point} a - The first point to subtract from.\n * @param {Point} b - The second point to subtract.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point containing the difference of the two points.\n */\nexport const subtract = (a, b, output = null) => {\n const result = output || new Point();\n result.x = a.x - b.x;\n result.y = a.y - b.y;\n return result;\n};\n\n/**\n * Multiplies two points together.\n * @param {Point} a - The first point to multiply.\n * @param {Point} b - The second point to multiply.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point containing the product of the two points.\n */\nexport const multiply = (a, b, output = null) => {\n const result = output || new Point();\n result.x = a.x * b.x;\n result.y = a.y * b.y;\n return result;\n};\n\n/**\n * Divides the first point by the second point.\n * @param {Point} a - The first point to divide.\n * @param {Point} b - The second point to divide by.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point containing the quotient of the two points.\n */\nexport const divide = (a, b, output = null) => {\n const result = output || new Point();\n result.x = a.x / b.x;\n result.y = a.y / b.y;\n return result;\n};\n\n/**\n * Checks if two points are equal.\n * @param {Point} a - The first point to compare.\n * @param {Point} b - The second point to compare.\n * @returns {boolean} True if the points are equal, false otherwise.\n */\nexport const equals = (a, b) => {\n return a.x === b.x && a.y === b.y;\n};\n\n/**\n * Calculates the angle between two points.\n * @param {Point} a - The first point to calculate the angle from.\n * @param {Point} b - The second point to calculate the angle to.\n * @returns {number} The angle between the two points in radians.\n */\nexport const angle = (a, b) => {\n return Math.atan2(a.y - b.y, a.x - b.x);\n};\n\n/**\n * Creates a new point with the same coordinates as the input point but with inverted signs.\n * @param {Point} a - The point to negate.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point with negated coordinates.\n */\nexport const negative = (a, output = null) => {\n const result = output || new Point();\n return result.setTo(-a.x, -a.y);\n};\n\n/**\n * Multiplies the second point by a scalar and adds it to the first point.\n * @param {Point} a - The first point to add to.\n * @param {Point} b - The second point to multiply by the scalar and add.\n * @param {number} s - The scalar value to multiply the second point by.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point with the result of the operation.\n */\nexport const multiplyAdd = (a, b, s, output = null) => {\n const result = output || new Point();\n return result.setTo(a.x + b.x * s, a.y + b.y * s);\n};\n\n/**\n * Interpolates between two points at a given factor.\n * @param {Point} a - The first point to interpolate from.\n * @param {Point} b - The second point to interpolate to.\n * @param {number} f - The interpolation factor (0-1).\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point interpolated between the two points.\n */\nexport const interpolate = (a, b, f, output = null) => {\n const result = output || new Point();\n return result.setTo(a.x + (b.x - a.x) * f, a.y + (b.y - a.y) * f);\n};\n\n/**\n * Returns a perpendicular point (rotated 90 degrees counter-clockwise).\n * @param {Point} a - The point to calculate the perpendicular for.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point that is perpendicular to the input point.\n */\nexport const perp = (a, output = null) => {\n const result = output || new Point();\n return result.setTo(-a.y, a.x);\n};\n\n/**\n * Returns a perpendicular point (rotated 90 degrees clockwise).\n * @param {Point} a - The point to calculate the perpendicular for.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point that is perpendicular to the input point (rotated clockwise).\n */\nexport const rperp = (a, output = null) => {\n const result = output || new Point();\n return result.setTo(a.y, -a.x);\n};\n\n/**\n * Calculates the distance between two points.\n * @param {Point} a - The first point to calculate the distance from.\n * @param {Point} b - The second point to calculate the distance to.\n * @param {boolean} round - Whether to round the result (default: false).\n * @returns {number} The distance between the two points.\n */\nexport const distance = (a, b, round = false) => {\n const dx = a.x - b.x;\n const dy = a.y - b.y;\n const abDistance = Math.sqrt(dx * dx + dy * dy);\n return round ? Math.round(abDistance) : abDistance;\n};\n\n/**\n * Projects the first point onto the second point.\n * @param {Point} a - The point to project.\n * @param {Point} b - The point to project onto.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point with the projected result.\n */\nexport const project = (a, b, output = null) => {\n const result = output || new Point();\n const amt = a.dot(b) / b.getMagnitudeSq();\n if (amt !== 0) {\n result.setTo(amt * b.x, amt * b.y);\n }\n return result;\n};\n\n/**\n * Projects the first point onto the unit vector of the second point.\n * @param {Point} a - The point to project.\n * @param {Point} b - The point to project onto (unit vector).\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point with the projected result.\n */\nexport const projectUnit = (a, b, output = null) => {\n const result = output || new Point();\n const amt = a.dot(b);\n if (amt !== 0) {\n result.setTo(amt * b.x, amt * b.y);\n }\n return result;\n};\n\n/**\n * Returns a point with the same direction as the input point but with y coordinate negated.\n * @param {Point} a - The point to calculate the normal for.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point with the same x coordinate but negated y coordinate.\n */\nexport const normalRightHand = (a, output = null) => {\n const result = output || new Point();\n return result.setTo(a.y * -1, a.x);\n};\n\n/**\n * Normalizes the input point to have a magnitude of 1 while preserving its direction.\n * @param {Point} a - The point to normalize.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new normalized point.\n */\nexport const normalize = (a, output = null) => {\n const result = output || new Point();\n const m = a.getMagnitude();\n if (m !== 0) {\n result.setTo(a.x / m, a.y / m);\n }\n return result;\n};\n\n/**\n * Rotates a point around another point by a given angle.\n * @param {Point} a - The point to rotate.\n * @param {number} x - The x coordinate of the center point to rotate around.\n * @param {number} y - The y coordinate of the center point to rotate around.\n * @param {number} ang - The angle in radians to rotate by.\n * @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false).\n * @param {number | null | undefined} dist - The distance to rotate from (default: null).\n * @returns {Point} The rotated point instance for chaining.\n */\nexport const rotate = (a, x, y, ang, asDegrees, dist) => {\n if (asDegrees) {\n ang *= Math.PI / 180;\n }\n if (dist === undefined || dist === null) {\n a.subtract(x, y);\n const s = Math.sin(ang);\n const c = Math.cos(ang);\n const tx = c * a.x - s * a.y;\n const ty = s * a.x + c * a.y;\n a.x = tx + x;\n a.y = ty + y;\n } else {\n const t = ang + Math.atan2(a.y - y, a.x - x);\n a.x = x + dist * Math.cos(t);\n a.y = y + dist * Math.sin(t);\n }\n return a;\n};\n\n/**\n * Calculates the centroid (average position) of a set of points.\n * @param {Point[]} points - The array of points to calculate the centroid for.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point representing the centroid of the input points.\n * @throws {Error} If the points array is empty.\n */\nexport const centroid = (points, output = null) => {\n const result = output || new Point();\n const pointsLen = points.length;\n if (pointsLen < 1) {\n throw new Error('Point(points) array must not be empty');\n }\n if (pointsLen === 1) {\n result.copyFrom(points[0]);\n return result;\n }\n for (let i = 0; i < pointsLen; i += 1) {\n add(result, points[i], result);\n }\n result.divide(pointsLen, pointsLen);\n return result;\n};\n\n/**\n * Parses an object with x and y properties into a Point.\n * @param {object} obj - The object to parse (must have x and y properties).\n * @param {string} xProp - The name of the property containing the x value (default: 'x').\n * @param {string} yProp - The name of the property containing the y value (default: 'y').\n * @returns {Point} A new point with parsed x and y values.\n */\nexport const parse = (obj, xProp = 'x', yProp = 'y') => {\n const point = new Point();\n if (obj[xProp]) {\n point.x = Number.parseInt(obj[xProp], 10);\n }\n if (obj[yProp]) {\n point.y = Number.parseInt(obj[yProp], 10);\n }\n return point;\n};\n\n/**\n * Creates a clone of the input point.\n * @param {Point} input - The point to clone.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A new point with the same coordinates as the input.\n */\nexport const clone = (input, output = null) => {\n const result = output || new Point();\n result.setTo(input.x, input.y);\n return result;\n};\n","import { GEOM_POINT } from '../core/const.js';\nimport { clone, distance, rotate } from './util/point.js';\n\nexport class Point {\n x: number;\n y: number;\n type: number;\n\n /**\n * Creates a new Point instance.\n * @param {number} x - The x coordinate of the point (default: 0).\n * @param {number} y - The y coordinate of the point (default: 0).\n */\n constructor(x = 0, y = 0) {\n /** @type {number} */\n this.x = x;\n /** @type {number} */\n this.y = y;\n /** @type {number} */\n this.type = GEOM_POINT;\n }\n\n /**\n * Copies the coordinates from another point to this point.\n * @param {Point} source - The point to copy coordinates from.\n * @returns {Point} This point instance for chaining.\n */\n copyFrom(source) {\n return this.setTo(source.x, source.y);\n }\n\n /**\n * Returns a new point with the x and y coordinates swapped.\n * @returns {Point} A new point instance with swapped coordinates.\n */\n invert() {\n return this.setTo(this.y, this.x);\n }\n\n /**\n * Sets the coordinates of this point to new values.\n * @param {number} x - The new x coordinate for the point.\n * @param {number} y - The new y coordinate for the point.\n * @returns {Point} This point instance for chaining.\n */\n setTo(x, y?) {\n this.x = x || 0;\n this.y = y || (y !== 0 ? this.x : 0);\n return this;\n }\n\n /**\n * Sets the coordinates of this point to new values.\n * @param {number} x - The new x coordinate for the point.\n * @param {number} y - The new y coordinate for the point.\n * @returns {Point} This point instance for chaining.\n * @deprecated Use setTo instead.\n */\n set(x, y) {\n this.x = x || 0;\n this.y = y || (y !== 0 ? this.x : 0);\n return this;\n }\n\n /**\n * Adds the given x and y values to the point's coordinates.\n * @param {number} x - The amount to add to the x coordinate.\n * @param {number} y - The amount to add to the y coordinate.\n * @returns {Point} This point instance for chaining.\n */\n add(x, y) {\n this.x += x;\n this.y += y;\n return this;\n }\n\n /**\n * Subtracts the given x and y values from the point's coordinates.\n * @param {number} x - The amount to subtract from the x coordinate.\n * @param {number} y - The amount to subtract from the y coordinate.\n * @returns {Point} This point instance for chaining.\n */\n subtract(x, y) {\n this.x -= x;\n this.y -= y;\n return this;\n }\n\n /**\n * Multiplies the point's coordinates by the given x and y values.\n * @param {number} x - The amount to multiply the x coordinate by.\n * @param {number} y - The amount to multiply the y coordinate by.\n * @returns {Point} This point instance for chaining.\n */\n multiply(x, y) {\n this.x *= x;\n this.y *= y;\n return this;\n }\n\n /**\n * Divides the point's coordinates by the given x and y values.\n * @param {number} x - The amount to divide the x coordinate by.\n * @param {number} y - The amount to divide the y coordinate by.\n * @returns {Point} This point instance for chaining.\n */\n divide(x, y) {\n this.x /= x;\n this.y /= y;\n return this;\n }\n\n /**\n * Constrains the x coordinate of this point to the given range.\n * @param {number} min - The minimum value for the x coordinate.\n * @param {number} max - The maximum value for the x coordinate.\n * @returns {Point} This point instance for chaining.\n */\n clampX(min, max) {\n this.x = Math.max(min, Math.min(max, this.x));\n return this;\n }\n\n /**\n * Constrains the y coordinate of this point to the given range.\n * @param {number} min - The minimum value for the y coordinate.\n * @param {number} max - The maximum value for the y coordinate.\n * @returns {Point} This point instance for chaining.\n */\n clampY(min, max) {\n this.y = Math.max(min, Math.min(max, this.y));\n return this;\n }\n\n /**\n * Constrains both coordinates of this point to the given range.\n * @param {number} min - The minimum value for both coordinates.\n * @param {number} max - The maximum value for both coordinates.\n * @returns {Point} This point instance for chaining.\n */\n clamp(min, max) {\n this.x = Math.max(min, Math.min(max, this.x));\n this.y = Math.max(min, Math.min(max, this.y));\n return this;\n }\n\n /**\n * Creates a clone of this point.\n * @returns {Point} A new point with the same coordinates as this one.\n */\n clone() {\n return clone(this);\n }\n\n /**\n * Copies the coordinates of this point to another point.\n * @param {Point} dest - The point to copy coordinates to.\n * @returns {Point} The destination point.\n */\n copyTo(dest) {\n dest.x = this.x;\n dest.y = this.y;\n return dest;\n }\n\n /**\n * Calculates the distance between this point and another point.\n * @param {Point} b - The other point to calculate the distance to.\n * @returns {number} The distance between the two points.\n */\n distance(b) {\n return distance(this, b);\n }\n\n /**\n * Checks if this point is equal to another point.\n * @param {Point} a - The other point to compare with.\n * @returns {boolean} True if the points have the same coordinates, false otherwise.\n */\n equals(a) {\n return a.x === this.x && a.y === this.y;\n }\n\n /**\n * Calculates the angle between this point and another point.\n * @param {Point} a - The other point to calculate the angle to.\n * @param {boolean} asDegrees - Whether to return the result in degrees (default: false).\n * @returns {number} The angle between the two points in radians or degrees.\n */\n angle(a, asDegrees = false) {\n if (asDegrees) {\n return (180 / Math.PI) * Math.atan2(a.y - this.y, a.x - this.x);\n }\n return Math.atan2(a.y - this.y, a.x - this.x);\n }\n\n /**\n * Rotates this point around another point by a given angle.\n * @param {number} x - The x coordinate of the center point to rotate around.\n * @param {number} y - The y coordinate of the center point to rotate around.\n * @param {number} angle - The angle in radians to rotate by.\n * @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false).\n * @param {number | null | undefined} dist - The distance to rotate from (default: null).\n * @returns {Point} This point instance for chaining.\n */\n rotate(x, y, angle, asDegrees, dist = null) {\n return rotate(this, x, y, angle, asDegrees, dist);\n }\n\n /**\n * Calculates the magnitude (length) of this point from the origin.\n * @returns {number} The magnitude of the point.\n */\n getMagnitude() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n\n /**\n * Calculates the square of the magnitude (length) of this point from the origin.\n * @returns {number} The square of the magnitude of the point.\n */\n getMagnitudeSq() {\n return this.x * this.x + this.y * this.y;\n }\n\n /**\n * Sets the magnitude (length) of this point while preserving its direction.\n * @param {number} magnitude - The new magnitude for the point.\n * @returns {Point} This point instance for chaining.\n */\n setMagnitude(magnitude) {\n return this.normalize().multiply(magnitude, magnitude);\n }\n\n /**\n * Normalizes this point to have a magnitude of 1 while preserving its direction.\n * @returns {Point} This point instance for chaining.\n */\n normalize() {\n if (!this.isZero()) {\n const m = this.getMagnitude();\n this.x /= m;\n this.y /= m;\n }\n return this;\n }\n\n /**\n * Checks if this point has zero magnitude (is at the origin).\n * @returns {boolean} True if both x and y coordinates are zero, false otherwise.\n */\n isZero() {\n return this.x === 0 && this.y === 0;\n }\n\n /**\n * Calculates the dot product of this point and another point.\n * @param {Point} a - The other point to calculate the dot product with.\n * @returns {number} The dot product of the two points.\n */\n dot(a) {\n return this.x * a.x + this.y * a.y;\n }\n\n /**\n * Calculates the cross product of this point and another point.\n * @param {Point} a - The other point to calculate the cross product with.\n * @returns {number} The cross product of the two points.\n */\n cross(a) {\n return this.x * a.y - this.y * a.x;\n }\n\n /**\n * Returns a perpendicular point (rotated 90 degrees counter-clockwise).\n * @returns {Point} A new point that is perpendicular to this one.\n */\n perp() {\n return this.setTo(-this.y, this.x);\n }\n\n /**\n * Returns a perpendicular point (rotated 90 degrees clockwise).\n * @returns {Point} A new point that is perpendicular to this one (rotated clockwise).\n */\n rperp() {\n return this.setTo(this.y, -this.x);\n }\n\n /**\n * Returns a point with the same direction as this one but with y coordinate negated.\n * @returns {Point} A new point with the same x coordinate but negated y coordinate.\n */\n normalRightHand() {\n return this.setTo(this.y * -1, this.x);\n }\n\n /**\n * Returns a new point with the x and y coordinates rounded down to the nearest integer.\n * @returns {Point} A new point with floored coordinates.\n */\n floor() {\n return this.setTo(Math.floor(this.x), Math.floor(this.y));\n }\n\n /**\n * Returns a new point with the x and y coordinates rounded up to the nearest integer.\n * @returns {Point} A new point with ceiled coordinates.\n */\n ceil() {\n return this.setTo(Math.ceil(this.x), Math.ceil(this.y));\n }\n\n /**\n * Returns a string representation of this point.\n * @returns {string} A string representation of the point in the format \"[Point (x=value y=value)]\".\n */\n toString() {\n return `[{Point (x=${this.x} y=${this.y})}]`;\n }\n}\n","import { Matrix } from '../matrix.js';\n\n/**\n * Clones a matrix.\n * @param {Matrix} input - The matrix to clone.\n * @param {Matrix} output - Optional matrix to store the result in.\n * @returns {Matrix} The cloned matrix.\n */\nexport const clone = (input, output = null) => {\n const result = output || new Matrix();\n result.a = input.a;\n result.b = input.b;\n result.c = input.c;\n result.d = input.d;\n result.tx = input.tx;\n result.ty = input.ty;\n return result;\n};\n\n/**\n * Creates a new identity matrix.\n * @returns {Matrix} A new identity matrix.\n */\nexport const getIdentityMatrix = () => {\n if (!window.PhaserRegistry) {\n window.PhaserRegistry = {};\n }\n if (!window.PhaserRegistry.IDENTITY_MATRIX) {\n window.PhaserRegistry.IDENTITY_MATRIX = new Matrix();\n }\n return window.PhaserRegistry.IDENTITY_MATRIX;\n};\n\n/**\n * Creates a new matrix with the specified values.\n * @returns {Matrix} A new matrix.\n */\nexport const getTempMatrix = () => {\n if (!window.PhaserRegistry) {\n window.PhaserRegistry = {};\n }\n if (!window.PhaserRegistry.TEMP_MATRIX) {\n window.PhaserRegistry.TEMP_MATRIX = new Matrix();\n }\n return window.PhaserRegistry.TEMP_MATRIX;\n};\n","import { Point } from './point.js';\nimport { clone } from './util/matrix.js';\nimport { GEOM_MATRIX } from '../core/const.js';\n\nexport class Matrix {\n a: number;\n b: number;\n c: number;\n d: number;\n tx: number;\n ty: number;\n type: number;\n\n /**\n * Creates a new Matrix instance.\n * @param {number} a - The a component of the matrix (default: 1).\n * @param {number} b - The b component of the matrix (default: 0).\n * @param {number} c - The c component of the matrix (default: 0).\n * @param {number} d - The d component of the matrix (default: 1).\n * @param {number} tx - The tx component of the matrix (default: 0).\n * @param {number} ty - The ty component of the matrix (default: 0).\n */\n constructor(a = 1, b = 0, c = 0, d = 1, tx = 0, ty = 0) {\n /** @type {number} */\n this.a = a;\n /** @type {number} */\n this.b = b;\n /** @type {number} */\n this.c = c;\n /** @type {number} */\n this.d = d;\n /** @type {number} */\n this.tx = tx;\n /** @type {number} */\n this.ty = ty;\n /** @type {number} */\n this.type = GEOM_MATRIX;\n }\n\n /**\n * Sets the matrix components from an array.\n * @param {number[]} array - The array to read the matrix components from (should have 6 elements).\n * @returns {Matrix} This matrix instance for chaining.\n */\n fromArray(array) {\n return this.setTo(array[0], array[1], array[3], array[4], array[2], array[5]);\n }\n\n /**\n * Sets the matrix components to new values.\n * @param {number} a - The new a component of the matrix.\n * @param {number} b - The new b component of the matrix.\n * @param {number} c - The new c component of the matrix.\n * @param {number} d - The new d component of the matrix.\n * @param {number} tx - The new tx component of the matrix.\n * @param {number} ty - The new ty component of the matrix.\n * @returns {Matrix} This matrix instance for chaining.\n */\n setTo(a, b, c, d, tx, ty) {\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 return this;\n }\n\n /**\n * Creates a clone of this matrix.\n * @returns {Matrix} A new matrix with the same values as this one.\n */\n clone() {\n return clone(this);\n }\n\n /**\n * Copies the values of this matrix to another matrix.\n * @param {Matrix} matrix - The matrix to copy values to.\n * @returns {Matrix} The destination matrix.\n */\n copyTo(matrix) {\n matrix.copyFrom(this);\n return matrix;\n }\n\n /**\n * Copies the values from another matrix to this matrix.\n * @param {Matrix} matrix - The matrix to copy values from.\n * @returns {Matrix} This matrix instance for chaining.\n */\n copyFrom(matrix) {\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 return this;\n }\n\n /**\n * Converts this matrix to a Float32Array.\n * @param {boolean} transpose - Whether to transpose the matrix (default: false).\n * @param {Float32Array} output - The array to store the result in (optional).\n * @returns {Float32Array} A Float32Array containing the matrix elements.\n */\n toArray(transpose = false, output = null) {\n const result = output || new Float32Array(9);\n if (transpose) {\n result[0] = this.a;\n result[1] = this.b;\n result[2] = 0;\n result[3] = this.c;\n result[4] = this.d;\n result[5] = 0;\n result[6] = this.tx;\n result[7] = this.ty;\n result[8] = 1;\n } else {\n result[0] = this.a;\n result[1] = this.c;\n result[2] = this.tx;\n result[3] = this.b;\n result[4] = this.d;\n result[5] = this.ty;\n result[6] = 0;\n result[7] = 0;\n result[8] = 1;\n }\n return result;\n }\n\n /**\n * Applies this matrix to a point.\n * @param {Point} pos - The point to apply the matrix to.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} The transformed point.\n */\n apply(pos, output = null) {\n const result = output || new Point();\n result.x = this.a * pos.x + this.c * pos.y + this.tx;\n result.y = this.b * pos.x + this.d * pos.y + this.ty;\n return result;\n }\n\n /**\n * Applies the inverse of this matrix to a point.\n * @param {Point} pos - The point to apply the inverse matrix to.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} The transformed point.\n */\n applyInverse(pos, output = null) {\n const result = output || new Point();\n const id = 1 / (this.a * this.d + this.c * -this.b);\n const x = pos.x;\n const y = pos.y;\n result.x = this.d * id * x + -this.c * id * y + (this.ty * this.c - this.tx * this.d) * id;\n result.y = this.a * id * y + -this.b * id * x + (-this.ty * this.a + this.tx * this.b) * id;\n return result;\n }\n\n /**\n * Translates this matrix by the specified amounts.\n * @param {number} x - The amount to translate in the x direction.\n * @param {number} y - The amount to translate in the y direction.\n * @returns {Matrix} This matrix instance for chaining.\n */\n translate(x, y) {\n this.tx += x;\n this.ty += y;\n return this;\n }\n\n /**\n * Scales this matrix by the specified amounts.\n * @param {number} x - The amount to scale in the x direction.\n * @param {number} y - The amount to scale in the y direction.\n * @returns {Matrix} This matrix instance for chaining.\n */\n scale(x, y) {\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 return this;\n }\n\n /**\n * Rotates this matrix by the specified angle.\n * @param {number} angle - The angle in radians to rotate by.\n * @returns {Matrix} This matrix instance for chaining.\n */\n rotate(angle) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const a1 = this.a;\n const c1 = this.c;\n const tx1 = this.tx;\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 return this;\n }\n\n /**\n * Appends another matrix to this matrix (multiplying matrices).\n * @param {Matrix} matrix - The matrix to append.\n * @returns {Matrix} This matrix instance for chaining.\n */\n append(matrix) {\n const a1 = this.a;\n const b1 = this.b;\n const c1 = this.c;\n const d1 = this.d;\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 this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx;\n this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty;\n return this;\n }\n\n /**\n * Sets this matrix to an identity matrix (no transformation).\n * @returns {Matrix} This matrix instance for chaining.\n */\n identity() {\n return this.setTo(1, 0, 0, 1, 0, 0);\n }\n}\n","import { Point } from '../point.js';\nimport { Rectangle } from '../rectangle.js';\n\n/**\n * Inflates the rectangle by the specified amounts on each axis.\n * @param {Rectangle} a - The rectangle to inflate.\n * @param {number} dx - The amount to inflate the rectangle horizontally.\n * @param {number} dy - The amount to inflate the rectangle vertically.\n * @returns {Rectangle} The inflated rectangle.\n */\nexport const inflate = (a, dx, dy) => {\n a.x -= dx;\n a.width += 2 * dx;\n a.y -= dy;\n a.height += 2 * dy;\n return a;\n};\n\n/**\n * Inflates the rectangle by the specified point values on each axis.\n * @param {Rectangle} a - The rectangle to inflate.\n * @param {object} point - The point containing x and y values to inflate the rectangle by.\n * @returns {Rectangle} The inflated rectangle.\n */\nexport const inflatePoint = (a, point) => {\n return inflate(a, point.x, point.y);\n};\n\n/**\n * Gets the size of the rectangle as a point.\n * @param {Rectangle} a - The rectangle to get the size of.\n * @param {Point} output - Optional point to store the result in.\n * @returns {Point} The size of the rectangle as a point (width, height).\n */\nexport const size = (a, output = null) => {\n const result = output || new Point();\n result.setTo(a.width, a.height);\n return result;\n};\n\n/**\n * Clones a rectangle.\n * @param {Rectangle} input - The rectangle to clone.\n * @param {Rectangle} output - Optional rectangle to store the result in.\n * @returns {Rectangle} The cloned rectangle.\n */\nexport const clone = (input, output = null) => {\n const result = output || new Rectangle();\n result.setTo(input.x, input.y, input.width, input.height);\n return result;\n};\n\n/**\n * Checks if a point is contained within the rectangle.\n * @param {Rectangle} a - The rectangle to check.\n * @param {number} x - The x coordinate of the point.\n * @param {number} y - The y coordinate of the point.\n * @returns {boolean} True if the point is contained within the rectangle, false otherwise.\n */\nexport const contains = (a, x, y) => {\n if (a.width <= 0 || a.height <= 0) {\n return false;\n }\n return x >= a.x && x < a.right && y >= a.y && y < a.bottom;\n};\n\n/**\n * Checks if a point is contained within the rectangle (raw version).\n * @param {number} rx - The x coordinate of the rectangle.\n * @param {number} ry - The y coordinate of the rectangle.\n * @param {number} rw - The width of the rectangle.\n * @param {number} rh - The height of the rectangle.\n * @param {number} x - The x coordinate of the point.\n * @param {number} y - The y coordinate of the point.\n * @returns {boolean} True if the point is contained within the rectangle, false otherwise.\n */\nexport const containsRaw = (rx, ry, rw, rh, x, y) => {\n return x >= rx && x < rx + rw && y >= ry && y < ry + rh;\n};\n\n/**\n * Checks if a point is contained within the rectangle.\n * @param {Rectangle} a - The rectangle to check.\n * @param {Point} point - The point to check.\n * @returns {boolean} True if the point is contained within the rectangle, false otherwise.\n */\nexport const containsPoint = (a, point) => {\n return contains(a, point.x, point.y);\n};\n\n/**\n * Checks if rectangle a contains rectangle b.\n * @param {Rectangle} a - The first rectangle to check.\n * @param {Rectangle} b - The second rectangle to check.\n * @returns {boolean} True if rectangle a contains rectangle b, false otherwise.\n */\nexport const containsRect = (a, b) => {\n if (a.volume > b.volume) {\n return false;\n }\n return a.x >= b.x && a.y >= b.y && a.right < b.right && a.bottom < b.bottom;\n};\n\n/**\n * Checks if two rectangles are equal.\n * @param {Rectangle} a - The first rectangle to compare.\n * @param {Rectangle} b - The second rectangle to compare.\n * @returns {boolean} True if the rectangles are equal, false otherwise.\n */\nexport const equals = (a, b) => {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n};\n\n/**\n * Checks if two rectangles have the same dimensions.\n * @param {Rectangle} a - The first rectangle to compare.\n * @param {Rectangle} b - The second rectangle to compare.\n * @returns {boolean} True if the rectangles have the same dimensions, false otherwise.\n */\nexport const sameDimensions = (a, b) => {\n return a.width === b.width && a.height === b.height;\n};\n\n/**\n * Checks if two rectangles intersect.\n * @param {Rectangle} a - The first rectangle to check.\n * @param {Rectangle} b - The second rectangle to check.\n * @returns {boolean} True if the rectangles intersect, false otherwise.\n */\nexport const intersects = (a, b) => {\n if (a.width <= 0 || a.height <= 0 || b.width <= 0 || b.height <= 0) {\n return false;\n }\n return !(a.right < b.x || a.bottom < b.y || a.x > b.right || a.y > b.bottom);\n};\n\n/**\n * Gets the intersection of two rectangles.\n * @param {Rectangle} a - The first rectangle.\n * @param {Rectangle} b - The second rectangle.\n * @param {Rectangle} output - Optional rectangle to store the result in.\n * @returns {Rectangle} The intersection of the rectangles, or an empty rectangle if they don't intersect.\n */\nexport const intersection = (a, b, output = null) => {\n const result = output || new Rectangle();\n if (intersects(a, b)) {\n result.x = Math.max(a.x, b.x);\n result.y = Math.max(a.y, b.y);\n result.width = Math.min(a.right, b.right) - result.x;\n result.height = Math.min(a.bottom, b.bottom) - result.y;\n }\n return result;\n};\n\n/**\n * Checks if a rectangle intersects with a set of raw coordinates.\n * @param {Rectangle} a - The rectangle to check.\n * @param {number} left - The left coordinate of the area to check.\n * @param {number} right - The right coordinate of the area to check.\n * @param {number} top - The top coordinate of the area to check.\n * @param {number} bottom - The bottom coordinate of the area to check.\n * @param {number} tolerance - Optional tolerance value for intersection.\n * @returns {boolean} True if the rectangle intersects with the area, false otherwise.\n */\nexport const intersectsRaw = (a, left, right, top, bottom, tolerance = 0) => {\n return !(\n left > a.right + tolerance ||\n right < a.left - tolerance ||\n top > a.bottom + tolerance ||\n bottom < a.top - tolerance\n );\n};\n\n/**\n * Gets the union of two rectangles.\n * @param {Rectangle} a - The first rectangle.\n * @param {Rectangle} b - The second rectangle.\n * @param {Rectangle} output - Optional rectangle to store the result in.\n * @returns {Rectangle} The union of the rectangles.\n */\nexport const union = (a, b, output = null) => {\n const result = output || new Rectangle();\n return result.setTo(\n Math.min(a.x, b.x),\n Math.min(a.y, b.y),\n Math.max(a.right, b.right) - Math.min(a.left, b.left),\n Math.max(a.bottom, b.bottom) - Math.min(a.top, b.top)\n );\n};\n\n/**\n * Gets the axis-aligned bounding box (AABB) of a set of points.\n * @param {Point[]} points - The array of points to calculate the AABB for.\n * @param {Rectangle} output - Optional rectangle to store the result in.\n * @returns {Rectangle} The AABB of the points.\n */\nexport const aabb = (points, output = null) => {\n const result = output || new Rectangle();\n let xMax = Number.NEGATIVE_INFINITY;\n let xMin = Number.POSITIVE_INFINITY;\n let yMax = Number.NEGATIVE_INFINITY;\n let yMin = Number.POSITIVE_INFINITY;\n points.forEach((point) => {\n if (point.x > xMax) {\n xMax = point.x;\n }\n if (point.x < xMin) {\n xMin = point.x;\n }\n if (point.y > yMax) {\n yMax = point.y;\n }\n if (point.y < yMin) {\n yMin = point.y;\n }\n });\n result.setTo(xMin, yMin, xMax - xMin, yMax - yMin);\n return result;\n};\n\n/**\n * Gets an empty rectangle instance.\n * @returns {Rectangle} An empty rectangle.\n */\nexport const getEmptyRectangle = () => {\n if (!window.PhaserRegistry) {\n window.PhaserRegistry = {};\n }\n if (!window.PhaserRegistry.EMPTY_RECTANGLE) {\n window.PhaserRegistry.EMPTY_RECTANGLE = new Rectangle();\n }\n return window.PhaserRegistry.EMPTY_RECTANGLE;\n};\n","import { Point } from './point.js';\nimport {\n inflate,\n size,\n clone,\n contains,\n containsRect,\n equals,\n intersects,\n intersection,\n intersectsRaw,\n union,\n} from './util/rectangle.js';\nimport {\n GEOM_RECTANGLE,\n TOP_LEFT,\n TOP_CENTER,\n TOP_RIGHT,\n LEFT_CENTER,\n CENTER,\n RIGHT_CENTER,\n BOTTOM_LEFT,\n BOTTOM_CENTER,\n BOTTOM_RIGHT,\n} from '../core/const.js';\n\nexport class Rectangle {\n x: number;\n y: number;\n width: number;\n height: number;\n type: number;\n\n /**\n * Creates a new Rectangle instance.\n * @param {number} x - The x coordinate of the top-left corner of the rectangle (default: 0).\n * @param {number} y - The y coordinate of the top-left corner of the rectangle (default: 0).\n * @param {number} width - The width of the rectangle (default: 0).\n * @param {number} height - The height of the rectangle (default: 0).\n */\n constructor(x = 0, y = 0, width = 0, height = 0) {\n /** @type {number} */\n this.x = x;\n /** @type {number} */\n this.y = y;\n /** @type {number} */\n this.width = width;\n /** @type {number} */\n this.height = height;\n /** @type {number} */\n this.type = GEOM_RECTANGLE;\n }\n\n /**\n * Offsets the rectangle's position by the specified amounts.\n * @param {number} dx - The amount to offset the x coordinate by.\n * @param {number} dy - The amount to offset the y coordinate by.\n * @returns {Rectangle} This rectangle instance for chaining.\n */\n offset(dx, dy) {\n this.x += dx;\n this.y += dy;\n return this;\n }\n\n /**\n * Offsets the rectangle's position by the specified point coordinates.\n * @param {Point} point - The point to offset the rectangle by.\n * @returns {Rectangle} This rectangle instance for chaining.\n */\n offsetPoint(point) {\n return this.offset(point.x, point.y);\n }\n\n /**\n * Sets the rectangle's position and size to new values.\n * @param {number} x - The new x coordinate of the top-left corner of the rectangle.\n * @param {number} y - The new y coordinate of the top-left corner of the rectangle.\n * @param {number} width - The new width of the rectangle.\n * @param {number} height - The new height of the rectangle.\n * @returns {Rectangle} This rectangle instance for chaining.\n */\n setTo(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n return this;\n }\n\n /**\n * Scales the rectangle's size by the specified amounts.\n * @param {number} x - The amount to scale the width by.\n * @param {number} y - The amount to scale the height by (default: x).\n * @returns {Rectangle} This rectangle instance for chaining.\n */\n scale(x, y?) {\n if (y === undefined) {\n y = x;\n }\n this.width *= x;\n this.height *= y;\n return this;\n }\n\n /**\n * Centers the rectangle on the specified point.\n * @param {number} x - The x coordinate to center the rectangle on.\n * @param {number} y - The y coordinate to center the rectangle on.\n * @returns {Rectangle} This rectangle instance for chaining.\n */\n centerOn(x, y) {\n this.centerX = x;\n this.centerY = y;\n return this;\n }\n\n /**\n * Floors the x and y coordinates of the rectangle (rounds down to nearest integer).\n */\n floor() {\n this.x = Math.floor(this.x);\n this.y = Math.floor(this.y);\n }\n\n /**\n * Floors all coordinates of the rectangle (rounds down to nearest integer).\n */\n floorAll() {\n this.x = Math.floor(this.x);\n this.y = Math.floor(this.y);\n this.width = Math.floor(this.width);\n this.height = Math.floor(this.height);\n }\n\n /**\n * Ceils the x and y coordinates of the rectangle (rounds up to nearest integer).\n */\n ceil() {\n this.x = Math.ceil(this.x);\n this.y = Math.ceil(this.y);\n }\n\n /**\n * Ceils all coordinates of the rectangle (rounds up to nearest integer).\n */\n ceilAll() {\n this.x = Math.ceil(this.x);\n this.y = Math.ceil(this.y);\n this.width = Math.ceil(this.width);\n this.height = Math.ceil(this.height);\n }\n\n /**\n * Copies the values from another rectangle to this rectangle.\n * @param {Rectangle} source - The rectangle to copy values from.\n * @returns {Rectangle} This rectangle instance for chaining.\n */\n copyFrom(source) {\n return this.setTo(source.x, source.y, source.width, source.height);\n }\n\n /**\n * Copies the values of this rectangle to another rectangle.\n * @param {Rectangle} dest - The rectangle to copy values to.\n * @returns {Rectangle} The destination rectangle.\n */\n copyTo(dest) {\n dest.x = this.x;\n dest.y = this.y;\n dest.width = this.width;\n dest.height = this.height;\n return dest;\n }\n\n /**\n * Increases the size of the rectangle by the specified amounts.\n * @param {number} dx - The amount to increase the width by.\n * @param {number} dy - The amount to increase the height by.\n * @returns {Rectangle} This rectangle instance for chaining.\n */\n inflate(dx, dy) {\n return inflate(this, dx, dy);\n }\n\n /**\n * Gets the size of the rectangle as a point.\n * @param {Point} output - The point to store the size in (optional).\n * @returns {Point} The size of the rectangle as a point.\n */\n size(output) {\n return size(this, output);\n }\n\n /**\n * Resizes the rectangle to the specified dimensions.\n * @param {number} width - The new width of the rectangle.\n * @param {number} height - The new height of the rectangle.\n * @returns {Rectangle} This rectangle instance for chaining.\n */\n resize(width, height) {\n this.width = width;\n this.height = height;\n return this;\n }\n\n /**\n * Creates a clone of this rectangle.\n * @param {Rectangle} output - The rectangle to store the clone in (optional).\n * @returns {Rectangle} A new rectangle with the same values as this one.\n */\n clone(output?) {\n return clone(this, output);\n }\n\n /**\n * Checks if the specified point is contained within this rectangle.\n * @param {number} x - The x coordinate of the point to check.\n * @param {number} y - The y coordinate of the point to check.\n * @returns {boolean} True if the point is contained within this rectangle, false otherwise.\n */\n contains(x, y) {\n return contains(this, x, y);\n }\n\n /**\n * Checks if the specified rectangle is fully contained within this rectangle.\n * @param {Rectangle} b - The rectangle to check if it's contained.\n * @returns {boolean} True if the rectangle is contained within this rectangle, false otherwise.\n */\n containsRect(b) {\n return containsRect(b, this);\n }\n\n /**\n * Checks if this rectangle is equal to another rectangle.\n * @param {Rectangle} b - The rectangle to compare with.\n * @returns {boolean} True if the rectangles have the same values, false otherwise.\n */\n equals(b) {\n return equals(this, b);\n }\n\n /**\n * Gets the intersection of this rectangle and another rectangle.\n * @param {Rectangle} b - The rectangle to intersect with.\n * @param {Rectangle} out - The rectangle to store the result in (optional).\n * @returns {Rectangle} The intersection of the two rectangles.\n */\n intersection(b, out?) {\n return intersection(this, b, out);\n }\n\n /**\n * Checks if this rectangle intersects with another rectangle.\n * @param {Rectangle} b - The rectangle to check for intersection with.\n * @returns {boolean} True if the rectangles intersect, false otherwise.\n */\n intersects(b) {\n return intersects(this, b);\n }\n\n /**\n * Checks if this rectangle intersects with the specified bounds.\n * @param {number} left - The left boundary of the area to check for intersection.\n * @param {number} right - The right boundary of the area to check for intersection.\n * @param {number} top - The top boundary of the area to check for intersection.\n * @param {number} bottom - The bottom boundary of the area to check for intersection.\n * @param {number} tolerance - A tolerance value to use when checking (default: 0).\n * @returns {boolean} True if the rectangle intersects with the bounds, false otherwise.\n */\n intersectsRaw(left, right, top, bottom, tolerance) {\n return intersectsRaw(this, left, right, top, bottom, tolerance);\n }\n\n /**\n * Gets the union of this rectangle and another rectangle.\n * @param {Rectangle} b - The rectangle to union with.\n * @param {Rectangle} out - The rectangle to store the result in (optional).\n * @returns {Rectangle} The union of the two rectangles.\n */\n union(b, out?) {\n return union(this, b, out);\n }\n\n /**\n * Gets a random point within this rectangle.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A random point within this rectangle.\n */\n random(output = null) {\n const result = output || new Point();\n result.x = this.randomX;\n result.y = this.randomY;\n return result;\n }\n\n /**\n * Gets a point at a specific position on the rectangle.\n * @param {number} position - The position to get the point for (TOP_LEFT, TOP_CENTER, etc.).\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A point at the specified position on the rectangle.\n */\n getPoint(position, output = null) {\n const result = output || new Point();\n switch (position) {\n case TOP_LEFT:\n return result.setTo(this.x, this.y);\n case TOP_CENTER:\n return result.setTo(this.centerX, this.y);\n case TOP_RIGHT:\n return result.setTo(this.right, this.y);\n case LEFT_CENTER:\n return result.setTo(this.x, this.centerY);\n case CENTER:\n return result.setTo(this.centerX, this.centerY);\n case RIGHT_CENTER:\n return result.setTo(this.right, this.centerY);\n case BOTTOM_LEFT:\n return result.setTo(this.x, this.bottom);\n case BOTTOM_CENTER:\n return result.setTo(this.centerX, this.bottom);\n case BOTTOM_RIGHT:\n return result.setTo(this.right, this.bottom);\n default:\n return result.setTo(this.x, this.y);\n }\n }\n\n /**\n * Returns a string representation of this rectangle.\n * @returns {string} A string representation of the rectangle.\n */\n toString() {\n return `[{Rectangle (x=${this.x} y=${this.y} width=${this.width} height=${this.height} empty=${this.empty})}]`;\n }\n\n /**\n * Gets half the width of this rectangle.\n * @returns {number} Half the width of this rectangle.\n */\n get halfWidth() {\n return Math.round(this.width / 2);\n }\n\n /**\n * Gets half the height of this rectangle.\n * @returns {number} Half the height of this rectangle.\n */\n get halfHeight() {\n return Math.round(this.height / 2);\n }\n\n /**\n * Gets the top coordinate of this rectangle.\n * @returns {number} The top coordinate of this rectangle.\n */\n get top() {\n return this.y;\n }\n\n /**\n * Sets the top coordinate of this rectangle.\n */\n set top(value) {\n if (value >= this.bottom) {\n this.height = 0;\n this.y = value;\n } else {\n this.height = this.bottom - value;\n }\n }\n\n /**\n * Gets the top-left point of this rectangle.\n * @returns {Point} The top-left point of this rectangle.\n */\n get topLeft() {\n return new Point(this.x, this.y);\n }\n\n /**\n * Sets the top-left point of this rectangle.\n */\n set topLeft(value) {\n this.x = value.x;\n this.y = value.y;\n }\n\n /**\n * Gets the top-right point of this rectangle.\n * @returns {Point} The top-right point of this rectangle.\n */\n get topRight() {\n return new Point(this.x + this.width, this.y);\n }\n\n /**\n * Sets the top-right point of this rectangle.\n */\n set topRight(value) {\n this.right = value.x;\n this.y = value.y;\n }\n\n /**\n * Gets the bottom coordinate of this rectangle.\n * @returns {number} The bottom coordinate of this rectangle.\n */\n get bottom() {\n return this.y + this.height;\n }\n\n /**\n * Sets the bottom coordinate of this rectangle.\n */\n set bottom(value) {\n if (value <= this.y) {\n this.height = 0;\n } else {\n this.height = value - this.y;\n }\n }\n\n /**\n * Gets the bottom-left point of this rectangle.\n * @returns {Point} The bottom-left point of this rectangle.\n */\n get bottomLeft() {\n return new Point(this.x, this.bottom);\n }\n\n /**\n * Sets the bottom-left point of this rectangle.\n */\n set bottomLeft(value) {\n this.x = value.x;\n this.bottom = value.y;\n }\n\n /**\n * Gets the bottom-right point of this rectangle.\n * @returns {Point} The bottom-right point of this rectangle.\n */\n get bottomRight() {\n return new Point(this.right, this.bottom);\n }\n\n /**\n * Sets the bottom-right point of this rectangle.\n */\n set bottomRight(value) {\n this.right = value.x;\n this.bottom = value.y;\n }\n\n /**\n * Gets the left coordinate of this rectangle.\n * @returns {number} The left coordinate of this rectangle.\n */\n get left() {\n return this.x;\n }\n\n /**\n * Sets the left coordinate of this rectangle.\n */\n set left(value) {\n if (value >= this.right) {\n this.width = 0;\n } else {\n this.width = this.right - value;\n }\n this.x = value;\n }\n\n /**\n * Gets the right coordinate of this rectangle.\n * @returns {number} The right coordinate of this rectangle.\n */\n get right() {\n return this.x + this.width;\n }\n\n /**\n * Sets the right coordinate of this rectangle.\n */\n set right(value) {\n if (value <= this.x) {\n this.width = 0;\n } else {\n this.width = value - this.x;\n }\n }\n\n /**\n * Gets the volume (area) of this rectangle.\n * @returns {number} The volume (area) of this rectangle.\n */\n get volume() {\n return this.width * this.height;\n }\n\n /**\n * Gets the perimeter of this rectangle.\n * @returns {number} The perimeter of this rectangle.\n */\n get perimeter() {\n return this.width * 2 + this.height * 2;\n }\n\n /**\n * Gets the x coordinate of the center of this rectangle.\n * @returns {number} The x coordinate of the center of this rectangle.\n */\n get centerX() {\n return this.x + this.halfWidth;\n }\n\n /**\n * Sets the x coordinate of the center of this rectangle.\n */\n set centerX(value) {\n this.x = value - this.halfWidth;\n }\n\n /**\n * Gets the y coordinate of the center of this rectangle.\n * @returns {number} The y coordinate of the center of this rectangle.\n */\n get centerY() {\n return this.y + this.halfHeight;\n }\n\n /**\n * Sets the y coordinate of the center of this rectangle.\n */\n set centerY(value) {\n this.y = value - this.halfHeight;\n }\n\n /**\n * Gets a random x coordinate within this rectangle.\n * @returns {number} A random x coordinate within this rectangle.\n */\n get randomX() {\n return this.x + Math.random() * this.width;\n }\n\n /**\n * Gets a random y coordinate within this rectangle.\n * @returns {number} A random y coordinate within this rectangle.\n */\n get randomY() {\n return this.y + Math.random() * this.height;\n }\n\n /**\n * Checks if this rectangle is empty (has zero width or height).\n * @returns {boolean} True if the rectangle is empty, false otherwise.\n */\n get empty() {\n return !this.width || !this.height;\n }\n\n /**\n * Sets whether this rectangle is empty (zero width or height).\n */\n set empty(value) {\n if (value === true) {\n this.setTo(0, 0, 0, 0);\n }\n }\n}\n","export const DEG_TO_RAD = Math.PI / 180;\nexport const RAD_TO_DEG = 180 / Math.PI;\nexport const PI_2 = Math.PI * 2;\n\n/**\n * Converts a hexadecimal color value to RGB components.\n * @param {number} hex - The hexadecimal color value.\n * @returns {number[]} An array containing the RGB components [r, g, b].\n */\nexport const hex2rgb = (hex) => {\n return [((hex >> 16) & 0xff) / 255, ((hex >> 8) & 0xff) / 255, (hex & 0xff) / 255];\n};\n\n/**\n * Converts RGB components to a hexadecimal color value.\n * @param {number} rgb - The RGB components array [r, g, b].\n * @returns {number} The hexadecimal color value.\n */\nexport const rgb2hex = (rgb) => {\n return ((rgb[0] * 255) << 16) + ((rgb[1] * 255) << 8) + rgb[2] * 255;\n};\n\n/**\n * Gets the next power of two greater than or equal to a value.\n * @param {number} value - The input value.\n * @returns {number} The next power of two.\n */\nexport const getNextPowerOfTwo = (value) => {\n // see: https://en.wikipedia.org/wiki/Power_of_two#Fast_algorithm_to_check_if_a_positive_number_is_a_power_of_two\n if (value > 0 && (value & (value - 1)) === 0) {\n return value;\n }\n let result = 1;\n while (result < value) {\n result <<= 1;\n }\n return result;\n};\n\n/**\n * Checks if both width and height are powers of two.\n * @param {number} width - The width to check.\n * @param {number} height - The height to check.\n * @returns {boolean} True if both width and height are powers of two, false otherwise.\n */\nexport const isPowerOfTwo = (width, height) => {\n return width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0;\n};\n\n/**\n * Converts degrees to radians.\n * @param {number} degrees - The angle in degrees.\n * @returns {number} The angle in radians.\n */\nexport const degToRad = (degrees) => {\n return degrees * DEG_TO_RAD;\n};\n\n/**\n * Converts radians to degrees.\n * @param {number} radians - The angle in radians.\n * @returns {number} The angle in degrees.\n */\nexport const radToDeg = (radians) => {\n return radians * RAD_TO_DEG;\n};\n\n/**\n * Gets a random integer between min and max (inclusive).\n * @param {number} min - The minimum value.\n * @param {number} max - The maximum value.\n * @returns {number} A random integer between min and max.\n */\nexport const between = (min, max) => {\n return Math.floor(Math.random() * (max - min + 1) + min);\n};\n\n/**\n * Snaps a value to the nearest multiple of gap, starting from start.\n * @param {number} input - The value to snap.\n * @param {number} gap - The gap size to snap to.\n * @param {number} start - The starting offset for snapping.\n * @returns {number} The snapped value.\n */\nexport const snapToCeil = (input, gap = 0, start = 0) => {\n if (gap === 0) {\n return input;\n }\n input -= start;\n input = gap * Math.ceil(input / gap);\n return start + input;\n};\n\n/**\n * Wraps a value within a range.\n * @param {number} value - The value to wrap.\n * @param {number} min - The minimum value of the range.\n * @param {number} max - The maximum value of the range.\n * @returns {number} The wrapped value.\n */\nexport const wrap = (value, min, max) => {\n const range = max - min;\n if (range <= 0) {\n return 0;\n }\n let result = (value - min) % range;\n if (result < 0) {\n result += range;\n }\n return result + min;\n};\n\n/**\n * Performs linear interpolation between two values.\n * @param {number} p0 - The first point.\n * @param {number} p1 - The second point.\n * @param {number} t - The interpolation factor (0 to 1).\n * @returns {number} The interpolated value.\n */\nexport const linear = (p0, p1, t) => {\n return (p1 - p0) * t + p0;\n};\n\n/**\n * Calculates the absolute difference between two numbers.\n * @param {number} a - The first number.\n * @param {number} b - The second number.\n * @returns {number} The absolute difference between a and b.\n */\nexport const difference = (a, b) => {\n return Math.abs(a - b);\n};\n\n/**\n * Performs linear interpolation on an array of values.\n * @param {number[]} v - The array of values.\n * @param {number} k - The interpolation factor (0 to 1).\n * @returns {number} The interpolated value.\n */\nexport const linearInterpolation = (v, k) => {\n const m = v.length - 1;\n const f = m * k;\n const i = Math.floor(f);\n if (k < 0) {\n return linear(v[0], v[1], f);\n }\n if (k > 1) {\n return linear(v[m], v[m - 1], m - f);\n }\n return linear(v[i], v[i + 1 > m ? m : i + 1], f - i);\n};\n\n/**\n * Calculates the distance between two points.\n * @param {number} x1 - The x-coordinate of the first point.\n * @param {number} y1 - The y-coordinate of the first point.\n * @param {number} x2 - The x-coordinate of the second point.\n * @param {number} y2 - The y-coordinate of the second point.\n * @returns {number} The distance between the two points.\n */\nexport const distance = (x1, y1, x2, y2) => {\n const dx = x1 - x2;\n const dy = y1 - y2;\n return Math.sqrt(dx * dx + dy * dy);\n};\n\n/**\n * Checks if two numbers are within a tolerance of each other.\n * @param {number} a - The first number.\n * @param {number} b - The second number.\n * @param {number} tolerance - The tolerance value.\n * @returns {boolean} True if the numbers are within tolerance, false otherwise.\n */\nexport const within = (a, b, tolerance) => {\n return Math.abs(a - b) <= tolerance;\n};\n\n/**\n * Creates a 32-bit color value from alpha, red, green, and blue components.\n * @param {number} a - The alpha component (0-255).\n * @param {number} r - The red component (0-255).\n * @param {number} g - The green component (0-255).\n * @param {number} b - The blue component (0-255).\n * @returns {number} The 32-bit color value.\n */\nexport const getColor32 = (a, r, g, b) => {\n return (a << 24) | (r << 16) | (g << 8) | b;\n};\n\n/**\n * Creates a 24-bit color value from red, green, and blue components.\n * @param {number} r - The red component (0-255).\n * @param {number} g - The green component (0-255).\n * @param {number} b - The blue component (0-255).\n * @returns {number} The 24-bit color value.\n */\nexport const getColor = (r, g, b) => {\n return (r << 16) | (g << 8) | b;\n};\n\n/**\n * Converts a hex color string to RGB components.\n * @param {string} value - The hex color string (e.g. \"#FF0000\").\n * @param {{r?: number, g?: number, b?: number}} out - The object to store the result in.\n */\nexport const hexToColor = (value, out) => {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n value = value.replace(/^(?:#|0x)?([a-f\\d])([a-f\\d])([a-f\\d])$/i, (m, r, g, b) => r + r + g + g + b + b);\n const result = /^(?:#|0x)?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(value);\n if (result) {\n out.r = Number.parseInt(result[1], 16);\n out.g = Number.parseInt(result[2], 16);\n out.b = Number.parseInt(result[3], 16);\n }\n};\n\n/**\n * Converts a web color string (e.g. \"rgb(255, 0, 0)\") to RGB components with alpha.\n * @param {string} value - The web color string (e.g. \"rgba(255, 0, 0, 0.5)\").\n * @param {{r?: number, g?: number, b?: number, a?: number}} out - The object to store the result in.\n */\nexport const webToColor = (value, out) => {\n const result = /^rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d+(?:\\.\\d+)?))?\\s*\\)$/.exec(value);\n if (result) {\n out.r = Number.parseInt(result[1], 10);\n out.g = Number.parseInt(result[2], 10);\n out.b = Number.parseInt(result[3], 10);\n out.a = result[4] !== undefined ? Number.parseFloat(result[4]) : 1;\n }\n};\n\n/**\n * Extracts RGB components from a 32-bit color value.\n * @param {number} color - The 32-bit color value.\n * @returns {{ alpha: number, red: number, green: number, blue: number, a: number, r: number, g: number, b: number}} An object containing the color components.\n */\nexport const getRGB = (color) => {\n if (color > 16777215) {\n // The color value has an alpha component\n return {\n alpha: color >>> 24,\n red: (color >> 16) & 0xff,\n green: (color >> 8) & 0xff,\n blue: color & 0xff,\n a: color >>> 24,\n r: (color >> 16) & 0xff,\n g: (color >> 8) & 0xff,\n b: color & 0xff,\n };\n }\n return {\n alpha: 255,\n red: (color >> 16) & 0xff,\n green: (color >> 8) & 0xff,\n blue: color & 0xff,\n a: 255,\n r: (color >> 16) & 0xff,\n g: (color >> 8) & 0xff,\n b: color & 0xff,\n };\n};\n\n/**\n * Converts a color value (string or number) to an object with various color formats.\n * @param {string|number} value - The color value (e.g. \"#FF0000\" or 0xFF0000).\n * @param {{a?: number, r?: number, g?: number, b?: number, rgba?: string, color?: number, color32?: number}} out - The object to store the result in.\n * @returns {{a?: number, r?: number, g?: number, b?: number, rgba?: string, color?: number, color32?: number}} The updated out object.\n */\nexport const valueToColor = (value, out) => {\n if (typeof value === 'string') {\n if (value.indexOf('rgb') === 0) {\n webToColor(value, out);\n } else {\n // `hexToColor` does not support alpha; match `createColor`.\n out.a = 1;\n hexToColor(value, out);\n }\n } else if (typeof value === 'number') {\n // `getRGB` does not take optional object to modify;\n // alpha is also adjusted to match `createColor`.\n const tempColor = getRGB(value);\n out.r = tempColor.r;\n out.g = tempColor.g;\n out.b = tempColor.b;\n out.a = tempColor.a / 255;\n }\n out.rgba = `rgba(${out.r.toString()},${out.g.toString()},${out.b.toString()},${out.a.toString()})`;\n out.color = getColor(out.r, out.g, out.b);\n out.color32 = getColor32(out.a * 255, out.r, out.g, out.b);\n return out;\n};\n","export const ENGINE_ERROR_CREATING_CANVAS_2D_CONTEXT = 'ENGINE_ERROR_CREATING_CANVAS_2D_CONTEXT';\nexport const ENGINE_ERROR_CREATING_WEBGL_CONTEXT = 'ENGINE_ERROR_CREATING_WEBGL_CONTEXT';\nexport const ENGINE_ERROR_WEBGL_CONTEXT_LOST = 'ENGINE_ERROR_WEBGL_CONTEXT_LOST';\nexport const ENGINE_ERROR_GETTING_DOCUMENT = 'ENGINE_ERROR_GETTING_DOCUMENT';\nexport const ENGINE_ERROR_INVALID_BITMAP_FONT_ATLAS = 'ENGINE_ERROR_INVALID_BITMAP_FONT_ATLAS';\nexport const ENGINE_ERROR_CREATING_AUDIO_CONTEXT = 'ENGINE_ERROR_CREATING_AUDIO_CONTEXT';\nexport const ENGINE_ERROR_CANNOT_SET_FRAME = 'ENGINE_ERROR_CANNOT_SET_FRAME';\nexport const ENGINE_ERROR_CANNOT_SET_FRAME_NAME = 'ENGINE_ERROR_CANNOT_SET_FRAME_NAME';\n","// @ts-nocheck\n/**\n * Gets the canvas pool array.\n * @returns {{canvas: HTMLCanvasElement, parent: object}[]} The canvas pool array.\n */\nexport const getPool = () => {\n if (!window.PhaserRegistry) {\n window.PhaserRegistry = {};\n }\n if (!window.PhaserRegistry.CANVAS_POOL) {\n window.PhaserRegistry.CANVAS_POOL = [];\n }\n return window.PhaserRegistry.CANVAS_POOL;\n};\n\n/**\n * Gets the current size of the canvas pool.\n * @returns {number} The current size of the canvas pool.\n */\nexport const getFirst = () => {\n const pool = getPool();\n for (let i = 0; i < pool.length; i += 1) {\n if (!pool[i].parent) {\n return i;\n }\n }\n return -1;\n};\n\n/**\n * Adds a canvas to the pool with the specified parent.\n * @param {object} parent - The parent object for the canvas.\n */\nexport const remove = (parent) => {\n const pool = getPool();\n for (let i = 0; i < pool.length; i += 1) {\n if (pool[i].parent === parent) {\n pool[i].parent = null;\n pool[i].canvas.width = 1;\n pool[i].canvas.height = 1;\n }\n }\n};\n\n/**\n * Removes a canvas from the pool.\n * @param {HTMLCanvasElement} canvas - The canvas to remove from the pool.\n */\nexport const removeByCanvas = (canvas) => {\n const pool = getPool();\n for (let i = 0; i < pool.length; i += 1) {\n if (pool[i].canvas === canvas) {\n pool[i].parent = null;\n pool[i].canvas.width = 1;\n pool[i].canvas.height = 1;\n }\n }\n};\n\n/**\n * Gets the total count of canvases in the pool.\n * @returns {number} The total count of canvases in the pool.\n */\nexport const getTotal = () => {\n const pool = getPool();\n let c = 0;\n for (let i = 0; i < pool.length; i += 1) {\n if (pool[i].parent) {\n c += 1;\n }\n }\n return c;\n};\n\n/**\n * Gets the number of free canvases in the pool.\n * @returns {number} The number of free canvases in the pool.\n */\nexport const getFree = () => {\n const pool = getPool();\n let c = 0;\n for (let i = 0; i < pool.length; i += 1) {\n if (!pool[i].parent) {\n c += 1;\n }\n }\n return c;\n};\n\n/**\n * Gets a canvas from the pool or creates a new one.\n * @param {object} parent - The parent object for the canvas.\n * @param {number} [width] - Optional width of the canvas.\n * @param {number} [height] - Optional height of the canvas.\n * @param {boolean} skipPool - True to skip using the pool and create a new canvas.\n * @returns {HTMLCanvasElement} The canvas from the pool or a newly created one.\n */\nexport const create = (parent, width, height, skipPool = false) => {\n if (parent === undefined) {\n console.warn('Created CanvasPool element with undefined parent.');\n }\n const idx = getFirst();\n const pool = getPool();\n let canvas;\n if (idx === -1 || skipPool === true) {\n const container = {\n parent,\n canvas: document.createElement('canvas'),\n };\n pool.push(container);\n canvas = container.canvas;\n } else {\n pool[idx].parent = parent;\n canvas = pool[idx].canvas;\n }\n if (width !== undefined) {\n canvas.width = width;\n canvas.height = height;\n }\n return canvas;\n};\n","// @ts-nocheck\nimport { ENGINE_ERROR_CREATING_CANVAS_2D_CONTEXT, ENGINE_ERROR_GETTING_DOCUMENT } from '../../core/error_code.js';\nimport { hex2rgb } from '../../util/math.js';\nimport { create, removeByCanvas } from './pool.js';\n\n/**\n * Tints a sprite with the given color.\n * @param {object} sprite - The sprite to tint.\n * @param {object} color - The color to tint with.\n * @returns {object} The tinted sprite.\n */\nexport const getTintedTexture = (sprite, color) => {\n const canvas = sprite.tintedTexture || create('CanvasTinter', 1, 1);\n window.PhaserRegistry.CANVAS_TINT_METHOD(sprite.texture, color, canvas);\n return canvas;\n};\n\n/**\n * Tints a texture with the given color.\n * @param {object} texture - The texture to tint.\n * @param {object} color - The color to tint with.\n * @param {HTMLCanvasElement} canvas - The canvas to render to.\n * @throws {Error} If the operation fails.\n */\nexport const tintWithMultiply = (texture, color, canvas) => {\n const context = canvas.getContext('2d', { willReadFrequently: false });\n if (!context) {\n throw new Error(ENGINE_ERROR_CREATING_CANVAS_2D_CONTEXT);\n }\n const crop = texture.crop;\n if (canvas.width !== crop.width || canvas.height !== crop.height) {\n canvas.width = crop.width;\n canvas.height = crop.height;\n }\n context.clearRect(0, 0, crop.width, crop.height);\n context.fillStyle = `#${`00000${(color | 0).toString(16)}`.substr(-6)}`;\n context.fillRect(0, 0, crop.width, crop.height);\n context.globalCompositeOperation = 'multiply';\n context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height);\n context.globalCompositeOperation = 'destination-atop';\n context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height);\n};\n\n/**\n * Tints a texture with the given color.\n * @param {object} texture - The texture to tint.\n * @param {object} color - The color to tint with.\n * @param {HTMLCanvasElement} canvas - The canvas to render to.\n * @throws {Error} If the operation fails.\n */\nexport const tintWithPerPixel = (texture, color, canvas) => {\n const context = canvas.getContext('2d', { willReadFrequently: false });\n if (!context) {\n throw new Error(ENGINE_ERROR_CREATING_CANVAS_2D_CONTEXT);\n }\n const crop = texture.crop;\n canvas.width = crop.width;\n canvas.height = crop.height;\n context.globalCompositeOperation = 'copy';\n context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height);\n const rgbValues = hex2rgb(color);\n const r = rgbValues[0];\n const g = rgbValues[1];\n const b = rgbValues[2];\n const pixelData = context.getImageData(0, 0, crop.width, crop.height);\n const pixels = pixelData.data;\n for (let i = 0; i < pixels.length; i += 4) {\n pixels[i + 0] *= r;\n pixels[i + 1] *= g;\n pixels[i + 2] *= b;\n const canHandleAlpha = window.PhaserRegistry.CAN_CANVAS_HANDLE_ALPHA;\n if (!canHandleAlpha) {\n const alpha = pixels[i + 3];\n pixels[i + 0] /= 255 / alpha;\n pixels[i + 1] /= 255 / alpha;\n pixels[i + 2] /= 255 / alpha;\n }\n }\n context.putImageData(pixelData, 0, 0);\n};\n\n/**\n * Checks if the tinter can handle the given texture.\n * @returns {boolean} True if the tinter can handle the texture, false otherwise.\n * @throws {Error} If the operation fails.\n */\nexport const checkInverseAlpha = () => {\n // Check for DOM\n if (document === undefined) {\n throw new Error(ENGINE_ERROR_GETTING_DOCUMENT);\n }\n // Create canvas and context\n const canvas = create('CanvasAlpha', 2, 1, true);\n const context = canvas.getContext('2d', { willReadFrequently: false });\n if (!context) {\n throw new Error(ENGINE_ERROR_CREATING_CANVAS_2D_CONTEXT);\n }\n // Set canvas fill style\n context.fillStyle = 'rgba(10, 20, 30, 0.5)';\n // Draw a single pixel\n context.fillRect(0, 0, 1, 1);\n // Get the color values\n const s1 = context.getImageData(0, 0, 1, 1);\n if (s1 === null) {\n return false;\n }\n // Plot them to x2\n context.putImageData(s1, 1, 0);\n // Get those values\n const s2 = context.getImageData(1, 0, 1, 1);\n // Dispose canvas\n try {\n context.reset();\n } catch {\n // pass\n }\n removeByCanvas(canvas);\n // Compare and return\n return (\n s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]\n );\n};\n\n/**\n * Checks if the tinter can handle the given texture.\n * @returns {boolean} True if the tinter can handle the texture, false otherwise.\n * @throws {Error} If the operation fails.\n */\nexport const canUseNewCanvasBlendModes = () => {\n // Check for DOM\n if (document === undefined) {\n throw new Error(ENGINE_ERROR_GETTING_DOCUMENT);\n }\n // Create test images\n const pngHead = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/';\n const pngEnd = 'AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==';\n const magenta = new Image();\n magenta.src = `${pngHead}AP804Oa6${pngEnd}`;\n const yellow = new Image();\n yellow.src = `${pngHead}/wCKxvRF${pngEnd}`;\n // Create canvas and context\n const canvas = create('CanvasTinter', 6, 1, true);\n const context = canvas.getContext('2d', { willReadFrequently: false });\n if (!context) {\n throw new Error(ENGINE_ERROR_CREATING_CANVAS_2D_CONTEXT);\n }\n // Draw test images to canvas\n context.globalCompositeOperation = 'multiply';\n context.drawImage(magenta, 0, 0);\n context.drawImage(yellow, 2, 0);\n if (!context.getImageData(2, 0, 1, 1)) {\n return false;\n }\n const data = context.getImageData(2, 0, 1, 1).data;\n // Dispose canvas\n try {\n context.reset();\n } catch {\n // pass\n }\n removeByCanvas(canvas);\n // Compare and return\n return data[0] === 255 && data[1] === 0 && data[2] === 0;\n};\n\n/**\n * Creates a new Tinter instance.\n * @param {import('../../core/game.js').Game} game - The game instance.\n */\nexport const detectCapabilities = (game) => {\n if (!window.PhaserRegistry) {\n window.PhaserRegistry = {};\n }\n try {\n window.PhaserRegistry.CAN_CANVAS_USE_MULTIPLY = canUseNewCanvasBlendModes();\n } catch (error) {\n const typedError = error instanceof Error ? error : new Error(String(error));\n game.logger.exception('Tinter', typedError);\n window.PhaserRegistry.CAN_CANVAS_USE_MULTIPLY = false;\n }\n if (!window.PhaserRegistry.CAN_CANVAS_USE_MULTIPLY) {\n // only detect canvas alpha support if tintWithPerPixel will be used\n try {\n window.PhaserRegistry.CAN_CANVAS_HANDLE_ALPHA = checkInverseAlpha();\n } catch (error) {\n const typedError = error instanceof Error ? error : new Error(String(error));\n game.logger.exception('Tinter', typedError);\n window.PhaserRegistry.CAN_CANVAS_HANDLE_ALPHA = false;\n }\n }\n window.PhaserRegistry.CANVAS_TINT_METHOD = window.PhaserRegistry.CAN_CANVAS_USE_MULTIPLY\n ? tintWithMultiply\n : tintWithPerPixel;\n};\n","// @ts-nocheck\nimport { SCALE_LINEAR } from '../core/const.js';\nimport { getIdentityMatrix } from '../geom/util/matrix.js';\nimport { getTintedTexture } from './canvas/tinter.js';\n\n/**\n * Sets the texture of a sprite.\n * @param {import('./image.js').Image} target - The target image to set the texture on.\n * @param {import('./webgl/texture.js').Texture} texture - The new texture to set.\n * @param {boolean} destroyBase - Whether to destroy the base texture.\n */\nexport const setTexture = (target, texture, destroyBase = false) => {\n if (destroyBase) {\n target.texture.baseTexture.destroy();\n }\n target.texture.baseTexture.skipRender = false;\n target.texture = texture;\n target.texture.valid = true;\n target.cachedTint = -1;\n};\n\n/**\n * Gets the bounds of a sprite.\n * @param {import('./image.js').Image} target - The target image to get bounds for.\n * @param {object} matrix - The transformation matrix.\n * @returns {import('../geom/rectangle.js').Rectangle} The bounds rectangle.\n */\nexport const getBounds = (target, matrix = null) => {\n // TODO verify\n if (target.currentBounds) {\n return target.currentBounds;\n }\n const width = target.texture.frame.width;\n const height = target.texture.frame.height;\n let w0 = width * (1 - target.anchor.x);\n let w1 = width * -target.anchor.x;\n let h0 = height * (1 - target.anchor.y);\n let h1 = height * -target.anchor.y;\n const worldTransform = matrix || target.worldTransform;\n let a = worldTransform.a;\n const b = worldTransform.b;\n const c = worldTransform.c;\n let d = worldTransform.d;\n const tx = worldTransform.tx;\n const ty = worldTransform.ty;\n let maxX = -Infinity;\n let maxY = -Infinity;\n let minX = Infinity;\n let minY = Infinity;\n if (b === 0 && c === 0) {\n // scale may be negative!\n if (a < 0) {\n a *= -1;\n const temp = w0;\n w0 = -w1;\n w1 = -temp;\n }\n if (d < 0) {\n d *= -1;\n const temp = h0;\n h0 = -h1;\n h1 = -temp;\n }\n // this means there is no rotation going on right? RIGHT?\n // if thats the case then we can avoid checking the bound values! yay\n minX = a * w1 + tx;\n maxX = a * w0 + tx;\n minY = d * h1 + ty;\n maxY = d * h0 + ty;\n } else {\n const x1 = a * w1 + c * h1 + tx;\n const y1 = d * h1 + b * w1 + ty;\n const x2 = a * w0 + c * h1 + tx;\n const y2 = d * h1 + b * w0 + ty;\n const x3 = a * w0 + c * h0 + tx;\n const y3 = d * h0 + b * w0 + ty;\n const x4 = a * w1 + c * h0 + tx;\n const y4 = d * h0 + b * w1 + ty;\n minX = x1 < minX ? x1 : minX;\n minX = x2 < minX ? x2 : minX;\n minX = x3 < minX ? x3 : minX;\n minX = x4 < minX ? x4 : minX;\n minY = y1 < minY ? y1 : minY;\n minY = y2 < minY ? y2 : minY;\n minY = y3 < minY ? y3 : minY;\n minY = y4 < minY ? y4 : minY;\n maxX = x1 > maxX ? x1 : maxX;\n maxX = x2 > maxX ? x2 : maxX;\n maxX = x3 > maxX ? x3 : maxX;\n maxX = x4 > maxX ? x4 : maxX;\n maxY = y1 > maxY ? y1 : maxY;\n maxY = y2 > maxY ? y2 : maxY;\n maxY = y3 > maxY ? y3 : maxY;\n maxY = y4 > maxY ? y4 : maxY;\n }\n const bounds = target.cachedBounds;\n bounds.x = minX;\n bounds.width = maxX - minX;\n bounds.y = minY;\n bounds.height = maxY - minY;\n target.currentBounds = bounds;\n return bounds;\n};\n\n/**\n * Gets the local bounds of a sprite.\n * @param {import('./image.js').Image} target - The target image to get local bounds for.\n * @returns {import('../geom/rectangle.js').Rectangle} The local bounds rectangle.\n */\nexport const getLocalBounds = (target) => {\n const matrixCache = target.worldTransform;\n target.worldTransform = getIdentityMatrix();\n let i;\n for (i = 0; i < target.children.length; i += 1) {\n target.children[i].updateTransform();\n }\n const bounds = target.getBounds();\n target.worldTransform = matrixCache;\n for (i = 0; i < target.children.length; i += 1) {\n target.children[i].updateTransform();\n }\n return bounds;\n};\n\n/**\n * Renders a sprite using WebGL.\n * @param {import('./image.js').Image} target - The target image to render.\n * @param {object} renderSession - The render session object.\n * @param {import('../geom/matrix.js').Matrix | null | undefined} matrix - The transformation matrix.\n */\nexport const renderWebGL = (target, renderSession, matrix = null) => {\n // if the sprite is not visible or the alpha is 0 then no need to render this element\n if (!target.visible || target.alpha <= 0 || !target.renderable) {\n return;\n }\n // They provided an alternative rendering matrix, so use it\n let wt = target.worldTransform;\n if (matrix) {\n wt = matrix;\n }\n // A quick check to see if this element has a mask or a filter.\n if (target._mask || target._filters) {\n const spriteBatch = renderSession.spriteBatch;\n // push filter first as we need to ensure the stencil buffer is correct for any masking\n if (target._filters) {\n spriteBatch.flush();\n renderSession.filterManager.pushFilter(target._filterBlock);\n }\n if (target._mask) {\n spriteBatch.stop();\n renderSession.maskManager.pushMask(target.mask, renderSession);\n spriteBatch.start();\n }\n // add this sprite to the batch\n spriteBatch.render(target);\n // now loop through the children and make sure they get rendered\n for (let i = 0; i < target.children.length; i += 1) {\n target.children[i].renderWebGL(renderSession);\n }\n // time to stop the sprite batch as either a mask element or a filter draw will happen next\n spriteBatch.stop();\n if (target._mask) renderSession.maskManager.popMask(target._mask, renderSession);\n if (target._filters) renderSession.filterManager.popFilter();\n spriteBatch.start();\n } else {\n renderSession.spriteBatch.render(target);\n // Render children!\n for (let i = 0; i < target.children.length; i += 1) {\n target.children[i].renderWebGL(renderSession, wt);\n }\n }\n};\n\n/**\n * Renders a sprite using Canvas.\n * @param {import('./image.js').Image} target - The target image to render.\n * @param {object} renderSession - The render session object.\n * @param {import('../geom/matrix.js').Matrix | null | undefined} matrix - The transformation matrix.\n */\nexport const renderCanvas = (target, renderSession, matrix = null) => {\n // If the sprite is not visible or the alpha is 0 then no need to render this element\n if (\n !target.visible ||\n target.alpha === 0 ||\n !target.renderable ||\n target.texture.crop.width <= 0 ||\n target.texture.crop.height <= 0\n ) {\n return;\n }\n let wt = target.worldTransform;\n // If they provided an alternative rendering matrix then use it\n if (matrix) {\n wt = matrix;\n }\n if (target.blendMode !== renderSession.currentBlendMode) {\n renderSession.currentBlendMode = target.blendMode;\n renderSession.context.globalCompositeOperation =\n window.PhaserRegistry.blendModesCanvas[renderSession.currentBlendMode];\n }\n if (target._mask) {\n renderSession.maskManager.pushMask(target._mask, renderSession);\n }\n // Ignore null sources\n if (target.texture.valid) {\n const resolution = target.texture.baseTexture.resolution / renderSession.resolution;\n renderSession.context.globalAlpha = target.worldAlpha;\n\n // If smoothingEnabled is supported and we need to change the smoothing property for this texture\n if (renderSession.smoothProperty && renderSession.scaleMode !== target.texture.baseTexture.scaleMode) {\n renderSession.scaleMode = target.texture.baseTexture.scaleMode;\n renderSession.context[renderSession.smoothProperty] = renderSession.scaleMode === SCALE_LINEAR;\n }\n // If the texture is trimmed we offset by the trim x/y, otherwise we use the frame dimensions\n let dx = target.texture.trim\n ? target.texture.trim.x - target.anchor.x * target.texture.trim.width\n : target.anchor.x * -target.texture.frame.width;\n let dy = target.texture.trim\n ? target.texture.trim.y - target.anchor.y * target.texture.trim.height\n : target.anchor.y * -target.texture.frame.height;\n const tx = wt.tx * renderSession.resolution + renderSession.shakeX;\n const ty = wt.ty * renderSession.resolution + renderSession.shakeY;\n // Allow for pixel rounding\n if (renderSession.roundPixels) {\n renderSession.context.setTransform(wt.a, wt.b, wt.c, wt.d, tx | 0, ty | 0);\n dx |= 0;\n dy |= 0;\n } else {\n renderSession.context.setTransform(wt.a, wt.b, wt.c, wt.d, tx, ty);\n }\n let cw = target.texture.crop.width;\n let ch = target.texture.crop.height;\n dx /= resolution;\n dy /= resolution;\n if (target.tint !== 0xffffff) {\n if (target.texture.requiresReTint || target.cachedTint !== target.tint) {\n target.tintedTexture = getTintedTexture(target, target.tint);\n target.cachedTint = target.tint;\n target.texture.requiresReTint = false;\n }\n renderSession.context.drawImage(target.tintedTexture, 0, 0, cw, ch, dx, dy, cw / resolution, ch / resolution);\n } else {\n const cx = target.texture.crop.x;\n const cy = target.texture.crop.y;\n // https://github.com/photonstorm/phaser-ce/pull/61\n cw = Math.floor(cw);\n ch = Math.floor(ch);\n renderSession.context.drawImage(\n target.texture.baseTexture.source,\n cx,\n cy,\n cw,\n ch,\n dx,\n dy,\n cw / resolution,\n ch / resolution\n );\n }\n }\n for (let i = 0; i < target.children.length; i += 1) {\n target.children[i].renderCanvas(renderSession);\n }\n if (target._mask) {\n renderSession.maskManager.popMask(renderSession);\n }\n};\n","// @ts-nocheck\nimport { Matrix } from '../geom/matrix.js';\nimport { Point } from '../geom/point.js';\nimport { Rectangle } from '../geom/rectangle.js';\nimport { getIdentityMatrix } from '../geom/util/matrix.js';\nimport { PI_2 } from '../util/math.js';\nimport { renderCanvas, renderWebGL } from './sprite_util.js';\n\nexport class DisplayObject {\n /**\n * Creates a new DisplayObject instance.\n * @param {import('../core/game.js').Game} game - The game instance this display object belongs to.\n */\n constructor(game) {\n /** @type {boolean} */\n this.exists = true;\n /** @type {boolean} */\n this.renderable = false;\n /** @type {boolean} */\n this.visible = true;\n /** @type {Point} */\n this.position = new Point(0, 0);\n /** @type {Point} */\n this.scale = new Point(1, 1);\n /** @type {Point} */\n this.pivot = new Point(0, 0);\n /** @type {Point} */\n this.anchor = new Point(0, 0);\n /** @type {number} */\n this.rotation = 0;\n /** @type {number} */\n this.alpha = 1;\n /** @type {Rectangle} */\n this.hitArea = null;\n /** @type {DisplayObject} */\n this.parent = null;\n /** @type {number} */\n this.worldAlpha = 1;\n /** @type {Matrix} */\n this.worldTransform = new Matrix();\n // this.worldPosition = new Point(0, 0);\n /** @type {Point} */\n this.worldScale = new Point(1, 1);\n // this.worldRotation = 0;\n /** @type {Rectangle} */\n this.filterArea = null;\n /** @type {number} */\n this._sr = 0;\n /** @type {number} */\n this._cr = 1;\n /** @type {Rectangle} */\n this.cachedBounds = new Rectangle(0, 0, 0, 0);\n /** @type {Rectangle} */\n this.currentBounds = null;\n /** @type {import('./graphics.js').Graphics} */\n this._mask = null;\n /** @type {object[]} */\n this._filters = null;\n /** @type {object} */\n this._filterBlock = null;\n this.children = [];\n /** @type {boolean} */\n this.ignoreChildInput = false;\n /** @type {string | null } */\n this.name = this.name ?? null;\n /** @type {object | null } */\n this.data = this.data ?? null;\n /** @type {import('../core/game.js').Game } */\n this.game = game;\n }\n\n /**\n * Destroys this display object and cleans up resources.\n */\n destroy() {\n if (this.children) {\n let i = this.children.length;\n while (i) {\n i -= 1;\n this.children[i].destroy();\n }\n }\n this.children = null;\n this.exists = false;\n this.renderable = false;\n this.visible = false;\n // TODO: investigate how to clean up properly object references without breaking delayed tween cleanups.\n /*\n this.position = null;\n this.scale = null;\n this.pivot = null;\n this.anchor = null;\n */\n this.hitArea = null;\n this.parent = null;\n this.worldTransform = null;\n // this.worldPosition = null;\n this.worldScale = null;\n this.filterArea = null;\n this.cachedBounds = null;\n this.currentBounds = null;\n this._mask = null;\n this.destroyCachedSprite();\n }\n\n /**\n * Adds a child display object to this container.\n * @param {DisplayObject} child - The child display object to add.\n * @returns {DisplayObject} The added child display object.\n */\n addChild(child) {\n return this.addChildAt(child, this.children.length);\n }\n\n /**\n * Adds a child display object at a specific index in the children list.\n * @param {DisplayObject} child - The child display object to add.\n * @param {number} index - The index to insert the child at.\n * @returns {DisplayObject} The added child display object.\n * @throws {Error} If the index is out of bounds.\n */\n addChildAt(child, index) {\n if (index >= 0 && index <= this.children.length) {\n if (child.parent) {\n child.parent.removeChild(child);\n }\n child.parent = this;\n this.children.splice(index, 0, child);\n return child;\n }\n throw new Error(`${child}addChildAt: The index ${index} supplied is out of bounds ${this.children.length}`);\n }\n\n /**\n * Swaps the positions of two child display objects.\n * @param {DisplayObject} child - The first child display object.\n * @param {DisplayObject} child2 - The second child display object.\n * @throws {Error} If either child is not a child of this container.\n */\n swapChildren(child, child2) {\n if (child === child2) {\n return;\n }\n const index1 = this.getChildIndex(child);\n const index2 = this.getChildIndex(child2);\n if (index1 < 0 || index2 < 0) {\n throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller');\n }\n this.children[index1] = child2;\n this.children[index2] = child;\n }\n\n /**\n * Gets the index of a child display object in the children list.\n * @param {DisplayObject} child - The child display object to find.\n * @returns {number} The index of the child in the children list.\n * @throws {Error} If the child is not a child of this container.\n */\n getChildIndex(child) {\n const index = this.children.indexOf(child);\n if (index === -1) {\n throw new Error('The supplied DisplayObject must be a child of the caller');\n }\n return index;\n }\n\n /**\n * Sets the index of a child display object in the children list.\n * @param {DisplayObject} child - The child display object to move.\n * @param {number} index - The new index for the child.\n * @throws {Error} If the index is out of bounds.\n */\n setChildIndex(child, index) {\n if (index < 0 || index >= this.children.length) {\n throw new Error('The supplied index is out of bounds');\n }\n const currentIndex = this.getChildIndex(child);\n this.children.splice(currentIndex, 1); // remove from old position\n this.children.splice(index, 0, child); // add at new position\n }\n\n /**\n * Gets a child display object at a specific index.\n * @param {number} index - The index of the child to get.\n * @returns {DisplayObject} The child display object at the specified index.\n * @throws {Error} If the index is out of bounds.\n */\n getChildAt(index) {\n if (index < 0 || index >= this.children.length) {\n throw new Error(\n `getChildAt: Supplied index ${\n index\n } does not exist in the child list, or the supplied DisplayObject must be a child of the caller`\n );\n }\n return this.children[index];\n }\n\n /**\n * Removes a child display object from this container.\n * @param {DisplayObject} child - The child display object to remove.\n * @returns {DisplayObject} The removed child display object.\n */\n removeChild(child) {\n const index = this.children.indexOf(child);\n if (index === -1) {\n return null;\n }\n return this.removeChildAt(index);\n }\n\n /**\n * Removes a child display object at a specific index.\n * @param {number} index - The index of the child to remove.\n * @returns {DisplayObject} The removed child display object.\n */\n removeChildAt(index) {\n const child = this.getChildAt(index);\n if (child) {\n child.parent = undefined;\n this.children.splice(index, 1);\n }\n return child;\n }\n\n /**\n * Removes a range of child display objects from this container.\n * @param {number} beginIndex - The starting index of the range to remove.\n * @param {number} endIndex - The ending index (exclusive) of the range to remove.\n * @returns {DisplayObject[]} The array of removed child display objects.\n * @throws {Error} If the range is invalid.\n */\n removeChildren(beginIndex, endIndex) {\n if (beginIndex === undefined) {\n beginIndex = 0;\n }\n if (endIndex === undefined) {\n endIndex = this.children.length;\n }\n const range = endIndex - beginIndex;\n if (range > 0 && range <= endIndex) {\n const removed = this.children.splice(beginIndex, range);\n for (let i = 0; i < removed.length; i += 1) {\n const child = removed[i];\n child.parent = undefined;\n }\n return removed;\n }\n if (range === 0 && this.children.length === 0) {\n return [];\n }\n throw new Error('removeChildren: Range Error, numeric values are outside the acceptable range');\n }\n\n /**\n * Updates the world transform of this display object and its children.\n * @param {DisplayObject | null | undefined} parent - The parent display object to use for the world transform calculation.\n * @returns {DisplayObject} This DisplayObject instance for chaining.\n */\n updateTransform(parent = null) {\n if (!parent && !this.parent) {\n return this;\n }\n if (!this.game || !this.visible) {\n return this;\n }\n let p = this.parent;\n if (parent) {\n p = parent;\n } else if (!this.parent) {\n p = this.game.world;\n }\n // create some matrix refs for easy access\n const pt = p.worldTransform;\n const wt = this.worldTransform;\n // temporary matrix variables\n let a;\n let b;\n let c;\n let d;\n let tx;\n let ty;\n // so if rotation is between 0 then we can simplify the multiplication process..\n if (this.rotation % PI_2) {\n // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes\n if (this.rotation !== this.rotationCache) {\n this.rotationCache = this.rotation;\n this._sr = Math.sin(this.rotation);\n this._cr = Math.cos(this.rotation);\n }\n // get the matrix values of the displayobject based on its transform properties..\n a = this._cr * this.scale.x;\n b = this._sr * this.scale.x;\n c = -this._sr * this.scale.y;\n d = this._cr * this.scale.y;\n tx = this.position.x;\n ty = this.position.y;\n // check for pivot.. not often used so geared towards that fact!\n if (this.pivot.x || this.pivot.y) {\n tx -= this.pivot.x * a + this.pivot.y * c;\n ty -= this.pivot.x * b + this.pivot.y * d;\n }\n // concat the parent matrix with the objects transform.\n wt.a = a * pt.a + b * pt.c;\n wt.b = a * pt.b + b * pt.d;\n wt.c = c * pt.a + d * pt.c;\n wt.d = c * pt.b + d * pt.d;\n wt.tx = tx * pt.a + ty * pt.c + pt.tx;\n wt.ty = tx * pt.b + ty * pt.d + pt.ty;\n } else {\n // lets do the fast version as we know there is no rotation..\n a = this.scale.x;\n d = this.scale.y;\n tx = this.position.x - this.pivot.x * a;\n ty = this.position.y - this.pivot.y * d;\n wt.a = a * pt.a;\n wt.b = a * pt.b;\n wt.c = d * pt.c;\n wt.d = d * pt.d;\n wt.tx = tx * pt.a + ty * pt.c + pt.tx;\n wt.ty = tx * pt.b + ty * pt.d + pt.ty;\n }\n // Set the World values\n this.worldAlpha = this.alpha * p.worldAlpha;\n // this.worldPosition.setTo(wt.tx, wt.ty);\n this.worldScale.setTo(\n this.scale.x * Math.sqrt(wt.a * wt.a + wt.c * wt.c),\n this.scale.y * Math.sqrt(wt.b * wt.b + wt.d * wt.d)\n );\n this.worldRotation = Math.atan2(-wt.c, wt.d);\n // reset the bounds each time this is called!\n this.currentBounds = null;\n // Custom callback?\n if (this.transformCallback) {\n this.transformCallback.call(this.transformCallbackContext, wt, pt);\n }\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].updateTransform();\n }\n return this;\n }\n\n /**\n * Gets the bounds of this display object in world coordinates.\n * @param {DisplayObject} targetCoordinateSpace - The coordinate space to calculate bounds in.\n * @returns {Rectangle} The bounds rectangle of this display object.\n */\n getBounds(targetCoordinateSpace) {\n const isTargetCoordinateSpaceDisplayObject = targetCoordinateSpace && targetCoordinateSpace.contains !== undefined;\n let isTargetCoordinateSpaceThisOrParent = true;\n if (!isTargetCoordinateSpaceDisplayObject) {\n targetCoordinateSpace = this;\n } else if (targetCoordinateSpace.contains !== undefined) {\n isTargetCoordinateSpaceThisOrParent = targetCoordinateSpace.contains(this);\n } else {\n isTargetCoordinateSpaceThisOrParent = false;\n }\n let i;\n let matrixCache;\n if (isTargetCoordinateSpaceDisplayObject) {\n matrixCache = targetCoordinateSpace.worldTransform;\n targetCoordinateSpace.worldTransform = getIdentityMatrix();\n for (i = 0; i < targetCoordinateSpace.children.length; i += 1) {\n targetCoordinateSpace.children[i].updateTransform();\n }\n }\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n let childBounds;\n let childMaxX;\n let childMaxY;\n let childVisible = false;\n for (i = 0; i < this.children.length; i += 1) {\n const child = this.children[i];\n if (child.visible) {\n childVisible = true;\n childBounds = this.children[i].getBounds();\n minX = minX < childBounds.x ? minX : childBounds.x;\n minY = minY < childBounds.y ? minY : childBounds.y;\n childMaxX = childBounds.width + childBounds.x;\n childMaxY = childBounds.height + childBounds.y;\n maxX = maxX > childMaxX ? maxX : childMaxX;\n maxY = maxY > childMaxY ? maxY : childMaxY;\n }\n }\n let bounds = this.cachedBounds;\n if (!childVisible) {\n bounds = new Rectangle();\n const w0 = bounds.x;\n const w1 = bounds.width + bounds.x;\n const h0 = bounds.y;\n const h1 = bounds.height + bounds.y;\n const worldTransform = this.worldTransform;\n const a = worldTransform.a;\n const b = worldTransform.b;\n const c = worldTransform.c;\n const d = worldTransform.d;\n const tx = worldTransform.tx;\n const ty = worldTransform.ty;\n const x1 = a * w1 + c * h1 + tx;\n const y1 = d * h1 + b * w1 + ty;\n const x2 = a * w0 + c * h1 + tx;\n const y2 = d * h1 + b * w0 + ty;\n const x3 = a * w0 + c * h0 + tx;\n const y3 = d * h0 + b * w0 + ty;\n const x4 = a * w1 + c * h0 + tx;\n const y4 = d * h0 + b * w1 + ty;\n maxX = x1;\n maxY = y1;\n minX = x1;\n minY = y1;\n minX = x2 < minX ? x2 : minX;\n minX = x3 < minX ? x3 : minX;\n minX = x4 < minX ? x4 : minX;\n minY = y2 < minY ? y2 : minY;\n minY = y3 < minY ? y3 : minY;\n minY = y4 < minY ? y4 : minY;\n maxX = x2 > maxX ? x2 : maxX;\n maxX = x3 > maxX ? x3 : maxX;\n maxX = x4 > maxX ? x4 : maxX;\n maxY = y2 > maxY ? y2 : maxY;\n maxY = y3 > maxY ? y3 : maxY;\n maxY = y4 > maxY ? y4 : maxY;\n }\n bounds.x = minX;\n bounds.y = minY;\n bounds.width = maxX - minX;\n bounds.height = maxY - minY;\n if (isTargetCoordinateSpaceDisplayObject) {\n targetCoordinateSpace.worldTransform = matrixCache;\n for (i = 0; i < targetCoordinateSpace.children.length; i += 1) {\n targetCoordinateSpace.children[i].updateTransform();\n }\n }\n if (!isTargetCoordinateSpaceThisOrParent) {\n const targetCoordinateSpaceBounds = targetCoordinateSpace.getBounds();\n bounds.x -= targetCoordinateSpaceBounds.x;\n bounds.y -= targetCoordinateSpaceBounds.y;\n }\n return bounds;\n }\n\n /**\n * Gets the bounds of this display object in local coordinates.\n * @returns {Rectangle} The bounds rectangle of this display object in local space.\n */\n getLocalBounds() {\n return this.getBounds(this);\n }\n\n /**\n * Checks if a child display object is contained within this container.\n * @param {DisplayObject} child - The child display object to check.\n * @returns {boolean} True if the child is contained within this container, false otherwise.\n */\n contains(child) {\n if (!child) {\n return false;\n }\n if (child === this) {\n return true;\n }\n return this.contains(child.parent);\n }\n\n /**\n * Renders this display object using WebGL.\n * @param {object} renderSession - The WebGL rendering session.\n */\n renderWebGL(renderSession) {\n if (!this.visible || this.alpha <= 0) {\n return;\n }\n let i;\n if (this._mask || this._filters) {\n // push filter first as we need to ensure the stencil buffer is correct for any masking\n if (this._filters) {\n renderSession.spriteBatch.flush();\n renderSession.filterManager.pushFilter(this._filterBlock);\n }\n if (this._mask) {\n renderSession.spriteBatch.stop();\n renderSession.maskManager.pushMask(this.mask, renderSession);\n renderSession.spriteBatch.start();\n }\n for (i = 0; i < this.children.length; i += 1) {\n this.children[i].renderWebGL(renderSession);\n }\n renderSession.spriteBatch.stop();\n if (this._mask) renderSession.maskManager.popMask(this._mask, renderSession);\n if (this._filters) renderSession.filterManager.popFilter();\n renderSession.spriteBatch.start();\n } else {\n for (i = 0; i < this.children.length; i += 1) {\n this.children[i].renderWebGL(renderSession);\n }\n }\n }\n\n /**\n * Renders this display object using Canvas.\n * @param {object} renderSession - The Canvas rendering session.\n */\n renderCanvas(renderSession) {\n if (!this.visible || this.alpha <= 0) {\n return;\n }\n if (this._mask) {\n renderSession.maskManager.pushMask(this._mask, renderSession);\n }\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].renderCanvas(renderSession);\n }\n if (this._mask) {\n renderSession.maskManager.popMask(renderSession);\n }\n }\n\n /**\n * Called before the update cycle for this display object.\n */\n preUpdate() {\n // override\n }\n\n /**\n * Called during the update cycle for this display object.\n */\n update() {\n // override\n }\n\n /**\n * Called after the update cycle for this display object.\n */\n postUpdate() {\n // override\n }\n\n /**\n * Generates a texture for this display object.\n * @throws {Error} This method is not implemented yet.\n */\n generateTexture() {\n // TODO\n throw new Error('display_object.generateTexture() is not implemented');\n }\n\n /**\n * Converts a local position to global (world) coordinates.\n * @param {Point} position - The local position to convert.\n * @returns {Point} The converted global position.\n */\n toGlobal(position) {\n this.updateTransform();\n return this.worldTransform.apply(position);\n }\n\n /**\n * Converts a global (world) position to local coordinates.\n * @param {Point} position - The global position to convert.\n * @param {DisplayObject} from - The display object to convert from (defaults to this).\n * @returns {Point} The converted local position.\n */\n toLocal(position, from) {\n if (from) {\n position = from.toGlobal(position);\n }\n this.updateTransform();\n return this.worldTransform.applyInverse(position);\n }\n\n /**\n * Renders a cached sprite for this display object.\n * @param {object} renderSession - The rendering session.\n */\n renderCachedSprite(renderSession) {\n if (!this._cachedSprite) {\n return;\n }\n this._cachedSprite.worldAlpha = this.worldAlpha;\n if (renderSession.gl) {\n renderWebGL(this._cachedSprite, renderSession);\n } else {\n renderCanvas(this._cachedSprite, renderSession);\n }\n }\n\n /**\n * Generates a cached sprite for this display object.\n */\n generateCachedSprite() {\n // TODO\n }\n\n /**\n * Destroys the cached sprite for this display object.\n */\n destroyCachedSprite() {\n if (!this._cachedSprite) {\n return;\n }\n this._cachedSprite.texture.destroy(true);\n this._cachedSprite = null;\n }\n\n // GETTER SETTER\n\n /**\n * Gets the width of this display object.\n * @returns {number} The width in pixels.\n */\n get width() {\n return this.getLocalBounds().width * this.scale.x;\n }\n\n /**\n * Sets the width of this display object.\n * @param {number} value - The new width in pixels.\n */\n set width(value) {\n const width = this.getLocalBounds().width;\n if (width !== 0) {\n this.scale.x = value / width;\n } else {\n this.scale.x = 1;\n }\n this._width = value;\n }\n\n /**\n * Gets the height of this display object.\n * @returns {number} The height in pixels.\n */\n get height() {\n return this.getLocalBounds().height * this.scale.y;\n }\n\n /**\n * Sets the height of this display object.\n * @param {number} value - The new height in pixels.\n */\n set height(value) {\n const height = this.getLocalBounds().height;\n if (height !== 0) {\n this.scale.y = value / height;\n } else {\n this.scale.y = 1;\n }\n this._height = value;\n }\n\n /**\n * Gets the x position of this display object.\n * @returns {number} The x position in pixels.\n */\n get x() {\n return this.position.x;\n }\n\n /**\n * Sets the x position of this display object.\n * @param {number} value - The new x position in pixels.\n */\n set x(value) {\n this.position.x = value;\n }\n\n /**\n * Gets the y position of this display object.\n * @returns {number} The y position in pixels.\n */\n get y() {\n return this.position.y;\n }\n\n /**\n * Sets the y position of this display object.\n * @param {number} value - The new y position in pixels.\n */\n set y(value) {\n this.position.y = value;\n }\n\n /**\n * Gets whether this display object is visible in the world.\n * @returns {boolean} True if the object is visible, false otherwise.\n */\n get worldVisible() {\n if (!this.visible) {\n return false;\n }\n let item = this.parent;\n if (!item) {\n return this.visible;\n }\n do {\n if (!item.visible) {\n return false;\n }\n item = item.parent;\n } while (item);\n return true;\n }\n\n // MASK\n\n /**\n * Gets the mask for this display object.\n * @returns {import('./graphics.js').Graphics} The mask object or null if none is set.\n */\n get mask() {\n return this._mask;\n }\n\n /**\n * Sets the mask for this display object.\n * @param {import('./graphics.js').Graphics} value - The mask object to set, or null to remove the mask.\n */\n set mask(value) {\n if (this._mask) {\n this._mask.isMask = false;\n }\n this._mask = value;\n if (value) {\n this._mask.isMask = true;\n }\n }\n\n // BOUNDS\n\n /**\n * Gets the x offset for this display object (based on anchor point).\n * @returns {number} The x offset in pixels.\n */\n get offsetX() {\n return this.anchor.x * this.width;\n }\n\n /**\n * Gets the y offset for this display object (based on anchor point).\n * @returns {number} The y offset in pixels.\n */\n get offsetY() {\n return this.anchor.y * this.height;\n }\n\n /**\n * Gets the center x position of this display object.\n * @returns {number} The center x position in pixels.\n */\n get centerX() {\n return this.x - this.offsetX + this.width * 0.5;\n }\n\n /**\n * Sets the center x position of this display object.\n * @param {number} value - The new center x position in pixels.\n */\n set centerX(value) {\n this.x = value + this.offsetX - this.width * 0.5;\n }\n\n /**\n * Gets the center y position of this display object.\n * @returns {number} The center y position in pixels.\n */\n get centerY() {\n return this.y - this.offsetY + this.height * 0.5;\n }\n\n /**\n * Sets the center y position of this display object.\n * @param {number} value - The new center y position in pixels.\n */\n set centerY(value) {\n this.y = value + this.offsetY - this.height * 0.5;\n }\n\n /**\n * Gets the left x position of this display object.\n * @returns {number} The left x position in pixels.\n */\n get left() {\n return this.x - this.offsetX;\n }\n\n /**\n * Sets the left x position of this display object.\n * @param {number} value - The new left x position in pixels.\n */\n set left(value) {\n this.x = value + this.offsetX;\n }\n\n /**\n * Gets the right x position of this display object.\n * @returns {number} The right x position in pixels.\n */\n get right() {\n return this.x + this.width - this.offsetX;\n }\n\n /**\n * Sets the right x position of this display object.\n * @param {number} value - The new right x position in pixels.\n */\n set right(value) {\n this.x = value - this.width + this.offsetX;\n }\n\n /**\n * Gets the top y position of this display object.\n * @returns {number} The top y position in pixels.\n */\n get top() {\n return this.y - this.offsetY;\n }\n\n /**\n * Sets the top y position of this display object.\n * @param {number} value - The new top y position in pixels.\n */\n set top(value) {\n this.y = value + this.offsetY;\n }\n\n /**\n * Gets the bottom y position of this display object.\n * @returns {number} The bottom y position in pixels.\n */\n get bottom() {\n return this.y + this.height - this.offsetY;\n }\n\n /**\n * Sets the bottom y position of this display object.\n * @param {number} value - The new bottom y position in pixels.\n */\n set bottom(value) {\n this.y = value - this.height + this.offsetY;\n }\n}\n","export class SignalBinding {\n _signal: any;\n _listener: any;\n _args: any;\n _priority: number;\n _isOnce: boolean;\n context: any;\n callCount: number;\n active: boolean;\n params: any;\n\n /**\n * TBD.\n * @param {import('./signal.js').Signal} signal - TBD.\n * @param {Function} listener - TBD.\n * @param {boolean} isOnce - TBD.\n * @param {object} listenerContext - TBD.\n * @param {number} priority - TBD.\n * @param {...any} args - TBD.\n */\n constructor(signal, listener, isOnce = false, listenerContext = null, priority = 0, args = null) {\n this._signal = signal;\n this._listener = listener;\n this._args = args;\n this._priority = priority;\n this._isOnce = isOnce;\n this.context = listenerContext;\n this.callCount = 0;\n this.active = true;\n this.params = null;\n }\n\n /**\n * TBD.\n * @param {any[]} paramsArr - TBD.\n * @returns {Function} TBD.\n */\n execute(paramsArr) {\n let handlerReturn;\n let params;\n if (this.active && !!this._listener) {\n params = this.params ? this.params.concat(paramsArr) : paramsArr;\n if (this._args) {\n params = params.concat(this._args);\n }\n handlerReturn = this._listener.apply(this.context, params);\n this.callCount += 1;\n if (this._isOnce) {\n this.detach();\n }\n }\n return handlerReturn;\n }\n\n /**\n * TBD.\n * @returns {Function} TBD.\n */\n detach() {\n return this.isBound() ? this._signal.remove(this._listener, this.context) : null;\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n isBound() {\n return !!this._signal && !!this._listener;\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n isOnce() {\n return this._isOnce;\n }\n\n /**\n * TBD.\n * @returns {Function} TBD.\n */\n getListener() {\n return this._listener;\n }\n\n /**\n * TBD.\n * @returns {import('./signal.js').Signal} TBD.\n */\n getSignal() {\n return this._signal;\n }\n\n /**\n * TBD.\n */\n _destroy() {\n delete this._signal;\n delete this._listener;\n delete this.context;\n }\n\n /**\n * TBD.\n * @returns {string} TBD.\n */\n toString() {\n return `[SignalBinding isOnce:${this._isOnce}, isBound:${this.isBound()}, active:${this.active}]`;\n }\n}\n","import { SignalBinding } from './signal_binding.js';\n\nexport class Signal {\n _bindings: any;\n _prevParams: any;\n memorize: boolean;\n _shouldPropagate: boolean;\n active: boolean;\n _boundDispatch: any;\n\n /**\n * Creates a new Signal instance.\n * A Signal is a simple event system that allows you to dispatch events and listen for them.\n */\n constructor() {\n this._bindings = null;\n this._prevParams = null;\n this.memorize = false;\n this._shouldPropagate = true;\n this.active = true;\n this._boundDispatch = null;\n }\n\n /**\n * Validates that a listener is a function.\n * @param {Function} listener - The listener to validate.\n * @param {string} fnName - The name of the function this validation is for.\n * @throws {Error} If the listener is not a function.\n */\n validateListener(listener, fnName) {\n if (typeof listener !== 'function') {\n throw new TypeError(\n 'Signal: listener is a required param of {fn}() and should be a Function.'.replace('{fn}', fnName)\n );\n }\n }\n\n /**\n * Register a new listener with the signal.\n * @param {Function} listener - The function to call when the signal is dispatched.\n * @param {boolean} isOnce - Whether the listener should only be called once.\n * @param {object} listenerContext - The context to apply when calling the listener.\n * @param {number} priority - The priority of this listener (higher numbers execute first).\n * @param {...any} args - Additional arguments to pass to the listener.\n * @returns {SignalBinding} The binding for this listener.\n * @throws {Error} If the listener is already registered with a different once setting.\n */\n _registerListener(listener, isOnce = false, listenerContext = null, priority = 0, args = null) {\n const prevIndex = this._indexOfListener(listener, listenerContext);\n let binding;\n if (prevIndex !== -1) {\n binding = this._bindings[prevIndex];\n if (binding.isOnce() !== isOnce) {\n throw new Error(\n `You cannot add${isOnce ? '' : 'Once'}() then add${\n !isOnce ? '' : 'Once'\n }() the same listener without removing the relationship first.`\n );\n }\n } else {\n binding = new SignalBinding(this, listener, isOnce, listenerContext, priority, args);\n this._addBinding(binding);\n }\n if (this.memorize && this._prevParams) {\n binding.execute(this._prevParams);\n }\n return binding;\n }\n\n /**\n * Add a binding to the list of listeners.\n * @param {SignalBinding} binding - The binding to add.\n */\n _addBinding(binding) {\n if (!this._bindings) {\n this._bindings = [];\n }\n // Simplified insertion sort\n let n = this._bindings.length;\n do {\n n -= 1;\n } while (this._bindings[n] && binding._priority <= this._bindings[n]._priority);\n this._bindings.splice(n + 1, 0, binding);\n }\n\n /**\n * Find the index of a listener in the bindings array.\n * @param {Function} listener - The listener to find.\n * @param {object} context - The context of the listener.\n * @returns {number} The index of the listener in the bindings array, or -1 if not found.\n */\n _indexOfListener(listener, context = null) {\n if (!this._bindings) {\n return -1;\n }\n let n = this._bindings.length;\n let cur;\n while (n) {\n n -= 1;\n cur = this._bindings[n];\n if (cur._listener === listener && cur.context === context) {\n return n;\n }\n }\n return -1;\n }\n\n /**\n * Check if a listener is registered with the signal.\n * @param {Function} listener - The listener to check.\n * @param {object} context - The context of the listener.\n * @returns {boolean} True if the listener is registered, false otherwise.\n */\n has(listener, context = null) {\n return this._indexOfListener(listener, context) !== -1;\n }\n\n /**\n * Add a listener that will be called every time the signal is dispatched.\n * @param {Function} listener - The function to call when the signal is dispatched.\n * @param {object} listenerContext - The context to apply when calling the listener.\n * @param {number} priority - The priority of this listener (higher numbers execute first).\n * @param {...any} args - Additional arguments to pass to the listener.\n * @returns {SignalBinding} The binding for this listener.\n */\n add(listener, listenerContext = null, priority = 0, ...args) {\n this.validateListener(listener, 'add');\n return this._registerListener(listener, false, listenerContext, priority, args);\n }\n\n /**\n * Add a listener that will be called only once when the signal is dispatched.\n * @param {Function} listener - The function to call when the signal is dispatched.\n * @param {object} listenerContext - The context to apply when calling the listener.\n * @param {number} priority - The priority of this listener (higher numbers execute first).\n * @param {...any} args - Additional arguments to pass to the listener.\n * @returns {SignalBinding} The binding for this listener.\n */\n addOnce(listener, listenerContext = null, priority = 0, ...args) {\n this.validateListener(listener, 'addOnce');\n return this._registerListener(listener, true, listenerContext, priority, args);\n }\n\n /**\n * Remove a listener from the signal.\n * @param {Function} listener - The listener to remove.\n * @param {object} context - The context of the listener.\n * @returns {Function} The removed listener function.\n */\n remove(listener, context = null) {\n this.validateListener(listener, 'remove');\n const i = this._indexOfListener(listener, context);\n if (i !== -1) {\n // no reason to a SignalBinding exist if it isn't attached to a signal\n this._bindings[i]._destroy();\n this._bindings.splice(i, 1);\n }\n return listener;\n }\n\n /**\n * Remove all listeners from the signal, or only those in a specific context.\n * @param {object} context - The context to filter listeners by, or null to remove all.\n */\n removeAll(context = null) {\n if (!this._bindings) {\n return;\n }\n let n = this._bindings.length;\n while (n) {\n n -= 1;\n if (context) {\n if (this._bindings[n].context === context) {\n this._bindings[n]._destroy();\n this._bindings.splice(n, 1);\n }\n } else {\n this._bindings[n]._destroy();\n }\n }\n if (!context) {\n this._bindings.length = 0;\n }\n }\n\n /**\n * Get the number of listeners registered with the signal.\n * @returns {number} The number of registered listeners.\n */\n getNumListeners() {\n return this._bindings ? this._bindings.length : 0;\n }\n\n /**\n * Stop the signal from propagating to other listeners.\n * This method prevents any remaining listeners from being called.\n */\n halt() {\n this._shouldPropagate = false;\n }\n\n /**\n * Dispatch the signal to all registered listeners.\n * @param {...any} args - Arguments to pass to the listeners.\n */\n dispatch(...args) {\n if (!this.active || !this._bindings) {\n return;\n }\n const paramsArr = args.slice();\n let n = this._bindings.length;\n\n if (this.memorize) {\n this._prevParams = paramsArr;\n }\n if (!n) {\n // Should come after memorize\n return;\n }\n const bindings = this._bindings.slice(); // clone array in case add/remove items during dispatch\n this._shouldPropagate = true; // in case `halt` was called before dispatch or during the previous dispatch.\n\n // execute all callbacks until end of the list or until a callback returns `false` or stops propagation\n // reverse loop since listeners with higher priority will be added at the end of the list\n do {\n n -= 1;\n } while (bindings[n] && this._shouldPropagate && bindings[n].execute(paramsArr) !== false);\n }\n\n /**\n * Clear any previously memorized arguments.\n * This removes the stored arguments from a previous dispatch.\n */\n forget() {\n if (this._prevParams) {\n this._prevParams = null;\n }\n }\n\n /**\n * Dispose of the signal and clean up all resources.\n * This method removes all listeners and clears internal state.\n */\n dispose() {\n this.removeAll();\n this.forget();\n this._bindings = null;\n }\n\n /**\n * Get a string representation of the signal.\n * @returns {string} A string representation of the signal.\n */\n toString() {\n return `[Signal active:${this.active} numListeners:${this.getNumListeners()}]`;\n }\n\n /**\n * Get a bound version of the dispatch function.\n * @returns {Function} A function that will dispatch the signal with the correct context.\n */\n get boundDispatch() {\n const _this = this;\n if (!this._boundDispatch) {\n this._boundDispatch = (...rest) => _this.dispatch(...rest);\n }\n return this._boundDispatch;\n }\n\n /**\n * Promisify the Signal.\n * @returns {Promise<any>} The resolved result.\n */\n toPromise() {\n return new Promise((resolve) => {\n this.addOnce((...args) => {\n resolve(args.length <= 1 ? args[0] : args);\n }, this);\n });\n }\n}\n","// @ts-nocheck\nimport { Signal } from './signal.js';\n\nexport class Animation {\n /**\n * Creates a new Animation instance.\n * @param {import('./game.js').Game} game - The game instance this animation belongs to.\n * @param {import('../display/image.js').Image} parent - The Image object that owns this animation.\n * @param {string} name - The unique name of this animation.\n * @param {import('./frame_data.js').FrameData} frameData - The FrameData object that contains the frames for this animation.\n * @param {string[]|number[]} frames - An array of frame identifiers (names or indices) to use in this animation.\n * @param {number} frameRate - The frame rate at which this animation should play (frames per second).\n * @param {boolean} loop - Whether the animation should loop when it completes.\n */\n constructor(game, parent, name, frameData, frames, frameRate, loop = false) {\n /** @type {import('./game.js').Game} */\n this.game = game;\n this._parent = parent;\n /** @type {import('./frame_data.js').FrameData} */\n this._frameData = frameData;\n /** @type {string} */\n this.name = name;\n this._frames = [];\n this._frames = this._frames.concat(frames);\n /** @type {number} */\n this.delay = 1000 / frameRate;\n /** @type {boolean} */\n this.loop = loop;\n /** @type {number} */\n this.loopCount = 0;\n /** @type {boolean} */\n this.isFinished = false;\n /** @type {boolean} */\n this.isPlaying = false;\n /** @type {boolean} */\n this.isPaused = false;\n /** @type {number} */\n this._pauseStartTime = 0;\n /** @type {number} */\n this._frameIndex = 0;\n /** @type {number} */\n this._frameDiff = 0;\n /** @type {number} */\n this._frameSkip = 1;\n this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);\n /** @type {Signal} */\n this.onStart = new Signal();\n /** @type {Signal} */\n this.onUpdate = null;\n /** @type {Signal} */\n this.onComplete = new Signal();\n /** @type {Signal} */\n this.onLoop = new Signal();\n /** @type {boolean} */\n this.isReversed = false;\n // Set-up some event listeners\n this.game.onPause.add(this.onPause, this);\n this.game.onResume.add(this.onResume, this);\n }\n\n /**\n * Plays this animation.\n * @param {number} frameRate - The new frame rate to use for this animation (if null, uses the original frame rate).\n * @param {boolean} loop - Whether to loop this animation (if null, uses the original loop setting).\n * @returns {Animation} This Animation instance for chaining.\n */\n play(frameRate = null, loop = null) {\n if (typeof frameRate === 'number') {\n // If they set a new frame rate then use it, otherwise use the one set on creation\n this.delay = 1000 / frameRate;\n }\n if (typeof loop === 'boolean') {\n // If they set a new loop value then use it, otherwise use the one set on creation\n this.loop = loop;\n }\n this.isPlaying = true;\n this.isFinished = false;\n this.paused = false;\n this.loopCount = 0;\n this._timeLastFrame = this.game.time.time;\n this._timeNextFrame = this.game.time.time + this.delay;\n this._frameIndex = this.isReversed ? this._frames.length - 1 : 0;\n this.updateCurrentFrame(false, true);\n this._parent.events.onAnimationStart$dispatch(this._parent, this);\n this.onStart.dispatch(this._parent, this);\n this._parent.animations.currentAnim = this;\n this._parent.animations.currentFrame = this.currentFrame;\n return this;\n }\n\n /**\n * Restarts this animation from the beginning.\n */\n restart() {\n this.isPlaying = true;\n this.isFinished = false;\n this.paused = false;\n this.loopCount = 0;\n this._timeLastFrame = this.game.time.time;\n this._timeNextFrame = this.game.time.time + this.delay;\n this._frameIndex = 0;\n this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);\n this._parent.setFrame(this.currentFrame);\n this._parent.animations.currentAnim = this;\n this._parent.animations.currentFrame = this.currentFrame;\n this.onStart.dispatch(this._parent, this);\n }\n\n /**\n * Reverses the direction of this animation.\n * @returns {Animation} This Animation instance for chaining.\n */\n reverse() {\n this.reversed = !this.reversed;\n return this;\n }\n\n /**\n * Reverses the animation direction once, then returns to normal direction.\n * @returns {Animation} This Animation instance for chaining.\n */\n reverseOnce() {\n this.onComplete.addOnce(this.reverse, this);\n return this.reverse();\n }\n\n /**\n * Sets the current frame of this animation.\n * @param {string|number} frameId - The identifier (name or index) of the frame to set.\n * @param {boolean} useLocalFrameIndex - If true, treats frameId as an index into the local frames array.\n */\n setFrame(frameId, useLocalFrameIndex = false) {\n let frameIndex;\n // Find the index to the desired frame.\n if (typeof frameId === 'string') {\n for (let i = 0; i < this._frames.length; i += 1) {\n if (this._frameData.getFrame(this._frames[i]).name === frameId) {\n frameIndex = i;\n }\n }\n } else if (typeof frameId === 'number') {\n if (useLocalFrameIndex) {\n frameIndex = frameId;\n } else {\n for (let i = 0; i < this._frames.length; i += 1) {\n if (this._frames[i] === frameId) {\n frameIndex = i;\n }\n }\n }\n }\n if (frameIndex) {\n // Set the current frame index to the found index. Subtract 1 so that it animates to the desired frame on update.\n this._frameIndex = frameIndex - 1;\n // Make the animation update at next update\n this._timeNextFrame = this.game.time.time;\n this.update();\n }\n }\n\n /**\n * Stops this animation.\n * @param {boolean} resetFrame - If true, resets to the first frame.\n * @param {boolean} dispatchComplete - If true, dispatches the onComplete signal.\n */\n stop(resetFrame = false, dispatchComplete = false) {\n this.isPlaying = false;\n this.isFinished = true;\n this.paused = false;\n if (resetFrame) {\n this.currentFrame = this._frameData.getFrame(this._frames[0]);\n if (this.currentFrame) {\n this._parent.setFrame(this.currentFrame);\n }\n }\n if (dispatchComplete) {\n this._parent.events.onAnimationComplete$dispatch(this._parent, this);\n this.onComplete.dispatch(this._parent, this);\n }\n }\n\n /**\n * Called when the game is paused.\n */\n onPause() {\n if (this.isPlaying) {\n this._frameDiff = this._timeNextFrame - this.game.time.time;\n }\n }\n\n /**\n * Called when the game is resumed.\n */\n onResume() {\n if (this.isPlaying) {\n this._timeNextFrame = this.game.time.time + this._frameDiff;\n }\n }\n\n /**\n * Updates this animation.\n * @returns {boolean} True if the animation was updated, false otherwise.\n */\n update() {\n if (this.isPaused) {\n return false;\n }\n if (this.isPlaying && this.game.time.time >= this._timeNextFrame) {\n this._frameSkip = 1;\n // Lagging?\n this._frameDiff = this.game.time.time - this._timeNextFrame;\n this._timeLastFrame = this.game.time.time;\n if (this._frameDiff > this.delay) {\n // We need to skip a frame, work out how many\n this._frameSkip = Math.floor(this._frameDiff / this.delay);\n this._frameDiff -= this._frameSkip * this.delay;\n }\n // And what's left now?\n this._timeNextFrame = this.game.time.time + (this.delay - this._frameDiff);\n if (this.isReversed) {\n this._frameIndex -= this._frameSkip;\n } else {\n this._frameIndex += this._frameSkip;\n }\n if (\n (!this.isReversed && this._frameIndex >= this._frames.length) ||\n (this.isReversed && this._frameIndex <= -1)\n ) {\n if (this.loop) {\n // Update current state before event callback\n this._frameIndex = Math.abs(this._frameIndex) % this._frames.length;\n if (this.isReversed) {\n this._frameIndex = this._frames.length - 1 - this._frameIndex;\n }\n this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);\n // Instead of calling updateCurrentFrame we do it here instead\n if (this.currentFrame) {\n this._parent.setFrame(this.currentFrame);\n }\n this.loopCount += 1;\n this._parent.events.onAnimationLoop$dispatch(this._parent, this);\n this.onLoop.dispatch(this._parent, this);\n if (this.onUpdate) {\n this.onUpdate.dispatch(this, this.currentFrame);\n // False if the animation was destroyed from within a callback\n return !!this._frameData;\n }\n return true;\n }\n this.complete();\n return false;\n }\n return this.updateCurrentFrame(true);\n }\n\n return false;\n }\n\n /**\n * Updates the current frame of this animation.\n * @param {boolean} signalUpdate - Whether to signal the update event.\n * @param {boolean} fromPlay - Whether this call is from play().\n * @returns {boolean} True if the frame was updated, false otherwise.\n */\n updateCurrentFrame(signalUpdate, fromPlay = false) {\n if (!this._frameData || !this.currentFrame) {\n // The animation is already destroyed, probably from a callback\n return false;\n }\n // Previous index\n const idx = this.currentFrame.index;\n this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);\n if (this.currentFrame && (fromPlay || (!fromPlay && idx !== this.currentFrame.index))) {\n this._parent.setFrame(this.currentFrame);\n }\n if (this.onUpdate && signalUpdate) {\n this.onUpdate.dispatch(this, this.currentFrame);\n // False if the animation was destroyed from within a callback\n return !!this._frameData;\n }\n return true;\n }\n\n /**\n * Advances the animation to the next frame(s).\n * @param {number} quantity - The number of frames to advance by.\n */\n next(quantity = 1) {\n let frame = this._frameIndex + quantity;\n if (frame >= this._frames.length) {\n if (this.loop) {\n frame %= this._frames.length;\n } else {\n frame = this._frames.length - 1;\n }\n }\n if (frame !== this._frameIndex) {\n this._frameIndex = frame;\n this.updateCurrentFrame(true);\n }\n }\n\n /**\n * Moves the animation to the previous frame(s).\n * @param {number} quantity - The number of frames to move back by.\n */\n previous(quantity = 1) {\n let frame = this._frameIndex - quantity;\n if (frame < 0) {\n if (this.loop) {\n frame = this._frames.length + frame;\n } else {\n frame += 1;\n }\n }\n if (frame !== this._frameIndex) {\n this._frameIndex = frame;\n this.updateCurrentFrame(true);\n }\n }\n\n /**\n * Updates the frame data used by this animation.\n * @param {import('./frame_data.js').FrameData} frameData - The new FrameData object to use.\n */\n updateFrameData(frameData) {\n this._frameData = frameData;\n this.currentFrame = this._frameData\n ? this._frameData.getFrame(this._frames[this._frameIndex % this._frames.length])\n : null;\n }\n\n /**\n * Destroys this animation and cleans up resources.\n */\n destroy() {\n if (!this._frameData) {\n // Already destroyed\n return;\n }\n this.game.onPause.remove(this.onPause, this);\n this.game.onResume.remove(this.onResume, this);\n this.game = null;\n this._parent = null;\n this._frames = null;\n this._frameData = null;\n this.currentFrame = null;\n this.isPlaying = false;\n this.onStart.dispose();\n this.onLoop.dispose();\n this.onComplete.dispose();\n if (this.onUpdate) {\n this.onUpdate.dispose();\n }\n }\n\n /**\n * Completes this animation, setting it to the final frame.\n */\n complete() {\n this._frameIndex = this._frames.length - 1;\n this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);\n this.isPlaying = false;\n this.isFinished = true;\n this.paused = false;\n this._parent.events.onAnimationComplete$dispatch(this._parent, this);\n this.onComplete.dispatch(this._parent, this);\n }\n\n /**\n * Gets whether this animation is currently paused.\n * @returns {boolean} True if the animation is paused, false otherwise.\n */\n get paused() {\n return this.isPaused;\n }\n\n /**\n * Sets whether this animation is currently paused.\n * @param {boolean} value - True to pause the animation, false to resume it.\n */\n set paused(value) {\n this.isPaused = value;\n if (value) {\n this._pauseStartTime = this.game.time.time;\n } else if (this.isPlaying) {\n this._timeNextFrame = this.game.time.time + this.delay;\n }\n }\n\n /**\n * Gets whether this animation is currently reversed.\n * @returns {boolean} True if the animation is reversed, false otherwise.\n */\n get reversed() {\n return this.isReversed;\n }\n\n /**\n * Sets whether this animation is currently reversed.\n * @param {boolean} value - True to reverse the animation, false to normal direction.\n */\n set reversed(value) {\n this.isReversed = value;\n }\n\n /**\n * Gets the total number of frames in this animation.\n * @returns {number} The total number of frames.\n */\n get frameTotal() {\n return this._frames.length;\n }\n\n /**\n * Gets the current frame index.\n * @returns {number} The current frame index.\n */\n get frame() {\n if (this.currentFrame !== null) {\n return this.currentFrame.index;\n }\n return this._frameIndex;\n }\n\n /**\n * Sets the current frame index.\n * @param {number} value - The new frame index to set.\n */\n set frame(value) {\n this.currentFrame = this._frameData.getFrame(this._frames[value]);\n if (this.currentFrame !== null) {\n this._frameIndex = value;\n this._parent.setFrame(this.currentFrame);\n if (this.onUpdate) {\n this.onUpdate.dispatch(this, this.currentFrame);\n }\n }\n }\n\n /**\n * Gets the current animation speed (frame rate).\n * @returns {number} The frame rate in frames per second.\n */\n get speed() {\n return 1000 / this.delay;\n }\n\n /**\n * Sets the animation speed (frame rate).\n * @param {number} value - The new frame rate in frames per second.\n */\n set speed(value) {\n if (value > 0) {\n this.delay = 1000 / value;\n }\n }\n\n /**\n * Gets whether the update signal is enabled.\n * @returns {boolean} True if the update signal is enabled, false otherwise.\n */\n get enableUpdate() {\n return this.onUpdate !== null;\n }\n\n /**\n * Sets whether the update signal is enabled.\n * @param {boolean} value - True to enable the update signal, false to disable it.\n */\n set enableUpdate(value) {\n if (value && this.onUpdate === null) {\n this.onUpdate = new Signal();\n } else if (!value && this.onUpdate !== null) {\n this.onUpdate.dispose();\n this.onUpdate = null;\n }\n }\n}","// @ts-nocheck\nimport { Animation } from './animation.js';\nimport { ENGINE_ERROR_CANNOT_SET_FRAME, ENGINE_ERROR_CANNOT_SET_FRAME_NAME } from './error_code.js';\n\nexport class AnimationManager {\n /**\n * Creates a new AnimationManager instance.\n * @param {import('../display/image.js').Image} sprite - Reference to the parent Sprite.\n */\n constructor(sprite) {\n this.sprite = sprite;\n this.game = sprite.game;\n /** @type {import('./frame.js').Frame} */\n this.currentFrame = null;\n /** @type {Animation} */\n this.currentAnim = null;\n this.updateIfVisible = true;\n this.isLoaded = false;\n /** @type {import('./frame_data.js').FrameData} */\n this._frameData = null;\n /** @type {{[key: string]: Animation}} */\n this._anims = {};\n /** @type {number[]} */\n this._outputFrames = [];\n }\n\n /**\n * Destroys the AnimationManager and cleans up resources.\n */\n destroy() {\n const keys = Object.keys(this._anims);\n for (let i = 0; i < keys.length; i += 1) {\n this._anims[keys[i]].destroy();\n }\n this._anims = {};\n this._outputFrames = [];\n this._frameData = null;\n this.currentAnim = null;\n this.currentFrame = null;\n this.sprite = null;\n this.game = null;\n }\n\n /**\n * Loads frame data into the AnimationManager.\n * @param {import('./frame_data.js').FrameData} frameData - The FrameData to load.\n * @param {string|number} frame - The frame index or name to set as current.\n * @returns {boolean} True if the frame data was loaded successfully, false otherwise.\n */\n loadFrameData(frameData, frame) {\n if (!frameData) {\n return false;\n }\n if (this.isLoaded) {\n // We need to update the frameData that the animations are using\n const keys = Object.keys(this._anims);\n for (let i = 0; i < keys.length; i += 1) {\n const anim = keys[i];\n this._anims[anim].updateFrameData(frameData);\n }\n }\n this._frameData = frameData;\n if (frame === undefined || frame === null) {\n this.frame = 0;\n } else if (typeof frame === 'string') {\n this.frameName = frame;\n } else {\n this.frame = frame;\n }\n this.isLoaded = true;\n return true;\n }\n\n /**\n * Copies frame data into the AnimationManager.\n * @param {import('./frame_data.js').FrameData} frameData - The FrameData to copy.\n * @param {string|number} frame - The frame index or name to set as current.\n * @returns {boolean} True if the frame data was copied successfully, false otherwise.\n */\n copyFrameData(frameData, frame) {\n this._frameData = frameData.clone();\n if (this.isLoaded) {\n // We need to update the frameData that the animations are using\n const keys = Object.keys(this._anims);\n for (let i = 0; i < keys.length; i += 1) {\n const anim = keys[i];\n this._anims[anim].updateFrameData(this._frameData);\n }\n }\n if (frame === undefined || frame === null) {\n this.frame = 0;\n } else if (typeof frame === 'string') {\n this.frameName = frame;\n } else {\n this.frame = frame;\n }\n this.isLoaded = true;\n return true;\n }\n\n /**\n * Adds a new animation to the AnimationManager.\n * @param {string} name - The name of the animation.\n * @param {number[] | string[] | null | undefined} frameList - The list of frames to include in the animation.\n * @param {number} frameRate - The frame rate of the animation (frames per second).\n * @param {boolean} loop - Whether the animation should loop.\n * @param {boolean | undefined} useNumericIndex - Whether to treat frameList as numeric indices.\n * @returns {Animation} The created Animation object.\n */\n add(name, frameList, frameRate = 60, loop = false, useNumericIndex = undefined) {\n const frames = frameList || [];\n // If they didn't set the useNumericIndex then let's at least try and guess it\n if (useNumericIndex === undefined) {\n if (frames && typeof frames[0] === 'number') {\n useNumericIndex = true;\n } else {\n useNumericIndex = false;\n }\n }\n this._outputFrames = [];\n this._frameData.getFrameIndexes(frames, useNumericIndex, this._outputFrames);\n this._anims[name] = new Animation(\n this.game,\n this.sprite,\n name,\n this._frameData,\n this._outputFrames,\n frameRate,\n loop\n );\n this.currentAnim = this._anims[name];\n if (this.sprite.tilingTexture) {\n this.sprite.refreshTexture = true;\n }\n return this._anims[name];\n }\n\n /**\n * Validates a list of frames against the current frame data.\n * @param {string[] | number[]} frames - The list of frames to validate.\n * @param {boolean} useNumericIndex - Whether to treat frameList as numeric indices.\n * @returns {boolean} True if all frames are valid, false otherwise.\n */\n validateFrames(frames, useNumericIndex = false) {\n for (let i = 0; i < frames.length; i += 1) {\n if (useNumericIndex === true) {\n if (frames[i] > this._frameData.total) {\n return false;\n }\n } else if (this._frameData.checkFrameName(frames[i]) === false) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Plays an animation by name.\n * @param {string} name - The name of the animation to play.\n * @param {number} frameRate - The frame rate (frames per second) to play at, or null to use the animation's default.\n * @param {boolean} loop - Whether the animation should loop, or null to use the animation's default.\n * @returns {Animation} The Animation object that was played, or null if not found.\n */\n play(name, frameRate = null, loop = null) {\n if (this._anims[name]) {\n if (this.currentAnim === this._anims[name]) {\n if (this.currentAnim.isPlaying === false) {\n this.currentAnim.paused = false;\n return this.currentAnim.play(frameRate, loop);\n }\n return this.currentAnim;\n }\n if (this.currentAnim && this.currentAnim.isPlaying) {\n this.currentAnim.stop();\n }\n this.currentAnim = this._anims[name];\n this.currentAnim.paused = false;\n this.currentFrame = this.currentAnim.currentFrame;\n return this.currentAnim.play(frameRate, loop);\n }\n return null;\n }\n\n /**\n * Stops an animation by name.\n * @param {string} name - The name of the animation to stop, or null to stop the current animation.\n * @param {boolean} resetFrame - Whether to reset the frame to the first frame of the animation.\n */\n stop(name = null, resetFrame = false) {\n if (this.currentAnim && (typeof name !== 'string' || name === this.currentAnim.name)) {\n this.currentAnim.stop(resetFrame);\n }\n }\n\n /**\n * Updates the animation manager state.\n * @returns {boolean} True if an animation was updated, false otherwise.\n */\n update() {\n if (this.updateIfVisible && !this.sprite.visible) {\n return false;\n }\n if (this.currentAnim && this.currentAnim.update()) {\n this.currentFrame = this.currentAnim.currentFrame;\n return true;\n }\n return false;\n }\n\n /**\n * Advances the current animation by a specified number of frames.\n * @param {number} quantity - The number of frames to advance by.\n */\n next(quantity) {\n if (this.currentAnim) {\n this.currentAnim.next(quantity);\n this.currentFrame = this.currentAnim.currentFrame;\n }\n }\n\n /**\n * Moves the current animation back by a specified number of frames.\n * @param {number} quantity - The number of frames to move back by.\n */\n previous(quantity) {\n if (this.currentAnim) {\n this.currentAnim.previous(quantity);\n this.currentFrame = this.currentAnim.currentFrame;\n }\n }\n\n /**\n * Gets an animation by name.\n * @param {string} name - The name of the animation to retrieve.\n * @returns {Animation} The Animation object, or null if not found.\n */\n getAnimation(name) {\n if (name && this._anims[name]) {\n return this._anims[name];\n }\n return null;\n }\n\n /**\n * Refreshes the current frame texture (not implemented).\n */\n refreshFrame() {\n // TODO\n this.game.logger.warn('animation_manager.refreshFrame() is not implemented');\n // this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);\n }\n\n /**\n * Gets the frame data used by this AnimationManager.\n * @returns {import('./frame_data.js').FrameData} The FrameData object.\n */\n get frameData() {\n return this._frameData;\n }\n\n /**\n * Gets the total number of frames in the frame data.\n * @returns {number} The total number of frames.\n */\n get frameTotal() {\n return this._frameData.total;\n }\n\n /**\n * Gets the paused state of the current animation.\n * @returns {boolean} True if the current animation is paused, false otherwise.\n */\n get paused() {\n return this.currentAnim.isPaused;\n }\n\n /**\n * Sets the paused state of the current animation.\n */\n set paused(value) {\n this.currentAnim.paused = value;\n }\n\n /**\n * Gets the name of the current animation.\n * @returns {string} The name of the current animation, or null if no animation is active.\n */\n get name() {\n if (this.currentAnim) {\n return this.currentAnim.name;\n }\n return null;\n }\n\n /**\n * Gets the current frame index.\n * @returns {number} The current frame index.\n */\n get frame() {\n if (this.currentFrame) {\n return this.currentFrame.index;\n }\n return 0;\n }\n\n /**\n * Sets the current frame index.\n */\n set frame(value) {\n if (typeof value === 'number' && this._frameData && this._frameData.getFrame(value) !== null) {\n this.currentFrame = this._frameData.getFrame(value);\n if (this.currentFrame) {\n this.sprite.setFrame(this.currentFrame);\n }\n } else {\n this.game.logger.exception('AnimationManager', new Error(ENGINE_ERROR_CANNOT_SET_FRAME), {\n tags: { 'asset.key': value },\n });\n }\n }\n\n /**\n * Gets the current frame name.\n * @returns {string} The current frame name, or null if no frame is set.\n */\n get frameName() {\n if (this.currentFrame) {\n return this.currentFrame.name;\n }\n return null;\n }\n\n /**\n * Sets the current frame by name.\n */\n set frameName(value) {\n if (typeof value === 'string' && this._frameData && this._frameData.getFrameByName(value) !== null) {\n this.currentFrame = this._frameData.getFrameByName(value);\n if (this.currentFrame) {\n this._frameIndex = this.currentFrame.index;\n this.sprite.setFrame(this.currentFrame);\n }\n } else {\n this.game.logger.exception('AnimationManager', new Error(ENGINE_ERROR_CANNOT_SET_FRAME_NAME), {\n tags: { 'asset.key': value },\n });\n }\n }\n}","// @ts-nocheck\nimport { Signal } from './signal.js';\n\nexport class EventManager {\n /**\n * Creates a new EventManager instance.\n * @param {import('../display/display_object.js').DisplayObject} sprite - Reference to the parent DisplayObject.\n */\n constructor(sprite) {\n this.parent = sprite;\n this._onAddedToGroup = null;\n this._onRemovedFromGroup = null;\n this._onDestroy = null;\n this._onOutOfBounds = null;\n this._onEnterBounds = null;\n this._onInputOver = null;\n this._onInputOut = null;\n this._onInputDown = null;\n this._onInputUp = null;\n this._onDragStart = null;\n this._onDragUpdate = null;\n this._onDragStop = null;\n this._onAnimationStart = null;\n this._onAnimationComplete = null;\n this._onAnimationLoop = null;\n }\n\n /**\n * Destroys the EventManager and cleans up resources.\n */\n destroy() {\n this._parent = null;\n if (this._onDestroy) {\n this._onDestroy.dispose();\n }\n if (this._onAddedToGroup) {\n this._onAddedToGroup.dispose();\n }\n if (this._onRemovedFromGroup) {\n this._onRemovedFromGroup.dispose();\n }\n if (this._onEnterBounds) {\n this._onEnterBounds.dispose();\n }\n if (this._onOutOfBounds) {\n this._onOutOfBounds.dispose();\n }\n if (this._onInputOver) {\n this._onInputOver.dispose();\n }\n if (this._onInputOut) {\n this._onInputOut.dispose();\n }\n if (this._onInputDown) {\n this._onInputDown.dispose();\n }\n if (this._onInputUp) {\n this._onInputUp.dispose();\n }\n if (this._onDragStart) {\n this._onDragStart.dispose();\n }\n if (this._onDragUpdate) {\n this._onDragUpdate.dispose();\n }\n if (this._onDragStop) {\n this._onDragStop.dispose();\n }\n if (this._onAnimationStart) {\n this._onAnimationStart.dispose();\n }\n if (this._onAnimationComplete) {\n this._onAnimationComplete.dispose();\n }\n if (this._onAnimationLoop) {\n this._onAnimationLoop.dispose();\n }\n }\n\n /**\n * Gets the onAddedToGroup signal.\n * @returns {Signal} The Signal object for the onAddedToGroup event.\n */\n get onAddedToGroup() {\n if (!this._onAddedToGroup) {\n this._onAddedToGroup = new Signal();\n }\n return this._onAddedToGroup;\n }\n\n /**\n * Dispatches the onAddedToGroup event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onAddedToGroup$dispatch(...args) {\n if (this._onAddedToGroup) {\n this._onAddedToGroup.dispatch(...args);\n }\n }\n\n /**\n * Gets the onRemovedFromGroup signal.\n * @returns {Signal} The Signal object for the onRemovedFromGroup event.\n */\n get onRemovedFromGroup() {\n if (!this._onRemovedFromGroup) {\n this._onRemovedFromGroup = new Signal();\n }\n return this._onRemovedFromGroup;\n }\n\n /**\n * Dispatches the onRemovedFromGroup event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onRemovedFromGroup$dispatch(...args) {\n if (this._onRemovedFromGroup) {\n this._onRemovedFromGroup.dispatch(...args);\n }\n }\n\n /**\n * Gets the onDestroy signal.\n * @returns {Signal} The Signal object for the onDestroy event.\n */\n get onDestroy() {\n if (!this._onDestroy) {\n this._onDestroy = new Signal();\n }\n return this._onDestroy;\n }\n\n /**\n * Dispatches the onDestroy event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onDestroy$dispatch(...args) {\n if (this._onDestroy) {\n this._onDestroy.dispatch(...args);\n }\n }\n\n /**\n * Gets the onOutOfBounds signal.\n * @returns {Signal} The Signal object for the onOutOfBounds event.\n */\n get onOutOfBounds() {\n if (!this._onOutOfBounds) {\n this._onOutOfBounds = new Signal();\n }\n return this._onOutOfBounds;\n }\n\n /**\n * Dispatches the onOutOfBounds event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onOutOfBounds$dispatch(...args) {\n if (this._onOutOfBounds) {\n this._onOutOfBounds.dispatch(...args);\n }\n }\n\n /**\n * Gets the onEnterBounds signal.\n * @returns {Signal} The Signal object for the onEnterBounds event.\n */\n get onEnterBounds() {\n if (!this._onEnterBounds) {\n this._onEnterBounds = new Signal();\n }\n return this._onEnterBounds;\n }\n\n /**\n * Dispatches the onEnterBounds event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onEnterBounds$dispatch(...args) {\n if (this._onEnterBounds) {\n this._onEnterBounds.dispatch(...args);\n }\n }\n\n /**\n * Gets the onInputOver signal.\n * @returns {Signal} The Signal object for the onInputOver event.\n */\n get onInputOver() {\n if (!this._onInputOver) {\n this._onInputOver = new Signal();\n }\n return this._onInputOver;\n }\n\n /**\n * Dispatches the onInputOver event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onInputOver$dispatch(...args) {\n if (this._onInputOver) {\n this._onInputOver.dispatch(...args);\n }\n }\n\n /**\n * Gets the onInputOut signal.\n * @returns {Signal} The Signal object for the onInputOut event.\n */\n get onInputOut() {\n if (!this._onInputOut) {\n this._onInputOut = new Signal();\n }\n return this._onInputOut;\n }\n\n /**\n * Dispatches the onInputOut event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onInputOut$dispatch(...args) {\n if (this._onInputOut) {\n this._onInputOut.dispatch(...args);\n }\n }\n\n /**\n * Gets the onInputDown signal.\n * @returns {Signal} The Signal object for the onInputDown event.\n */\n get onInputDown() {\n if (!this._onInputDown) {\n this._onInputDown = new Signal();\n }\n return this._onInputDown;\n }\n\n /**\n * Dispatches the onInputDown event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onInputDown$dispatch(...args) {\n if (this._onInputDown) {\n this._onInputDown.dispatch(...args);\n }\n }\n\n /**\n * Gets the onInputUp signal.\n * @returns {Signal} The Signal object for the onInputUp event.\n */\n get onInputUp() {\n if (!this._onInputUp) {\n this._onInputUp = new Signal();\n }\n return this._onInputUp;\n }\n\n /**\n * Dispatches the onInputUp event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onInputUp$dispatch(...args) {\n if (this._onInputUp) {\n this._onInputUp.dispatch(...args);\n }\n }\n\n /**\n * Gets the onDragStart signal.\n * @returns {Signal} The Signal object for the onDragStart event.\n */\n get onDragStart() {\n if (!this._onDragStart) {\n this._onDragStart = new Signal();\n }\n return this._onDragStart;\n }\n\n /**\n * Dispatches the onDragStart event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onDragStart$dispatch(...args) {\n if (this._onDragStart) {\n this._onDragStart.dispatch(...args);\n }\n }\n\n /**\n * Gets the onDragUpdate signal.\n * @returns {Signal} The Signal object for the onDragUpdate event.\n */\n get onDragUpdate() {\n if (!this._onDragUpdate) {\n this._onDragUpdate = new Signal();\n }\n return this._onDragUpdate;\n }\n\n /**\n * Dispatches the onDragUpdate event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onDragUpdate$dispatch(...args) {\n if (this._onDragUpdate) {\n this._onDragUpdate.dispatch(...args);\n }\n }\n\n /**\n * Gets the onDragStop signal.\n * @returns {Signal} The Signal object for the onDragStop event.\n */\n get onDragStop() {\n if (!this._onDragStop) {\n this._onDragStop = new Signal();\n }\n return this._onDragStop;\n }\n\n /**\n * Dispatches the onDragStop event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onDragStop$dispatch(...args) {\n if (this._onDragStop) {\n this._onDragStop.dispatch(...args);\n }\n }\n\n /**\n * Gets the onAnimationStart signal.\n * @returns {Signal} The Signal object for the onAnimationStart event.\n */\n get onAnimationStart() {\n if (!this._onAnimationStart) {\n this._onAnimationStart = new Signal();\n }\n return this._onAnimationStart;\n }\n\n /**\n * Dispatches the onAnimationStart event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onAnimationStart$dispatch(...args) {\n if (this._onAnimationStart) {\n this._onAnimationStart.dispatch(...args);\n }\n }\n\n /**\n * Gets the onAnimationComplete signal.\n * @returns {Signal} The Signal object for the onAnimationComplete event.\n */\n get onAnimationComplete() {\n if (!this._onAnimationComplete) {\n this._onAnimationComplete = new Signal();\n }\n return this._onAnimationComplete;\n }\n\n /**\n * Dispatches the onAnimationComplete event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onAnimationComplete$dispatch(...args) {\n if (this._onAnimationComplete) {\n this._onAnimationComplete.dispatch(...args);\n }\n }\n\n /**\n * Gets the onAnimationLoop signal.\n * @returns {Signal} The Signal object for the onAnimationLoop event.\n */\n get onAnimationLoop() {\n if (!this._onAnimationLoop) {\n this._onAnimationLoop = new Signal();\n }\n return this._onAnimationLoop;\n }\n\n /**\n * Dispatches the onAnimationLoop event.\n * @param {...any} args - Arguments to pass to the signal.\n */\n onAnimationLoop$dispatch(...args) {\n if (this._onAnimationLoop) {\n this._onAnimationLoop.dispatch(...args);\n }\n }\n}","// @ts-nocheck\nimport { Rectangle } from '../../geom/rectangle.js';\n\nexport class TextureUvs {\n /**\n * Creates a new Texture instance.\n */\n constructor() {\n this.x0 = 0;\n this.y0 = 0;\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.x3 = 0;\n this.y3 = 0;\n }\n}\n\nexport class Texture {\n /**\n * Creates a new Texture instance.\n * @param {import('./base_texture.js').BaseTexture} baseTexture - The base texture to use.\n * @param {Rectangle | null | undefined} frame - The frame rectangle.\n * @param {Rectangle | null | undefined} crop - The crop rectangle.\n * @param {Rectangle | null | undefined} trim - The trim rectangle.\n */\n constructor(baseTexture, frame = null, crop = null, trim = null) {\n this.noFrame = false;\n if (!frame) {\n this.noFrame = true;\n frame = new Rectangle(0, 0, 1, 1);\n }\n if (baseTexture instanceof Texture) {\n baseTexture = baseTexture.baseTexture;\n }\n this.baseTexture = baseTexture;\n /** @type {Rectangle} */\n this.frame = frame;\n /** @type {Rectangle | null | undefined} */\n this.trim = trim;\n /** @type {boolean} */\n this.valid = false;\n /** @type {boolean} */\n this.isTiling = false;\n /** @type {boolean} */\n this.requiresUpdate = false;\n /** @type {boolean} */\n this.requiresReTint = false;\n /** @type {TextureUvs} */\n this._uvs = null;\n /** @type {number} */\n this.width = 0;\n /** @type {number} */\n this.height = 0;\n /** @type {Rectangle} */\n this.crop = crop || new Rectangle(0, 0, 1, 1);\n if (baseTexture.hasLoaded) {\n if (this.noFrame) {\n frame = new Rectangle(0, 0, baseTexture.width, baseTexture.height);\n }\n this.setFrame(frame);\n }\n }\n\n /**\n * Destroys this texture and cleans up resources.\n */\n onBaseTextureLoaded() {\n if (this.noFrame) {\n this.frame = new Rectangle(0, 0, this.baseTexture.width, this.baseTexture.height);\n }\n this.setFrame(this.frame);\n }\n\n /**\n * Destroys this texture and cleans up resources.\n * @param {boolean} destroyBase - Whether to destroy the base texture as well.\n */\n destroy(destroyBase = false) {\n if (destroyBase) {\n this.baseTexture.destroy();\n }\n this.valid = false;\n }\n\n /**\n * Sets the frame of this texture.\n * @param {Rectangle} frame - The new frame rectangle.\n * @throws {Error} If the operation fails.\n */\n setFrame(frame) {\n this.noFrame = false;\n this.frame = frame;\n this.width = frame.width;\n this.height = frame.height;\n this.crop.x = frame.x;\n this.crop.y = frame.y;\n this.crop.width = frame.width;\n this.crop.height = frame.height;\n if (\n !this.trim &&\n (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)\n ) {\n // If `true` then `PIXI.Texture.setFrame` will no longer throw an error if the texture dimensions are incorrect.\n // Instead `Texture.valid` will be set to `false` (#1556)\n // TODO: make this configurable\n const isTextureSilentFail = true;\n if (!isTextureSilentFail) {\n throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions ${this}`);\n }\n this.valid = false;\n return;\n }\n this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded;\n if (this.trim) {\n this.width = this.trim.width;\n this.height = this.trim.height;\n this.frame.width = this.trim.width;\n this.frame.height = this.trim.height;\n }\n if (this.valid) {\n this._updateUvs();\n }\n }\n\n /**\n * Updates the texture UVs based on the crop frame.\n */\n _updateUvs() {\n if (!this._uvs) {\n this._uvs = new TextureUvs();\n }\n const frame = this.crop;\n const tw = this.baseTexture.width;\n const th = this.baseTexture.height;\n this._uvs.x0 = frame.x / tw;\n this._uvs.y0 = frame.y / th;\n this._uvs.x1 = (frame.x + frame.width) / tw;\n this._uvs.y1 = frame.y / th;\n this._uvs.x2 = (frame.x + frame.width) / tw;\n this._uvs.y2 = (frame.y + frame.height) / th;\n this._uvs.x3 = frame.x / tw;\n this._uvs.y3 = (frame.y + frame.height) / th;\n }\n}\n","// @ts-nocheck\nimport { AnimationManager } from '../core/animation_manager.js';\nimport { BLEND_NORMAL, IMAGE, PENDING_ATLAS, SCALE_NEAREST } from '../core/const.js';\nimport { EventManager } from '../core/event_manager.js';\nimport { Rectangle } from '../geom/rectangle.js';\nimport { clone } from '../geom/util/rectangle.js';\nimport { DisplayObject } from './display_object.js';\nimport { getBounds, getLocalBounds, renderCanvas, renderWebGL, setTexture } from './sprite_util.js';\nimport { Texture } from './webgl/texture.js';\n\nexport class Image extends DisplayObject {\n /**\n * Creates a new Image instance.\n * @param {import('../core/game.js').Game} game - The game instance this image belongs to.\n * @param {number} x - The x position of the image.\n * @param {number} y - The y position of the image.\n * @param {string | number | Texture} key - The texture key or texture to use.\n * @param {string | number} frame - The frame identifier (name or index) to use.\n */\n constructor(game, x, y, key, frame = 0) {\n super(game);\n /** @type {number} */\n this.type = IMAGE;\n /** @type {boolean} */\n this.renderable = true;\n /** @type {string | number | Texture} */\n this.key = key;\n this.texture = window.PhaserRegistry.CACHE_MISSING_IMAGE;\n /** @type {object} */\n this.data = {};\n /** @type {number} */\n this._width = 0;\n /** @type {number} */\n this._height = 0;\n /** @type {number} */\n this.tint = 0xffffff;\n /** @type {number} */\n this.cachedTint = -1;\n /** @type {Texture | null} */\n this.tilingTexture = null;\n /** @type {Texture | null} */\n this.tintedTexture = null;\n /** @type {number} */\n this.blendMode = BLEND_NORMAL;\n this.shader = null;\n this._frame = null;\n /** @type {boolean} */\n this.pendingDestroy = false;\n /* if (this.texture.baseTexture.hasLoaded) {\n this.onTextureUpdate();\n } */\n this.position.setTo(x, y);\n /** @type {EventManager} */\n this.events = new EventManager(this);\n /** @type {AnimationManager} */\n this.animations = new AnimationManager(this);\n this.loadTexture(key, frame);\n }\n\n /**\n * Destroys this image and cleans up resources.\n */\n destroy() {\n this.game = null;\n this.key = null;\n this.data = null;\n this.texture = null;\n this.tint = 0xffffff;\n this.cachedTint = -1;\n this.tintedTexture = null;\n this.shader = null;\n this._frame = null;\n if (this.events) {\n this.events.destroy();\n }\n this.events = null;\n if (this.animations) {\n this.animations.destroy();\n }\n this.animations = null;\n super.destroy();\n }\n\n /**\n * Called before the update cycle for this image.\n */\n preUpdate() {\n if (this.pendingDestroy) {\n this.destroy();\n return;\n }\n if (!this.exists || !this.parent.exists) {\n this.renderOrderID = -1;\n return;\n }\n if (this.visible) {\n this.game.stage.currentRenderOrderID += 1;\n this.renderOrderID = this.game.stage.currentRenderOrderID;\n }\n if (this.animations) {\n this.animations.update();\n }\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].preUpdate();\n }\n }\n\n // LoadTexture\n\n /**\n * Loads a texture for this image.\n * @param {string | number | Texture} key - The texture key or texture to use.\n * @param {string | number | null | undefined} frame - The frame identifier (name or index) to use.\n * @param {boolean} stopAnimation - Whether to stop the animation when changing textures.\n */\n loadTexture(key, frame = 0, stopAnimation = true) {\n if (key === PENDING_ATLAS) {\n key = frame;\n frame = 0;\n } else {\n frame = frame || 0;\n }\n if (stopAnimation) {\n this.animations.stop();\n }\n this.key = key;\n this.customRender = false;\n const cache = this.game.cache;\n const smoothed = !this.texture.baseTexture.scaleMode;\n let setFrame = true;\n if (key instanceof Texture) {\n this.setTexture(key);\n } else {\n const img = cache.getImage(key, true);\n if (img) {\n this.key = img.key;\n this.setTexture(new Texture(img.base));\n if (key === '__default') {\n this.texture.baseTexture.skipRender = true;\n } else {\n this.texture.baseTexture.skipRender = false;\n }\n setFrame = !this.animations.loadFrameData(img.frameData, frame);\n }\n }\n if (setFrame) {\n this._frame = clone(this.texture.frame);\n }\n if (!smoothed) {\n this.texture.baseTexture.scaleMode = SCALE_NEAREST;\n }\n }\n\n /**\n * Sets the current frame of this image.\n * @param {import('../core/frame.js').Frame} frame - The frame to set.\n */\n setFrame(frame) {\n this._frame = frame;\n this.texture.frame.x = frame.x;\n this.texture.frame.y = frame.y;\n this.texture.frame.width = frame.width;\n this.texture.frame.height = frame.height;\n this.texture.crop.x = frame.x;\n this.texture.crop.y = frame.y;\n this.texture.crop.width = frame.width;\n this.texture.crop.height = frame.height;\n if (frame.trimmed) {\n if (this.texture.trim) {\n this.texture.trim.x = frame.spriteSourceSizeX;\n this.texture.trim.y = frame.spriteSourceSizeY;\n this.texture.trim.width = frame.sourceSizeW;\n this.texture.trim.height = frame.sourceSizeH;\n } else {\n this.texture.trim = {\n x: frame.spriteSourceSizeX,\n y: frame.spriteSourceSizeY,\n width: frame.sourceSizeW,\n height: frame.sourceSizeH,\n };\n }\n this.texture.width = frame.sourceSizeW;\n this.texture.height = frame.sourceSizeH;\n this.texture.frame.width = frame.sourceSizeW;\n this.texture.frame.height = frame.sourceSizeH;\n } else if (!frame.trimmed && this.texture.trim) {\n this.texture.trim = null;\n }\n if (this.cropRect) {\n this.updateCrop();\n }\n this.texture.requiresReTint = true;\n this.texture._updateUvs();\n if (this.tilingTexture) {\n this.refreshTexture = true;\n }\n }\n\n /**\n * Resizes the frame of this image.\n * @param {DisplayObject} parent - The parent display object.\n * @param {number} width - The new width of the frame.\n * @param {number} height - The new height of the frame.\n */\n resizeFrame(parent, width, height) {\n this.texture.frame.resize(width, height);\n this.texture.setFrame(this.texture.frame);\n }\n\n /**\n * Resets the frame of this image to its original frame.\n */\n resetFrame() {\n if (this._frame) {\n this.setFrame(this._frame);\n }\n }\n\n /**\n * Gets the current frame index of this image.\n * @returns {number} The current frame index.\n */\n get frame() {\n return this.animations.frame;\n }\n\n /**\n * Sets the current frame index of this image.\n * @param {number} value - The new frame index to set.\n */\n set frame(value) {\n this.animations.frame = value;\n }\n\n /**\n * Gets the current frame name of this image.\n * @returns {string} The current frame name.\n */\n get frameName() {\n return this.animations.frameName;\n }\n\n /**\n * Sets the current frame name of this image.\n * @param {string} value - The new frame name to set.\n */\n set frameName(value) {\n this.animations.frameName = value;\n }\n\n // Crop\n\n /**\n * Crops the texture of this image.\n * @param {Rectangle} rect - The rectangle to crop to.\n * @param {boolean} copy - Whether to copy the rect or use it directly.\n */\n crop(rect, copy = false) {\n if (rect) {\n if (copy && this.cropRect !== null) {\n this.cropRect.setTo(rect.x, rect.y, rect.width, rect.height);\n } else if (copy && this.cropRect === null) {\n this.cropRect = new Rectangle(rect.x, rect.y, rect.width, rect.height);\n } else {\n this.cropRect = rect;\n }\n this.updateCrop();\n } else {\n this._crop = null;\n this.cropRect = null;\n this.resetFrame();\n }\n }\n\n /**\n * Updates the crop rectangle of this image.\n */\n updateCrop() {\n if (!this.cropRect) {\n return;\n }\n const oldX = this.texture.crop.x;\n const oldY = this.texture.crop.y;\n const oldW = this.texture.crop.width;\n const oldH = this.texture.crop.height;\n this._crop = clone(this.cropRect, this._crop);\n this._crop.x += this._frame.x;\n this._crop.y += this._frame.y;\n const cx = Math.max(this._frame.x, this._crop.x);\n const cy = Math.max(this._frame.y, this._crop.y);\n const cw = Math.min(this._frame.right, this._crop.right) - cx;\n const ch = Math.min(this._frame.bottom, this._crop.bottom) - cy;\n this.texture.crop.x = cx;\n this.texture.crop.y = cy;\n this.texture.crop.width = cw;\n this.texture.crop.height = ch;\n this.texture.frame.width = Math.min(cw, this.cropRect.width);\n this.texture.frame.height = Math.min(ch, this.cropRect.height);\n this.texture.width = this.texture.frame.width;\n this.texture.height = this.texture.frame.height;\n this.texture._updateUvs();\n if (this.tint !== 0xffffff && (oldX !== cx || oldY !== cy || oldW !== cw || oldH !== ch)) {\n this.texture.requiresReTint = true;\n }\n }\n\n /**\n * Gets the width of this image.\n * @returns {number} The width in pixels.\n */\n get width() {\n return this.scale.x * this.texture.frame.width;\n }\n\n /**\n * Sets the width of this image.\n * @param {number} value - The new width in pixels.\n */\n set width(value) {\n this.scale.x = value / this.texture.frame.width;\n this._width = value;\n }\n\n /**\n * Gets the height of this image.\n * @returns {number} The height in pixels.\n */\n get height() {\n return this.scale.y * this.texture.frame.height;\n }\n\n /**\n * Sets the height of this image.\n * @param {number} value - The new height in pixels.\n */\n set height(value) {\n this.scale.y = value / this.texture.frame.height;\n this._height = value;\n }\n\n /**\n * Called when the texture of this image is updated.\n */\n onTextureUpdate() {\n // so if _width is 0 then width was not set..\n if (this._width) {\n this.scale.x = this._width / this.texture.frame.width;\n }\n if (this._height) {\n this.scale.y = this._height / this.texture.frame.height;\n }\n }\n\n /**\n * Sets the texture for this image.\n * @param {Texture} texture - The new texture to set.\n * @param {boolean} destroyBase - Whether to destroy the base texture.\n */\n setTexture(texture, destroyBase = false) {\n setTexture(this, texture, destroyBase);\n }\n\n /**\n * Gets the bounds of this image.\n * @param {import('../geom/matrix.js').Matrix} matrix - The transformation matrix to use.\n * @returns {Rectangle} The bounds rectangle of this image.\n */\n getBounds(matrix = null) {\n return getBounds(this, matrix);\n }\n\n /**\n * Gets the local bounds of this image.\n * @returns {Rectangle} The local bounds rectangle of this image.\n */\n getLocalBounds() {\n return getLocalBounds(this);\n }\n\n /**\n * Renders this image using WebGL.\n * @param {object} renderSession - The WebGL rendering session.\n * @param {import('../geom/matrix.js').Matrix} matrix - The transformation matrix to use.\n */\n renderWebGL(renderSession, matrix = null) {\n renderWebGL(this, renderSession, matrix);\n }\n\n /**\n * Renders this image using Canvas.\n * @param {object} renderSession - The Canvas rendering session.\n * @param {import('../geom/matrix.js').Matrix} matrix - The transformation matrix to use.\n */\n renderCanvas(renderSession, matrix = null) {\n renderCanvas(this, renderSession, matrix);\n }\n}\n","// @ts-nocheck\nimport { BITMAP_TEXT, SCALE_LINEAR, SCALE_NEAREST } from '../core/const.js';\nimport { Point } from '../geom/point.js';\nimport { DisplayObject } from './display_object.js';\nimport { Image } from './image.js';\n\nexport class BitmapText extends DisplayObject {\n /**\n * Creates a new BitmapText instance.\n * @param {import('../core/game.js').Game} game - The game instance this bitmap text belongs to.\n * @param {number} x - The x position of the bitmap text.\n * @param {number} y - The y position of the bitmap text.\n * @param {string} font - The key of the bitmap font to use.\n * @param {string} text - The text to display.\n * @param {number} size - The font size.\n * @param {string} align - The text alignment (left, center, right).\n */\n constructor(game, x = 0, y = 0, font = '', text = '', size = 32, align = 'left') {\n super(game);\n /** @type {number} */\n this.type = BITMAP_TEXT;\n this.position.setTo(x, y);\n /** @type {number} */\n this.textWidth = 0;\n /** @type {number} */\n this.textHeight = 0;\n /** @type {Point} */\n this._prevAnchor = new Point();\n this._glyphs = [];\n /** @type {number} */\n this._maxWidth = 0;\n /** @type {string} */\n this._text = text.toString() || '';\n this._data = game.cache.getBitmapFont(font);\n /** @type {string} */\n this._font = font;\n /** @type {number} */\n this._fontSize = size;\n /** @type {string} */\n this._align = align;\n /** @type {number} */\n this._tint = 0xffffff;\n this.updateText();\n /** @type {boolean} */\n this.dirty = false;\n }\n\n /**\n * Destroys this bitmap text and cleans up resources.\n */\n destroy() {\n this._prevAnchor = null;\n this._glyphs = null;\n this._text = null;\n this._data = null;\n super.destroy();\n }\n\n /**\n * Called before the update cycle for this bitmap text.\n */\n preUpdate() {\n if (this.pendingDestroy) {\n this.destroy();\n return;\n }\n\n if (!this.exists || !this.parent.exists) {\n this.renderOrderID = -1;\n return;\n }\n if (this.visible) {\n this.game.stage.currentRenderOrderID += 1;\n this.renderOrderID = this.game.stage.currentRenderOrderID;\n }\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].preUpdate();\n }\n }\n\n /**\n * Sets the text to display.\n * @param {string} text - The new text to display.\n */\n setText(text) {\n this.text = text;\n }\n\n /**\n * Scans a line of text to calculate its width and other properties.\n * @param {object} data - The font data for this bitmap text.\n * @param {number} scale - The scaling factor to apply to the font size.\n * @param {string} text - The text to scan.\n * @returns {{width: number, text: string, end: boolean, chars: number[]}} An object containing the width, processed text, end status, and character positions.\n */\n scanLine(data, scale, text) {\n let x = 0;\n let w = 0;\n let lastSpace = -1;\n let wrappedWidth = 0;\n let prevCharCode = null;\n const maxWidth = this._maxWidth > 0 ? this._maxWidth : null;\n const chars = [];\n // Let's scan the text and work out if any of the lines are > maxWidth\n let end = true;\n for (let i = 0; i < text.length; i += 1) {\n end = i === text.length - 1;\n if (/(?:\\r\\n|\\r|\\n)/.test(text.charAt(i))) {\n return {\n width: w,\n text: text.substr(0, i),\n end,\n chars,\n };\n }\n let charCode = text.charCodeAt(i);\n let charData = data.chars[charCode];\n let c = 0;\n // If the character data isn't found in the data array\n // then we replace it with a blank space\n if (charData === undefined) {\n charCode = 32;\n charData = data.chars[charCode];\n }\n // Adjust for kerning from previous character to this one\n const kerning = prevCharCode && charData.kerning[prevCharCode] ? charData.kerning[prevCharCode] : 0;\n // Record the last space in the string and the current width\n if (/(\\s)/.test(text.charAt(i))) {\n lastSpace = i;\n wrappedWidth = w;\n }\n // What will the line width be if we add this character to it?\n c = (kerning + charData.texture.width + charData.xOffset) * scale;\n // Do we need to line-wrap?\n if (maxWidth && w + c >= maxWidth && lastSpace > -1) {\n // The last space was at \"lastSpace\" which was \"i - lastSpace\" characters ago\n return {\n width: wrappedWidth || w,\n text: text.substr(0, i - (i - lastSpace)),\n end,\n chars,\n };\n }\n w += (charData.xAdvance + kerning) * scale;\n chars.push(x + (charData.xOffset + kerning) * scale);\n x += (charData.xAdvance + kerning) * scale;\n prevCharCode = charCode;\n }\n return {\n width: w,\n text,\n end,\n chars,\n };\n }\n\n /**\n * Cleans the provided text by removing invalid characters and replacing them with a specified character.\n * @param {string} text - The text to clean.\n * @param {string} replace - The character to use for replacement of invalid characters (default: '').\n * @returns {string} The cleaned text.\n */\n cleanText(text, replace = '') {\n const data = this._data.font;\n if (!data) {\n return '';\n }\n const re = /\\r\\n|\\n\\r|\\n|\\r/g;\n const lines = text.replace(re, '\\n').split('\\n');\n for (let i = 0; i < lines.length; i += 1) {\n let output = '';\n const line = lines[i];\n for (let c = 0; c < line.length; c += 1) {\n if (data.chars[line.charCodeAt(c)]) {\n output = output.concat(line[c]);\n } else {\n output = output.concat(replace);\n }\n }\n lines[i] = output;\n }\n return lines.join('\\n');\n }\n\n /**\n * Updates the internal text rendering based on current properties and content.\n */\n updateText() {\n const data = this._data.font;\n if (!data) {\n return;\n }\n let text = this.text;\n const scale = this._fontSize / data.size;\n const lines = [];\n let y = 0;\n this.textWidth = 0;\n let line = { end: text.length === 0 };\n do {\n line = this.scanLine(data, scale, text);\n line.y = y;\n lines.push(line);\n if (line.width > this.textWidth) {\n this.textWidth = line.width;\n }\n y += data.lineHeight * scale;\n text = text.substr(line.text.length + 1);\n } while (line.end === false);\n this.textHeight = y;\n let t = 0;\n let align = 0;\n const ax = this.textWidth * this.anchor.x;\n const ay = this.textHeight * this.anchor.y;\n for (let i = 0; i < lines.length; i += 1) {\n const currentLine = lines[i];\n if (this._align === 'right') {\n align = this.textWidth - currentLine.width;\n } else if (this._align === 'center') {\n align = (this.textWidth - currentLine.width) / 2;\n }\n for (let c = 0; c < currentLine.text.length; c += 1) {\n let charCode = currentLine.text.charCodeAt(c);\n let charData = data.chars[charCode];\n if (charData === undefined) {\n charCode = 32;\n charData = data.chars[charCode];\n }\n let g = this._glyphs[t];\n if (g) {\n // Sprite already exists in the glyphs pool, so we'll reuse it for this letter\n g.texture = charData.texture;\n } else {\n // We need a new sprite as the pool is empty or exhausted\n g = new Image(this.game, 0, 0, charData.texture);\n g.name = currentLine.text[c];\n this._glyphs.push(g);\n }\n g.position.x = currentLine.chars[c] + align - ax;\n g.position.y = currentLine.y + charData.yOffset * scale - ay;\n g.scale.setTo(scale, scale);\n g.tint = this.tint;\n g.texture.requiresReTint = true;\n if (!g.parent) {\n this.addChild(g);\n }\n t += 1;\n }\n }\n // Remove unnecessary children\n // This moves them from the display list (children array) but retains them in the _glyphs pool\n for (let i = t; i < this._glyphs.length; i += 1) {\n this.removeChild(this._glyphs[i]);\n }\n }\n\n /**\n * Removes unused glyphs from the pool and returns the number removed.\n * @returns {number} The number of glyphs that were removed from the pool.\n */\n purgeGlyphs() {\n const len = this._glyphs.length;\n const kept = [];\n for (let i = 0; i < this._glyphs.length; i += 1) {\n if (this._glyphs[i].parent !== this) {\n this._glyphs[i].destroy();\n } else {\n kept.push(this._glyphs[i]);\n }\n }\n /** @type {Image[]} */\n this._glyphs = [];\n this._glyphs = kept;\n this.updateText();\n return len - kept.length;\n }\n\n /**\n * Updates the transform of this bitmap text, updating its text if needed.\n */\n updateTransform() {\n if (this.dirty || !this.anchor.equals(this._prevAnchor)) {\n this.updateText();\n this.dirty = false;\n this._prevAnchor.copyFrom(this.anchor);\n }\n super.updateTransform();\n }\n\n /**\n * Adds a color to a specific position in the text.\n * @param {string} value - The color to apply (in hex format or CSS color name).\n * @param {number} position - The character position to apply the color to.\n * @returns {BitmapText} This bitmap text instance for chaining.\n */\n addColor(value, position) {\n const color = typeof value === 'string' ? Number.parseInt(value.replace('#', ''), 16) : value;\n if (color !== this._tint) {\n this._tint = color;\n this.updateText();\n }\n return this;\n }\n\n /**\n * Gets the text alignment property.\n * @returns {string} The current text alignment (left, center, right).\n */\n get align() {\n return this._align;\n }\n\n /**\n * Sets the text alignment property.\n * @param {string} value - The new text alignment (left, center, right).\n */\n set align(value) {\n if (value !== this._align && (value === 'left' || value === 'center' || value === 'right')) {\n this._align = value;\n this.updateText();\n }\n }\n\n /**\n * Gets the tint color of this bitmap text.\n * @returns {number} The current tint color in RGB format.\n */\n get tint() {\n return this._tint;\n }\n\n /**\n * Sets the tint color of this bitmap text.\n * @param {number} value - The new tint color in RGB format.\n */\n set tint(value) {\n if (value !== this._tint) {\n this._tint = value;\n this.updateText();\n }\n }\n\n /**\n * Gets the fill color of this bitmap text as a hex string.\n * @returns {string} The current fill color in hex format.\n */\n get fill() {\n if (typeof this.tint === 'number') {\n let colorStr = this.tint.toString(16);\n while (colorStr.length < 6) {\n colorStr = `0${colorStr}`;\n }\n return `#${colorStr.toUpperCase()}`;\n }\n return this.tint;\n }\n\n /**\n * Sets the fill color of this bitmap text.\n * @param {string} value - The new fill color in hex format or CSS color name.\n */\n set fill(value) {\n this.tint = typeof value === 'string' ? Number.parseInt(value.replace('#', ''), 16) : value;\n }\n\n /**\n * Gets the font key used by this bitmap text.\n * @returns {string} The current font key.\n */\n get font() {\n return this._font;\n }\n\n /**\n * Sets the font key used by this bitmap text.\n * @param {string} value - The new font key to use.\n */\n set font(value) {\n const trimmedValue = value.trim();\n if (trimmedValue !== this._font) {\n this._font = trimmedValue;\n this._data = this.game.cache.getBitmapFont(this._font);\n this.updateText();\n }\n }\n\n /**\n * Gets the font size of this bitmap text.\n * @returns {number} The current font size.\n */\n get fontSize() {\n return this._fontSize;\n }\n\n /**\n * Sets the font size of this bitmap text.\n * @param {number} value - The new font size to use.\n */\n set fontSize(value) {\n value = Number.parseInt(value, 10);\n if (value !== this._fontSize && value > 0) {\n this._fontSize = value;\n this.updateText();\n }\n }\n\n /**\n * Gets the text content of this bitmap text.\n * @returns {string} The current text content.\n */\n get text() {\n return this._text;\n }\n\n /**\n * Sets the text content of this bitmap text.\n * @param {string | number | boolean | Date} value - The new text content to set.\n */\n set text(value) {\n const typedValue = value.toString();\n if (typedValue !== this._text) {\n this._text = typedValue || '';\n this.updateText();\n }\n }\n\n /**\n * Gets the maximum width of this bitmap text.\n * @returns {number} The current maximum width.\n */\n get maxWidth() {\n return this._maxWidth;\n }\n\n /**\n * Sets the maximum width of this bitmap text.\n * @param {number} value - The new maximum width to set.\n */\n set maxWidth(value) {\n if (value !== this._maxWidth) {\n this._maxWidth = value;\n this.updateText();\n }\n }\n\n /**\n * Gets whether smoothing is enabled for this bitmap text's font.\n * @returns {boolean} True if smoothing is enabled, false otherwise.\n */\n get smoothed() {\n return !this._data.base.scaleMode;\n }\n\n /**\n * Sets whether smoothing is enabled for this bitmap text's font.\n * @param {boolean} value - Whether to enable smoothing (true) or not (false).\n */\n set smoothed(value) {\n if (value) {\n this._data.base.scaleMode = SCALE_LINEAR;\n } else {\n this._data.base.scaleMode = SCALE_NEAREST;\n }\n }\n}\n","// @ts-nocheck\nimport { Point } from '../geom/point.js';\nimport { distance } from '../util/math.js';\nimport { GROUP } from './const.js';\n\nexport class InputHandler {\n /**\n * TBD.\n * @param {import('../display/image.js').Image} sprite - TBD.\n */\n constructor(sprite) {\n this.sprite = sprite;\n this.game = sprite.game;\n this.enabled = false;\n this.checked = false;\n this.priorityID = 0;\n this.useHandCursor = false;\n this._setHandCursor = false;\n this.isDragged = false;\n this.allowHorizontalDrag = true;\n this.allowVerticalDrag = true;\n this.bringToTop = false;\n this.snapOffset = null;\n this.snapOnDrag = false;\n this.snapOnRelease = false;\n this.snapX = 0;\n this.snapY = 0;\n this.snapOffsetX = 0;\n this.snapOffsetY = 0;\n this.pixelPerfectOver = false;\n this.pixelPerfectClick = false;\n this.pixelPerfectAlpha = 255;\n this.draggable = false;\n this.boundsRect = null;\n this.boundsSprite = null;\n this.scaleLayer = false;\n this.dragOffset = new Point();\n this.dragFromCenter = false;\n this.dragStopBlocksInputUp = false;\n this.dragStartPoint = new Point();\n this.dragDistanceThreshold = 0;\n this.dragTimeThreshold = 0;\n this.downPoint = new Point();\n this.snapPoint = new Point();\n this._dragPoint = new Point();\n this._dragPhase = false;\n this._pendingDrag = false;\n this._dragTimePass = false;\n this._dragDistancePass = false;\n this._wasEnabled = false;\n this._tempPoint = new Point();\n this._pointerData = [];\n this._pointerData.push({\n id: 0,\n x: 0,\n y: 0,\n camX: 0,\n camY: 0,\n isDown: false,\n isUp: false,\n isOver: false,\n isOut: false,\n timeOver: 0,\n timeOut: 0,\n timeDown: 0,\n timeUp: 0,\n downDuration: 0,\n isDragged: false,\n });\n }\n\n /**\n * TBD.\n * @param {number} priority - TBD.\n * @param {boolean} useHandCursor - TBD.\n * @returns {import('../display/display_object.js').DisplayObject} TBD.\n */\n start(priority = 0, useHandCursor = false) {\n // Turning on\n if (this.enabled === false) {\n // Register, etc\n this.game.input.interactiveItems.add(this);\n this.useHandCursor = useHandCursor;\n this.priorityID = priority;\n for (let i = 0; i < 10; i += 1) {\n this._pointerData[i] = {\n id: i,\n x: 0,\n y: 0,\n isDown: false,\n isUp: false,\n isOver: false,\n isOut: false,\n timeOver: 0,\n timeOut: 0,\n timeDown: 0,\n timeUp: 0,\n downDuration: 0,\n isDragged: false,\n };\n }\n this.snapOffset = new Point();\n this.enabled = true;\n this._wasEnabled = true;\n }\n this.sprite.events.onAddedToGroup.add(this.addedToGroup, this);\n this.sprite.events.onRemovedFromGroup.add(this.removedFromGroup, this);\n return this.sprite;\n }\n\n /**\n * TBD.\n */\n addedToGroup() {\n if (this._dragPhase) {\n return;\n }\n if (this._wasEnabled && !this.enabled) {\n this.start();\n }\n }\n\n /**\n * TBD.\n */\n removedFromGroup() {\n if (this._dragPhase) {\n return;\n }\n if (this.enabled) {\n this._wasEnabled = true;\n this.stop();\n } else {\n this._wasEnabled = false;\n }\n }\n\n /**\n * TBD.\n */\n reset() {\n this.enabled = false;\n for (let i = 0; i < 10; i += 1) {\n this._pointerData[i] = {\n id: i,\n x: 0,\n y: 0,\n isDown: false,\n isUp: false,\n isOver: false,\n isOut: false,\n timeOver: 0,\n timeOut: 0,\n timeDown: 0,\n timeUp: 0,\n downDuration: 0,\n isDragged: false,\n };\n }\n }\n\n /**\n * TBD.\n */\n stop() {\n if (this.enabled) {\n this.enabled = false;\n this.game.input.interactiveItems.remove(this);\n }\n }\n\n /**\n * TBD.\n */\n destroy() {\n if (this.sprite) {\n if (this._setHandCursor) {\n this.game.canvas.style.cursor = 'default';\n this._setHandCursor = false;\n }\n this.enabled = false;\n this.game.input.interactiveItems.remove(this);\n this._pointerData.length = 0;\n this.boundsRect = null;\n this.boundsSprite = null;\n this.sprite = null;\n }\n }\n\n /**\n * TBD.\n * @param {number} highestID - TBD.\n * @param {number} highestRenderID - TBD.\n * @param {boolean} includePixelPerfect - TBD.\n * @returns {boolean} TBD.\n */\n validForInput(highestID, highestRenderID, includePixelPerfect = true) {\n if (\n !this.enabled ||\n this.sprite.scale.x === 0 ||\n this.sprite.scale.y === 0 ||\n this.priorityID < this.game.input.minPriorityID ||\n (this.sprite.parent && this.sprite.parent.ignoreChildInput)\n ) {\n return false;\n }\n // If we're trying to specifically IGNORE pixel perfect objects, then set includePixelPerfect to false and skip it\n if (!includePixelPerfect && (this.pixelPerfectClick || this.pixelPerfectOver)) {\n return false;\n }\n if (this.priorityID > highestID || (this.priorityID === highestID && this.sprite.renderOrderID > highestRenderID)) {\n return true;\n }\n return false;\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n isPixelPerfect() {\n return this.pixelPerfectClick || this.pixelPerfectOver;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {number} TBD.\n */\n pointerX(pointerId = 0) {\n return this._pointerData[pointerId].x;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {number} TBD.\n */\n pointerY(pointerId = 0) {\n return this._pointerData[pointerId].y;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {boolean} TBD.\n */\n pointerDown(pointerId = 0) {\n return this._pointerData[pointerId].isDown;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {boolean} TBD.\n */\n pointerUp(pointerId = 0) {\n return this._pointerData[pointerId].isUp;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {number} TBD.\n */\n pointerTimeDown(pointerId = 0) {\n return this._pointerData[pointerId].timeDown;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {number} TBD.\n */\n pointerTimeUp(pointerId = 0) {\n return this._pointerData[pointerId].timeUp;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {boolean} TBD.\n */\n pointerOver(pointerId = null) {\n if (!this.enabled) {\n return false;\n }\n if (pointerId === undefined || pointerId === null) {\n for (let i = 0; i < 10; i += 1) {\n if (this._pointerData[i].isOver) {\n return true;\n }\n }\n return false;\n }\n return this._pointerData[pointerId].isOver;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {boolean} TBD.\n */\n pointerOut(pointerId = null) {\n if (!this.enabled) {\n return false;\n }\n if (pointerId === undefined || pointerId === null) {\n for (let i = 0; i < 10; i += 1) {\n if (this._pointerData[i].isOut) {\n return true;\n }\n }\n }\n return this._pointerData[pointerId].isOut;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {number} TBD.\n */\n pointerTimeOver(pointerId = 0) {\n return this._pointerData[pointerId].timeOver;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {number} TBD.\n */\n pointerTimeOut(pointerId = 0) {\n return this._pointerData[pointerId].timeOut;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {boolean} TBD.\n */\n pointerDragged(pointerId = 0) {\n return this._pointerData[pointerId].isDragged;\n }\n\n /**\n * TBD.\n * @param {import('./input_pointer.js').Pointer} pointer - TBD.\n * @param {boolean} fastTest - TBD.\n * @returns {boolean} TBD.\n */\n checkPointerDown(pointer, fastTest = false) {\n if (\n !pointer.isDown ||\n !this.enabled ||\n !this.sprite ||\n !this.sprite.parent ||\n !this.sprite.visible ||\n !this.sprite.parent.visible ||\n this.sprite.worldScale.x === 0 ||\n this.sprite.worldScale.y === 0\n ) {\n return false;\n }\n // Need to pass it a temp point, in case we need it again for the pixel check\n if (this.game.input.hitTest(this.sprite, pointer, this._tempPoint)) {\n if (!fastTest && this.pixelPerfectClick) {\n return this.checkPixel(this._tempPoint.x, this._tempPoint.y);\n }\n return true;\n }\n return false;\n }\n\n /**\n * TBD.\n * @param {import('./input_pointer.js').Pointer} pointer - TBD.\n * @param {boolean} fastTest - TBD.\n * @returns {boolean} TBD.\n */\n checkPointerOver(pointer, fastTest = false) {\n if (\n !this.enabled ||\n !this.sprite ||\n !this.sprite.parent ||\n !this.sprite.visible ||\n !this.sprite.parent.visible ||\n this.sprite.worldScale.x === 0 ||\n this.sprite.worldScale.y === 0\n ) {\n return false;\n }\n // Need to pass it a temp point, in case we need it again for the pixel check\n if (this.game.input.hitTest(this.sprite, pointer, this._tempPoint)) {\n if (!fastTest && this.pixelPerfectOver) {\n return this.checkPixel(this._tempPoint.x, this._tempPoint.y);\n }\n return true;\n }\n return false;\n }\n\n /**\n * TBD.\n * @param {number} x - TBD.\n * @param {number} y - TBD.\n * @param {import('./input_pointer.js').Pointer} pointer - TBD.\n * @returns {boolean} TBD.\n */\n checkPixel(x, y, pointer) {\n // Grab a pixel from our image into the hitCanvas and then test it\n if (this.sprite.texture.baseTexture.source) {\n if (x === null && y === null) {\n // Use the pointer parameter\n this.game.input.getLocalPosition(this.sprite, pointer, this._tempPoint);\n x = this._tempPoint.x;\n y = this._tempPoint.y;\n }\n if (this.sprite.anchor.x !== 0) {\n x -= -this.sprite.texture.frame.width * this.sprite.anchor.x;\n }\n if (this.sprite.anchor.y !== 0) {\n y -= -this.sprite.texture.frame.height * this.sprite.anchor.y;\n }\n x += this.sprite.texture.frame.x;\n y += this.sprite.texture.frame.y;\n if (this.sprite.texture.trim) {\n x -= this.sprite.texture.trim.x;\n y -= this.sprite.texture.trim.y;\n // If the coordinates are outside the trim area we return false immediately, to save doing a draw call\n if (\n x < this.sprite.texture.crop.x ||\n x > this.sprite.texture.crop.right ||\n y < this.sprite.texture.crop.y ||\n y > this.sprite.texture.crop.bottom\n ) {\n this._dx = x;\n this._dy = y;\n return false;\n }\n }\n this._dx = x;\n this._dy = y;\n this.game.input.hitContext.clearRect(0, 0, 1, 1);\n this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source, x, y, 1, 1, 0, 0, 1, 1);\n const rgb = this.game.input.hitContext.getImageData(0, 0, 1, 1);\n if (rgb.data[3] >= this.pixelPerfectAlpha) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * TBD.\n * @param {import('./input_pointer.js').Pointer} pointer - TBD.\n * @returns {boolean} TBD.\n */\n update(pointer) {\n if (this.sprite === null || this.sprite.parent === undefined) {\n // Abort. We've been destroyed.\n return false;\n }\n if (!this.enabled || !this.sprite.visible || !this.sprite.parent.visible) {\n this._pointerOutHandler(pointer);\n return false;\n }\n if (this._pendingDrag) {\n if (!this._dragDistancePass) {\n this._dragDistancePass =\n distance(pointer.x, pointer.y, this.downPoint.x, this.downPoint.y) >= this.dragDistanceThreshold;\n }\n if (this._dragDistancePass && this._dragTimePass) {\n this.startDrag(pointer);\n }\n return true;\n } else if (this.draggable && this._draggedPointerID === pointer.id) {\n return this.updateDrag(pointer, false);\n } else if (this._pointerData[pointer.id].isOver) {\n if (this.checkPointerOver(pointer)) {\n this._pointerData[pointer.id].x = pointer.x - this.sprite.x;\n this._pointerData[pointer.id].y = pointer.y - this.sprite.y;\n return true;\n }\n this._pointerOutHandler(pointer);\n return false;\n }\n return false;\n }\n\n /**\n * TBD.\n * @param {import('./input_pointer.js').Pointer} pointer - TBD.\n * @param {boolean} silent - TBD.\n */\n _pointerOverHandler(pointer, silent) {\n if (this.sprite === null) {\n // Abort. We've been destroyed.\n return;\n }\n const data = this._pointerData[pointer.id];\n if (data.isOver === false || pointer.dirty) {\n const sendEvent = data.isOver === false;\n data.isOver = true;\n data.isOut = false;\n data.timeOver = this.game.time.time;\n data.x = pointer.x - this.sprite.x;\n data.y = pointer.y - this.sprite.y;\n if (this.useHandCursor && data.isDragged === false) {\n this.game.canvas.style.cursor = 'pointer';\n this._setHandCursor = true;\n }\n if (!silent && sendEvent && this.sprite && this.sprite.events) {\n this.sprite.events.onInputOver$dispatch(this.sprite, pointer);\n }\n if (this.sprite.parent && this.sprite.parent.type === GROUP) {\n this.sprite.parent.onChildInputOver.dispatch(this.sprite, pointer);\n }\n }\n }\n\n /**\n * TBD.\n * @param {import('./input_pointer.js').Pointer} pointer - TBD.\n * @param {boolean} silent - TBD.\n */\n _pointerOutHandler(pointer, silent = false) {\n if (this.sprite === null) {\n // Abort. We've been destroyed.\n return;\n }\n const data = this._pointerData[pointer.id];\n data.isOver = false;\n data.isOut = true;\n data.timeOut = this.game.time.time;\n if (this.useHandCursor && data.isDragged === false) {\n this.game.canvas.style.cursor = 'default';\n this._setHandCursor = false;\n }\n if (!silent && this.sprite && this.sprite.events) {\n this.sprite.events.onInputOut$dispatch(this.sprite, pointer);\n if (this.sprite && this.sprite.parent && this.sprite.parent.type === GROUP) {\n this.sprite.parent.onChildInputOut.dispatch(this.sprite, pointer);\n }\n }\n }\n\n /**\n * TBD.\n * @param {import('./input_pointer.js').Pointer} pointer - TBD.\n */\n _touchedHandler(pointer) {\n if (this.sprite === null) {\n // Abort. We've been destroyed.\n return;\n }\n const data = this._pointerData[pointer.id];\n if (!data.isDown && data.isOver) {\n if (this.pixelPerfectClick && !this.checkPixel(null, null, pointer)) {\n return;\n }\n data.isDown = true;\n data.isUp = false;\n data.timeDown = this.game.time.time;\n this.downPoint.setTo(pointer.x, pointer.y);\n // It's possible the onInputDown event creates a new Sprite that is on-top of this one, so we ought to force a Pointer update\n pointer.dirty = true;\n if (this.sprite && this.sprite.events) {\n this.sprite.events.onInputDown$dispatch(this.sprite, pointer);\n // The event above might have destroyed this sprite.\n if (this.sprite && this.sprite.parent && this.sprite.parent.type === GROUP) {\n this.sprite.parent.onChildInputDown.dispatch(this.sprite, pointer);\n }\n // The events might have destroyed this sprite.\n if (this.sprite === null) {\n return;\n }\n }\n // Start drag\n if (this.draggable && this.isDragged === false) {\n if (this.dragTimeThreshold === 0 && this.dragDistanceThreshold === 0) {\n this.startDrag(pointer);\n } else {\n this._pendingDrag = true;\n this._dragDistancePass = this.dragDistanceThreshold === 0;\n if (this.dragTimeThreshold > 0) {\n this._dragTimePass = false;\n this.game.time.events.add(this.dragTimeThreshold, this.dragTimeElapsed, this, pointer);\n } else {\n this._dragTimePass = true;\n }\n }\n }\n if (this.bringToTop) {\n this.sprite.bringToTop();\n }\n }\n }\n\n /**\n * TBD.\n * @param {import('./input_pointer.js').Pointer} pointer - TBD.\n */\n dragTimeElapsed(pointer) {\n this._dragTimePass = true;\n if (this._pendingDrag && this.sprite) {\n if (this._dragDistancePass) {\n this.startDrag(pointer);\n }\n }\n }\n\n /**\n * TBD.\n * @param {import('./input_pointer.js').Pointer} pointer - TBD.\n */\n _releasedHandler(pointer) {\n if (this.sprite === null) {\n // Abort. We've been destroyed.\n return;\n }\n const data = this._pointerData[pointer.id];\n // If was previously touched by this Pointer, check if still is AND still over this item\n if (data.isDown && pointer.isUp) {\n data.isDown = false;\n data.isUp = true;\n data.timeUp = this.game.time.time;\n data.downDuration = data.timeUp - data.timeDown;\n // Only release the InputUp signal if the pointer is still over this sprite\n let isOver = this.checkPointerOver(pointer);\n if (this.sprite && this.sprite.events) {\n if (\n !this.dragStopBlocksInputUp ||\n (this.dragStopBlocksInputUp && !(this.draggable && this.isDragged && this._draggedPointerID === pointer.id))\n ) {\n this.sprite.events.onInputUp$dispatch(this.sprite, pointer, isOver);\n }\n if (this.sprite && this.sprite.parent && this.sprite.parent.type === GROUP) {\n this.sprite.parent.onChildInputUp.dispatch(this.sprite, pointer, isOver);\n }\n // The onInputUp event may have changed the sprite so that checkPointerOver is no longer true, so update it.\n if (isOver) {\n isOver = this.checkPointerOver(pointer);\n }\n }\n data.isOver = isOver;\n if (!isOver && this.useHandCursor) {\n this.game.canvas.style.cursor = 'default';\n this._setHandCursor = false;\n }\n // It's possible the onInputUp event created a new Sprite that is on-top of this one, so force a Pointer update\n pointer.dirty = true;\n this._pendingDrag = false;\n // Stop drag\n if (this.draggable && this.isDragged && this._draggedPointerID === pointer.id) {\n this.stopDrag(pointer);\n }\n }\n }\n\n /**\n * TBD.\n * @param {import('./input_pointer.js').Pointer} pointer - TBD.\n * @param {boolean} fromStart - TBD.\n * @returns {boolean} TBD.\n */\n updateDrag(pointer, fromStart = false) {\n if (pointer.isUp) {\n this.stopDrag(pointer);\n return false;\n }\n const px = this.globalToLocalX(pointer.x) + this._dragPoint.x + this.dragOffset.x;\n const py = this.globalToLocalY(pointer.y) + this._dragPoint.y + this.dragOffset.y;\n const cx = 0;\n const cy = 0;\n if (this.allowHorizontalDrag) {\n this.sprite.x = px + cx;\n }\n if (this.allowVerticalDrag) {\n this.sprite.y = py + cy;\n }\n if (this.boundsRect) {\n this.checkBoundsRect();\n }\n if (this.boundsSprite) {\n this.checkBoundsSprite();\n }\n if (this.snapOnDrag) {\n this.sprite.x =\n Math.round((this.sprite.x - (this.snapOffsetX % this.snapX)) / this.snapX) * this.snapX +\n (this.snapOffsetX % this.snapX);\n this.sprite.y =\n Math.round((this.sprite.y - (this.snapOffsetY % this.snapY)) / this.snapY) * this.snapY +\n (this.snapOffsetY % this.snapY);\n this.snapPoint.setTo(this.sprite.x, this.sprite.y);\n }\n this.sprite.events.onDragUpdate.dispatch(this.sprite, pointer, px, py, this.snapPoint, fromStart);\n return true;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @param {number} delay - TBD.\n * @returns {boolean} TBD.\n */\n justOver(pointerId = 0, delay = 500) {\n return this._pointerData[pointerId].isOver && this.overDuration(pointerId) < delay;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @param {number} delay - TBD.\n * @returns {boolean} TBD.\n */\n justOut(pointerId = 0, delay = 500) {\n return this._pointerData[pointerId].isOut && this.game.time.time - this._pointerData[pointerId].timeOut < delay;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @param {number} delay - TBD.\n * @returns {boolean} TBD.\n */\n justPressed(pointerId = 0, delay = 500) {\n return this._pointerData[pointerId].isDown && this.downDuration(pointerId) < delay;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @param {number} delay - TBD.\n * @returns {boolean} TBD.\n */\n justReleased(pointerId = 0, delay = 500) {\n return this._pointerData[pointerId].isUp && this.game.time.time - this._pointerData[pointerId].timeUp < delay;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {number} TBD.\n */\n overDuration(pointerId = 0) {\n if (this._pointerData[pointerId].isOver) {\n return this.game.time.time - this._pointerData[pointerId].timeOver;\n }\n return -1;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {number} TBD.\n */\n downDuration(pointerId = 0) {\n if (this._pointerData[pointerId].isDown) {\n return this.game.time.time - this._pointerData[pointerId].timeDown;\n }\n return -1;\n }\n\n /**\n * TBD.\n * @param {boolean} lockCenter - TBD.\n * @param {boolean} bringToTop - TBD.\n * @param {boolean} pixelPerfect - TBD.\n * @param {number} alphaThreshold - TBD.\n * @param {import('../geom/rectangle.js').Rectangle | null | undefined} boundsRect - TBD.\n * @param {import('../display/display_object.js').DisplayObject | null | undefined} boundsSprite - TBD.\n */\n enableDrag(\n lockCenter = false,\n bringToTop = false,\n pixelPerfect = false,\n alphaThreshold = 255,\n boundsRect = null,\n boundsSprite = null\n ) {\n this._dragPoint = new Point();\n this.draggable = true;\n this.bringToTop = bringToTop;\n this.dragOffset = new Point();\n this.dragFromCenter = lockCenter;\n this.pixelPerfectClick = pixelPerfect;\n this.pixelPerfectAlpha = alphaThreshold;\n if (boundsRect) {\n this.boundsRect = boundsRect;\n }\n if (boundsSprite) {\n this.boundsSprite = boundsSprite;\n }\n }\n\n /**\n * TBD.\n */\n disableDrag() {\n if (this._pointerData) {\n for (let i = 0; i < 10; i += 1) {\n this._pointerData[i].isDragged = false;\n }\n }\n this.draggable = false;\n this.isDragged = false;\n this._draggedPointerID = -1;\n this._pendingDrag = false;\n }\n\n /**\n * TBD.\n * @param {import('./input_pointer.js').Pointer} pointer - TBD.\n */\n startDrag(pointer) {\n const x = this.sprite.x;\n const y = this.sprite.y;\n this.isDragged = true;\n this._draggedPointerID = pointer.id;\n this._pointerData[pointer.id].camX = 0;\n this._pointerData[pointer.id].camY = 0;\n this._pointerData[pointer.id].isDragged = true;\n if (this.dragFromCenter) {\n const bounds = this.sprite.getBounds();\n this.sprite.x = this.globalToLocalX(pointer.x) + (this.sprite.x - bounds.centerX);\n this.sprite.y = this.globalToLocalY(pointer.y) + (this.sprite.y - bounds.centerY);\n }\n this._dragPoint.setTo(\n this.sprite.x - this.globalToLocalX(pointer.x),\n this.sprite.y - this.globalToLocalY(pointer.y)\n );\n this.updateDrag(pointer, true);\n if (this.bringToTop) {\n this._dragPhase = true;\n this.sprite.parent.bringToTop(this.sprite);\n }\n this.dragStartPoint.setTo(x, y);\n this.sprite.events.onDragStart$dispatch(this.sprite, pointer, x, y);\n this._pendingDrag = false;\n }\n\n /**\n * TBD.\n * @param {number} x - TBD.\n * @returns {number} TBD.\n */\n globalToLocalX(x) {\n if (this.scaleLayer) {\n x -= this.game.scale.grid.boundsFluid.x;\n x *= this.game.scale.grid.scaleFluidInversed.x;\n }\n return x;\n }\n\n /**\n * TBD.\n * @param {number} y - TBD.\n * @returns {number} TBD.\n */\n globalToLocalY(y) {\n if (this.scaleLayer) {\n y -= this.game.scale.grid.boundsFluid.y;\n y *= this.game.scale.grid.scaleFluidInversed.y;\n }\n return y;\n }\n\n /**\n * TBD.\n * @param {import('./input_pointer.js').Pointer} pointer - TBD.\n */\n stopDrag(pointer) {\n this.isDragged = false;\n this._draggedPointerID = -1;\n this._pointerData[pointer.id].isDragged = false;\n this._dragPhase = false;\n this._pendingDrag = false;\n if (this.snapOnRelease) {\n this.sprite.x =\n Math.round((this.sprite.x - (this.snapOffsetX % this.snapX)) / this.snapX) * this.snapX +\n (this.snapOffsetX % this.snapX);\n this.sprite.y =\n Math.round((this.sprite.y - (this.snapOffsetY % this.snapY)) / this.snapY) * this.snapY +\n (this.snapOffsetY % this.snapY);\n }\n this.sprite.events.onDragStop$dispatch(this.sprite, pointer);\n if (this.checkPointerOver(pointer) === false) {\n this._pointerOutHandler(pointer);\n }\n }\n\n /**\n * TBD.\n * @param {boolean} allowHorizontal - TBD.\n * @param {boolean} allowVertical - TBD.\n */\n setDragLock(allowHorizontal = true, allowVertical = true) {\n this.allowHorizontalDrag = allowHorizontal;\n this.allowVerticalDrag = allowVertical;\n }\n\n /**\n * TBD.\n * @param {number} snapX - TBD.\n * @param {number} snapY - TBD.\n * @param {boolean} onDrag - TBD.\n * @param {boolean} onRelease - TBD.\n * @param {number} snapOffsetX - TBD.\n * @param {number} snapOffsetY - TBD.\n */\n enableSnap(snapX, snapY, onDrag = true, onRelease = false, snapOffsetX = 0, snapOffsetY = 0) {\n this.snapX = snapX;\n this.snapY = snapY;\n this.snapOffsetX = snapOffsetX;\n this.snapOffsetY = snapOffsetY;\n this.snapOnDrag = onDrag;\n this.snapOnRelease = onRelease;\n }\n\n /**\n * TBD.\n */\n disableSnap() {\n this.snapOnDrag = false;\n this.snapOnRelease = false;\n }\n\n /**\n * TBD.\n */\n checkBoundsRect() {\n if (this.sprite.left < this.boundsRect.left) {\n this.sprite.x = this.boundsRect.x + this.sprite.offsetX;\n } else if (this.sprite.right > this.boundsRect.right) {\n this.sprite.x = this.boundsRect.right - (this.sprite.width - this.sprite.offsetX);\n }\n if (this.sprite.top < this.boundsRect.top) {\n this.sprite.y = this.boundsRect.top + this.sprite.offsetY;\n } else if (this.sprite.bottom > this.boundsRect.bottom) {\n this.sprite.y = this.boundsRect.bottom - (this.sprite.height - this.sprite.offsetY);\n }\n }\n\n /**\n * TBD.\n */\n checkBoundsSprite() {\n if (this.sprite.left < this.boundsSprite.left) {\n this.sprite.x = this.boundsSprite.left + this.sprite.offsetX;\n } else if (this.sprite.right > this.boundsSprite.right) {\n this.sprite.x = this.boundsSprite.right - (this.sprite.width - this.sprite.offsetX);\n }\n if (this.sprite.top < this.boundsSprite.top) {\n this.sprite.y = this.boundsSprite.top + this.sprite.offsetY;\n } else if (this.sprite.bottom > this.boundsSprite.bottom) {\n this.sprite.y = this.boundsSprite.bottom - (this.sprite.height - this.sprite.offsetY);\n }\n }\n}\n","// @ts-nocheck\nimport { BUTTON, POINTER_CONTACT } from '../core/const.js';\nimport { InputHandler } from '../core/input_handler.js';\nimport { Signal } from '../core/signal.js';\nimport { Image } from './image.js';\n\nconst STATE_OVER = 'Over';\nconst STATE_OUT = 'Out';\nconst STATE_DOWN = 'Down';\nconst STATE_UP = 'Up';\nconst STATE_DISABLED = 'Disabled';\n\nexport class Button extends Image {\n /**\n * Creates a new Button instance.\n * @param {import('../core/game.js').Game} game - The game instance this button belongs to.\n * @param {number} x - The x position of the button.\n * @param {number} y - The y position of the button.\n * @param {string} key - The texture key to use for the button.\n * @param {Function} callback - The function to call when the button is clicked.\n * @param {object} callbackContext - The context in which to call the callback function.\n * @param {string} overFrame - The frame identifier to use when the mouse is over the button.\n * @param {string} outFrame - The frame identifier to use when the mouse is outside the button.\n * @param {string} downFrame - The frame identifier to use when the button is pressed.\n * @param {string} upFrame - The frame identifier to use when the button is released.\n * @param {string} disabledFrame - The frame identifier to use when the button is disabled.\n */\n constructor(\n game,\n x = 0,\n y = 0,\n key = null,\n callback = null,\n callbackContext = null,\n overFrame = null,\n outFrame = null,\n downFrame = null,\n upFrame = null,\n disabledFrame = null\n ) {\n super(game, x, y, key, outFrame);\n this.type = BUTTON;\n this._onOverFrame = null;\n this._onOutFrame = null;\n this._onDownFrame = null;\n this._onUpFrame = null;\n this._onDisabledFrame = null;\n this.onInputOver = new Signal();\n this.onInputOut = new Signal();\n this.onInputDown = new Signal();\n this.onInputUp = new Signal();\n this.onOverMouseOnly = true;\n this.justReleasedPreventsOver = POINTER_CONTACT;\n this.freezeFrames = false;\n this.forceOut = false;\n this.input = new InputHandler(this);\n this.input.start(0, true);\n this.input.useHandCursor = true;\n this.setFrames(overFrame, outFrame, downFrame, upFrame, disabledFrame);\n if (callback !== null) {\n this.onInputUp.add(callback, callbackContext);\n }\n // Redirect the input events to here so we can handle animation updates, etc\n this.events.onInputOver.add(this.onInputOverHandler, this);\n this.events.onInputOut.add(this.onInputOutHandler, this);\n this.events.onInputDown.add(this.onInputDownHandler, this);\n this.events.onInputUp.add(this.onInputUpHandler, this);\n }\n\n /**\n * Destroys this button and cleans up resources.\n */\n destroy() {\n this._onOverFrame = null;\n this._onOutFrame = null;\n this._onDownFrame = null;\n this._onUpFrame = null;\n this._onDisabledFrame = null;\n if (this.onInputOver) {\n this.onInputOver.dispose();\n this.onInputOut.dispose();\n this.onInputDown.dispose();\n this.onInputUp.dispose();\n }\n this.onInputOver = null;\n this.onInputOut = null;\n this.onInputDown = null;\n this.onInputUp = null;\n if (this.input) {\n this.input.destroy();\n }\n this.input = null;\n super.destroy();\n }\n\n /**\n * Sets whether this button is enabled or disabled.\n * @param {boolean} isEnabled - Whether the button should be enabled (true) or disabled (false).\n * @param {boolean} isImmediate - Whether to change the state immediately or with a delay (default: false).\n */\n setEnabled(isEnabled, isImmediate = false) {\n this.input.enabled = isEnabled;\n if (isImmediate) {\n this.changeStateFrame(isEnabled ? STATE_UP : STATE_DISABLED);\n } else {\n setTimeout(() => {\n this.changeStateFrame(isEnabled ? STATE_UP : STATE_DISABLED);\n }, 1);\n }\n }\n\n /**\n * Clears all the frame settings for this button.\n */\n clearFrames() {\n this.setFrames(null, null, null, null, null);\n }\n\n /**\n * Called when this button is removed from the world.\n */\n removedFromWorld() {\n this.inputEnabled = false;\n }\n\n /**\n * Sets a specific frame for a particular state of this button.\n * @param {string} state - The state name (Over, Out, Down, Up, Disabled).\n * @param {string} frame - The frame identifier to set for this state.\n * @param {boolean} switchImmediately - Whether to switch to the new frame immediately (default: false).\n */\n setStateFrame(state, frame, switchImmediately = false) {\n const frameKey = `_on${state}Frame`;\n if (frame) {\n this[frameKey] = frame;\n if (switchImmediately) {\n this.changeStateFrame(state);\n }\n } else {\n this[frameKey] = null;\n }\n }\n\n /**\n * Changes the frame of this button to match the specified state.\n * @param {string} newState - The new state to change to (Over, Out, Down, Up, Disabled).\n * @returns {boolean} True if the frame was changed, false otherwise.\n */\n changeStateFrame(newState) {\n if (this.freezeFrames) {\n return false;\n }\n const state = this.input.enabled || !this._onDisabledFrame ? newState : STATE_DISABLED;\n const frameKey = `_on${state}Frame`;\n const frame = this[frameKey];\n if (typeof frame === 'string') {\n this.frameName = frame;\n return true;\n } else if (typeof frame === 'number') {\n this.frame = frame;\n return true;\n }\n return false;\n }\n\n /**\n * Sets the frame identifiers for all states of this button.\n * @param {string} overFrame - The frame identifier to use when the mouse is over the button.\n * @param {string} outFrame - The frame identifier to use when the mouse is outside the button.\n * @param {string} downFrame - The frame identifier to use when the button is pressed.\n * @param {string} upFrame - The frame identifier to use when the button is released.\n * @param {string} disabledFrame - The frame identifier to use when the button is disabled.\n */\n setFrames(overFrame, outFrame, downFrame, upFrame, disabledFrame = null) {\n this.setStateFrame(STATE_OVER, overFrame, this.input.pointerOver());\n this.setStateFrame(STATE_OUT, outFrame, !this.input.pointerOver());\n this.setStateFrame(STATE_DOWN, downFrame, this.input.pointerDown());\n this.setStateFrame(STATE_UP, upFrame, this.input.pointerUp());\n if (disabledFrame) {\n this.setStateFrame(STATE_DISABLED, disabledFrame, !this.input.enabled);\n }\n }\n\n /**\n * Handles the input over event for this button.\n * @param {object} sprite - The sprite that triggered the event.\n * @param {object} pointer - The pointer that triggered the event.\n */\n onInputOverHandler(sprite, pointer) {\n if (pointer.justReleased() && (this.justReleasedPreventsOver & pointer.pointerMode) === pointer.pointerMode) {\n // If the Pointer was only just released then we don't fire an over event\n return;\n }\n this.changeStateFrame(STATE_OVER);\n if (this.onOverMouseOnly && !pointer.isMouse) {\n return;\n }\n if (this.onInputOver) {\n this.onInputOver.dispatch(this, pointer);\n }\n }\n\n /**\n * Handles the input out event for this button.\n * @param {object} sprite - The sprite that triggered the event.\n * @param {object} pointer - The pointer that triggered the event.\n */\n onInputOutHandler(sprite, pointer) {\n this.changeStateFrame(STATE_OUT);\n if (this.onInputOut) {\n this.onInputOut.dispatch(this, pointer);\n }\n }\n\n /**\n * Handles the input down event for this button.\n * @param {object} sprite - The sprite that triggered the event.\n * @param {object} pointer - The pointer that triggered the event.\n */\n onInputDownHandler(sprite, pointer) {\n this.changeStateFrame(STATE_DOWN);\n if (this.onInputDown) {\n this.onInputDown.dispatch(this, pointer);\n }\n }\n\n /**\n * Handles the input up event for this button.\n * @param {object} sprite - The sprite that triggered the event.\n * @param {object} pointer - The pointer that triggered the event.\n * @param {boolean} isOver - Whether the pointer is currently over the button (default: true).\n */\n onInputUpHandler(sprite, pointer, isOver) {\n if (this.onInputUp) {\n this.onInputUp.dispatch(this, pointer, isOver);\n }\n if (this.freezeFrames) {\n return;\n }\n if (this.forceOut === true || (this.forceOut & pointer.pointerMode) === pointer.pointerMode) {\n this.changeStateFrame(STATE_OUT);\n } else {\n const changedUp = this.changeStateFrame(STATE_UP);\n if (!changedUp) {\n // No Up frame to show..\n if (isOver) {\n this.changeStateFrame(STATE_OVER);\n } else {\n this.changeStateFrame(STATE_OUT);\n }\n }\n }\n }\n\n /**\n * Gets whether input is currently enabled for this button.\n * @returns {boolean} True if input is enabled, false otherwise.\n */\n get inputEnabled() {\n return this.input && this.input.enabled;\n }\n\n /**\n * Sets whether input is currently enabled for this button.\n * @param {boolean} value - Whether to enable (true) or disable (false) input.\n */\n set inputEnabled(value) {\n if (value) {\n if (this.input === null) {\n this.input = new InputHandler(this);\n this.input.start();\n } else if (this.input && !this.input.enabled) {\n this.input.start();\n }\n } else if (this.input && this.input.enabled) {\n this.input.stop();\n }\n }\n}\n","import { degToRad, distance } from '../../util/math.js';\nimport { Circle } from '../circle.js';\nimport { Point } from '../point.js';\n\n/**\n * Clones a circle.\n * @param {Circle} input - The circle to clone.\n * @param {Circle} output - Optional circle to store the result in.\n * @returns {Circle} The cloned circle.\n */\nexport const clone = (input, output = null) => {\n const result = output || new Circle();\n result.x = input.x;\n result.y = input.y;\n result.diameter = input.diameter;\n return result;\n};\n\n/**\n * Checks if a point is contained within the circle.\n * @param {Circle} a - The circle to check.\n * @param {number} x - The x coordinate of the point.\n * @param {number} y - The y coordinate of the point.\n * @returns {boolean} True if the point is contained within the circle, false otherwise.\n */\nexport const contains = (a, x, y) => {\n if (a.radius > 0 && x >= a.left && x <= a.right && y >= a.top && y <= a.bottom) {\n const dx = (a.x - x) * (a.x - x);\n const dy = (a.y - y) * (a.y - y);\n return dx + dy <= a.radius * a.radius;\n }\n return false;\n};\n\n/**\n * Checks if two circles are equal.\n * @param {Circle} a - The first circle to compare.\n * @param {Circle} b - The second circle to compare.\n * @returns {boolean} True if the circles are equal, false otherwise.\n */\nexport const equals = (a, b) => {\n return a.x === b.x && a.y === b.y && a.diameter === b.diameter;\n};\n\n/**\n * Checks if two circles intersect.\n * @param {Circle} a - The first circle to check.\n * @param {Circle} b - The second circle to check.\n * @returns {boolean} True if the circles intersect, false otherwise.\n */\nexport const intersects = (a, b) => {\n return distance(a.x, a.y, b.x, b.y) <= a.radius + b.radius;\n};\n\n/**\n * Gets a point on the circumference of the circle at the specified angle.\n * @param {Circle} a - The circle to get the point from.\n * @param {number} angle - The angle in radians or degrees (depending on asDegrees).\n * @param {boolean} asDegrees - True if the angle is in degrees, false if in radians.\n * @param {Point} output - Optional point to store the result in.\n * @returns {Point} The point on the circumference of the circle.\n */\nexport const circumferencePoint = (a, angle, asDegrees = false, output = null) => {\n const result = output || new Point();\n if (asDegrees === true) {\n angle = degToRad(angle);\n }\n result.x = a.x + a.radius * Math.cos(angle);\n result.y = a.y + a.radius * Math.sin(angle);\n return result;\n};\n\n/**\n * Gets a point on the circumference of the circle at the specified angle.\n * @param {Circle} a - The circle to get the point from.\n * @param {number} angle - The angle in radians or degrees (depending on asDegrees).\n * @param {boolean} asDegrees - True if the angle is in degrees, false if in radians.\n * @param {Point} output - Optional point to store the result in.\n * @returns {Point} The point on the circumference of the circle.\n */\nexport const intersectsPoint = (a, angle, asDegrees = false, output = null) => {\n const result = output || new Point();\n if (asDegrees === true) {\n angle = degToRad(angle);\n }\n result.x = a.x + a.radius * Math.cos(angle);\n result.y = a.y + a.radius * Math.sin(angle);\n return result;\n};\n\n/**\n * Checks if a circle intersects with a rectangle.\n * @param {Circle} c - The circle to check.\n * @param {object} r - The rectangle to check.\n * @returns {boolean} True if the circle intersects with the rectangle, false otherwise.\n */\nexport const intersectsRectangle = (c, r) => {\n const cx = Math.abs(c.x - r.x - r.halfWidth);\n const xDist = r.halfWidth + c.radius;\n if (cx > xDist) {\n return false;\n }\n const cy = Math.abs(c.y - r.y - r.halfHeight);\n const yDist = r.halfHeight + c.radius;\n if (cy > yDist) {\n return false;\n }\n if (cx <= r.halfWidth || cy <= r.halfHeight) {\n return true;\n }\n const xCornerDist = cx - r.halfWidth;\n const yCornerDist = cy - r.halfHeight;\n const xCornerDistSq = xCornerDist * xCornerDist;\n const yCornerDistSq = yCornerDist * yCornerDist;\n const maxCornerDistSq = c.radius * c.radius;\n return xCornerDistSq + yCornerDistSq <= maxCornerDistSq;\n};\n","import { Point } from './point.js';\nimport { Rectangle } from './rectangle.js';\nimport { distance } from '../util/math.js';\nimport { clone, contains, circumferencePoint } from './util/circle.js';\nimport { GEOM_CIRCLE } from '../core/const.js';\n\nexport class Circle {\n x: number;\n y: number;\n _diameter: number;\n _radius: number;\n type: number;\n\n /**\n * Creates a new Circle instance.\n * @param {number} x - The x coordinate of the center point (default: 0).\n * @param {number} y - The y coordinate of the center point (default: 0).\n * @param {number} diameter - The diameter of the circle (default: 0).\n */\n constructor(x = 0, y = 0, diameter = 0) {\n /** @type {number} */\n this.x = x;\n /** @type {number} */\n this.y = y;\n /** @type {number} */\n this._diameter = diameter;\n /** @type {number} */\n this._radius = 0;\n if (diameter > 0) {\n this._radius = diameter * 0.5;\n }\n /** @type {number} */\n this.type = GEOM_CIRCLE;\n }\n\n /**\n * Calculates the circumference of this circle.\n * @returns {number} The circumference of this circle.\n */\n circumference() {\n return 2 * (Math.PI * this._radius);\n }\n\n /**\n * Returns a random point within this circle.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A random point within this circle.\n */\n random(output = null) {\n const result = output || new Point();\n const t = 2 * Math.PI * Math.random();\n const u = Math.random() + Math.random();\n const r = u > 1 ? 2 - u : u;\n const x = r * Math.cos(t);\n const y = r * Math.sin(t);\n result.x = this.x + x * this.radius;\n result.y = this.y + y * this.radius;\n return result;\n }\n\n /**\n * Gets the bounding rectangle of this circle.\n * @returns {Rectangle} The bounding rectangle of this circle.\n */\n getBounds() {\n return new Rectangle(this.x - this.radius, this.y - this.radius, this.diameter, this.diameter);\n }\n\n /**\n * Sets the position and size of this circle to new values.\n * @param {number} x - The new x coordinate of the center point.\n * @param {number} y - The new y coordinate of the center point.\n * @param {number} diameter - The new diameter of the circle.\n * @returns {Circle} This circle instance for chaining.\n */\n setTo(x, y, diameter) {\n this.x = x;\n this.y = y;\n this._diameter = diameter;\n this._radius = diameter * 0.5;\n return this;\n }\n\n /**\n * Copies the values from another circle to this circle.\n * @param {Circle} source - The circle to copy values from.\n * @returns {Circle} This circle instance for chaining.\n */\n copyFrom(source) {\n return this.setTo(source.x, source.y, source.diameter);\n }\n\n /**\n * Copies the values of this circle to another circle.\n * @param {Circle} dest - The circle to copy values to.\n * @returns {Circle} The destination circle.\n */\n copyTo(dest) {\n dest.x = this.x;\n dest.y = this.y;\n dest.diameter = this._diameter;\n return dest;\n }\n\n /**\n * Calculates the distance between this circle and another circle.\n * @param {Circle} dest - The other circle to calculate the distance to.\n * @param {boolean} round - Whether to round the result (default: false).\n * @returns {number} The distance between the circles.\n */\n distance(dest, round = false) {\n const d = distance(this.x, this.y, dest.x, dest.y);\n return round ? Math.round(d) : d;\n }\n\n /**\n * Creates a clone of this circle.\n * @returns {Circle} A new circle with the same values as this one.\n */\n clone() {\n return clone(this);\n }\n\n /**\n * Checks if the specified point is contained within this circle.\n * @param {number} x - The x coordinate of the point to check.\n * @param {number} y - The y coordinate of the point to check.\n * @returns {boolean} True if the point is contained within this circle, false otherwise.\n */\n contains(x, y) {\n return contains(this, x, y);\n }\n\n /**\n * Gets a point at a specific angle on the circumference of this circle.\n * @param {number} angle - The angle in radians (or degrees if asDegrees is true) to get the point for.\n * @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false).\n * @param {Point} out - The point to store the result in (optional).\n * @returns {Point} A point at the specified angle on the circumference of this circle.\n */\n circumferencePoint(angle, asDegrees?, out?) {\n return circumferencePoint(this, angle, asDegrees, out);\n }\n\n /**\n * Offsets the position of this circle by the specified amounts.\n * @param {number} dx - The amount to offset the x coordinate by.\n * @param {number} dy - The amount to offset the y coordinate by.\n * @returns {Circle} This circle instance for chaining.\n */\n offset(dx, dy) {\n this.x += dx;\n this.y += dy;\n return this;\n }\n\n /**\n * Offsets the position of this circle by the specified point coordinates.\n * @param {Point} point - The point to offset the circle by.\n * @returns {Circle} This circle instance for chaining.\n */\n offsetPoint(point) {\n return this.offset(point.x, point.y);\n }\n\n /**\n * Returns a string representation of this circle.\n * @returns {string} A string representation of the circle.\n */\n toString() {\n return `[{Circle (x=${this.x} y=${this.y} diameter=${this.diameter} radius=${this.radius})}]`;\n }\n\n /**\n * Gets the diameter of this circle.\n * @returns {number} The diameter of this circle.\n */\n get diameter() {\n return this._diameter;\n }\n\n /**\n * Sets the diameter of this circle.\n */\n set diameter(value) {\n if (value > 0) {\n this._diameter = value;\n this._radius = value * 0.5;\n }\n }\n\n /**\n * Gets the radius of this circle.\n * @returns {number} The radius of this circle.\n */\n get radius() {\n return this._radius;\n }\n\n /**\n * Sets the radius of this circle.\n */\n set radius(value) {\n if (value > 0) {\n this._radius = value;\n this._diameter = value * 2;\n }\n }\n\n /**\n * Gets the left coordinate of this circle.\n * @returns {number} The left coordinate of this circle.\n */\n get left() {\n return this.x - this._radius;\n }\n\n /**\n * Sets the left coordinate of this circle.\n */\n set left(value) {\n if (value > this.x) {\n this._radius = 0;\n this._diameter = 0;\n } else {\n this.radius = this.x - value;\n }\n }\n\n /**\n * Gets the right coordinate of this circle.\n * @returns {number} The right coordinate of this circle.\n */\n get right() {\n return this.x + this._radius;\n }\n\n /**\n * Sets the right coordinate of this circle.\n */\n set right(value) {\n if (value < this.x) {\n this._radius = 0;\n this._diameter = 0;\n } else {\n this.radius = value - this.x;\n }\n }\n\n /**\n * Gets the top coordinate of this circle.\n * @returns {number} The top coordinate of this circle.\n */\n get top() {\n return this.y - this._radius;\n }\n\n /**\n * Sets the top coordinate of this circle.\n */\n set top(value) {\n if (value > this.y) {\n this._radius = 0;\n this._diameter = 0;\n } else {\n this.radius = this.y - value;\n }\n }\n\n /**\n * Gets the bottom coordinate of this circle.\n * @returns {number} The bottom coordinate of this circle.\n */\n get bottom() {\n return this.y + this._radius;\n }\n\n /**\n * Sets the bottom coordinate of this circle.\n */\n set bottom(value) {\n if (value < this.y) {\n this._radius = 0;\n this._diameter = 0;\n } else {\n this.radius = value - this.y;\n }\n }\n\n /**\n * Gets the area of this circle.\n * @returns {number} The area of this circle.\n */\n get area() {\n if (this._radius > 0) {\n return Math.PI * this._radius * this._radius;\n }\n return 0;\n }\n\n /**\n * Checks if this circle is empty (has zero diameter).\n * @returns {boolean} True if the circle is empty, false otherwise.\n */\n get empty() {\n return this._diameter === 0;\n }\n\n /**\n * Sets whether this circle is empty (zero diameter).\n */\n set empty(value) {\n if (value === true) {\n this.setTo(0, 0, 0);\n }\n }\n}\n","/**\n * Checks if a point is contained within the ellipse.\n * @param {import('../ellipse.js').Ellipse} a - The ellipse to check.\n * @param {number} x - The x coordinate of the point.\n * @param {number} y - The y coordinate of the point.\n * @returns {boolean} True if the point is contained within the ellipse, false otherwise.\n */\nexport const contains = (a, x, y) => {\n if (a.width <= 0 || a.height <= 0) {\n return false;\n }\n // Normalize the coords to an ellipse with center 0,0 and a radius of 0.5\n let normx = (x - a.x) / a.width - 0.5;\n let normy = (y - a.y) / a.height - 0.5;\n normx *= normx;\n normy *= normy;\n return normx + normy < 0.25;\n};\n","import { GEOM_ELLIPSE } from '../core/const.js';\nimport { Point } from './point.js';\nimport { Rectangle } from './rectangle.js';\nimport { contains } from './util/ellipse.js';\n\nexport class Ellipse {\n x: number;\n y: number;\n width: number;\n height: number;\n type: number;\n\n /**\n * Creates a new Ellipse instance.\n * @param {number} x - The x coordinate of the center point (default: 0).\n * @param {number} y - The y coordinate of the center point (default: 0).\n * @param {number} width - The width of the ellipse (default: 0).\n * @param {number} height - The height of the ellipse (default: 0).\n */\n constructor(x = 0, y = 0, width = 0, height = 0) {\n /** @type {number} */\n this.x = x;\n /** @type {number} */\n this.y = y;\n /** @type {number} */\n this.width = width;\n /** @type {number} */\n this.height = height;\n /** @type {number} */\n this.type = GEOM_ELLIPSE;\n }\n\n /**\n * Sets the position and size of this ellipse to new values.\n * @param {number} x - The new x coordinate of the center point.\n * @param {number} y - The new y coordinate of the center point.\n * @param {number} width - The new width of the ellipse.\n * @param {number} height - The new height of the ellipse.\n * @returns {Ellipse} This ellipse instance for chaining.\n */\n setTo(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n return this;\n }\n\n /**\n * Gets the bounding rectangle of this ellipse.\n * @returns {Rectangle} The bounding rectangle of this ellipse.\n */\n getBounds() {\n return new Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);\n }\n\n /**\n * Copies the values from another ellipse to this ellipse.\n * @param {Ellipse} source - The ellipse to copy values from.\n * @returns {Ellipse} This ellipse instance for chaining.\n */\n copyFrom(source) {\n return this.setTo(source.x, source.y, source.width, source.height);\n }\n\n /**\n * Copies the values of this ellipse to another ellipse.\n * @param {Ellipse} dest - The ellipse to copy values to.\n * @returns {Ellipse} The destination ellipse.\n */\n copyTo(dest) {\n dest.x = this.x;\n dest.y = this.y;\n dest.width = this.width;\n dest.height = this.height;\n return dest;\n }\n\n /**\n * Checks if the specified point is contained within this ellipse.\n * @param {number} x - The x coordinate of the point to check.\n * @param {number} y - The y coordinate of the point to check.\n * @returns {boolean} True if the point is contained within this ellipse, false otherwise.\n */\n contains(x, y) {\n return contains(this, x, y);\n }\n\n /**\n * Returns a random point within this ellipse.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A random point within this ellipse.\n */\n random(output = null) {\n const result = output || new Point();\n const p = Math.random() * Math.PI * 2;\n const r = Math.random();\n result.x = Math.sqrt(r) * Math.cos(p);\n result.y = Math.sqrt(r) * Math.sin(p);\n result.x = this.x + (result.x * this.width) / 2;\n result.y = this.y + (result.y * this.height) / 2;\n return result;\n }\n\n /**\n * Returns a string representation of this ellipse.\n * @returns {string} A string representation of the ellipse.\n */\n toString() {\n return `[{Ellipse (x=${this.x} y=${this.y} width=${this.width} height=${this.height})}]`;\n }\n}\n","import { Polygon } from '../polygon.js';\n\n/**\n * Clones a polygon.\n * @param {Polygon} input - The polygon to clone.\n * @param {Polygon} output - Optional polygon to store the result in.\n * @returns {Polygon} The cloned polygon.\n */\nexport const clone = (input, output = null) => {\n const result = output || new Polygon();\n result.setTo(input._points.slice());\n return result;\n};\n","import { Point } from './point.js';\nimport { clone } from './util/polygon.js';\nimport { GEOM_POLYGON } from '../core/const.js';\n\nexport class Polygon {\n area: number;\n _points: any[];\n closed: boolean;\n flattened: boolean;\n type: number;\n\n /**\n * Creates a new Polygon instance.\n * @param {object[]} points - The array of points to define the polygon (optional).\n */\n constructor(points = null) {\n /** @type {number} */\n this.area = 0;\n /** @type {Point[]} */\n this._points = [];\n /** @type {boolean} */\n this.closed = true;\n /** @type {boolean} */\n this.flattened = false;\n /** @type {number} */\n this.type = GEOM_POLYGON;\n if (points) {\n this.setTo(points);\n }\n }\n\n /**\n * Converts the polygon's points to a number array.\n * @param {number[]} output - The array to store the result in (optional).\n * @returns {number[]} An array of numbers representing the polygon's points.\n */\n toNumberArray(output = []) {\n for (let i = 0; i < this._points.length; i += 1) {\n if (typeof this._points[i] === 'number') {\n output.push(this._points[i]);\n output.push(this._points[i + 1]);\n i += 1;\n } else {\n output.push(this._points[i].x);\n output.push(this._points[i].y);\n }\n }\n return output;\n }\n\n /**\n * Flattens the polygon's point array to a simple numeric array.\n * @returns {Polygon} This polygon instance for chaining.\n */\n flatten() {\n this._points = this.toNumberArray();\n this.flattened = true;\n return this;\n }\n\n /**\n * Creates a clone of this polygon.\n * @returns {Polygon} A new polygon with the same values as this one.\n */\n clone() {\n return clone(this);\n }\n\n /**\n * Checks if the specified point is contained within this polygon.\n * @param {number} x - The x coordinate of the point to check.\n * @param {number} y - The y coordinate of the point to check.\n * @returns {boolean} True if the point is contained within this polygon, false otherwise.\n */\n contains(x, y) {\n // Adapted from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html by Jonas Raoni Soares Silva\n let inside = false;\n if (this.flattened) {\n for (let i = -2, j = this._points.length - 2; (i += 2) < this._points.length; j = i) {\n const ix = this._points[i];\n const iy = this._points[i + 1];\n const jx = this._points[j];\n const jy = this._points[j + 1];\n if (((iy <= y && y < jy) || (jy <= y && y < iy)) && x < ((jx - ix) * (y - iy)) / (jy - iy) + ix) {\n inside = !inside;\n }\n }\n } else {\n for (let i = -1, j = this._points.length - 1; ++i < this._points.length; j = i) {\n const ix = this._points[i].x;\n const iy = this._points[i].y;\n const jx = this._points[j].x;\n const jy = this._points[j].y;\n if (((iy <= y && y < jy) || (jy <= y && y < iy)) && x < ((jx - ix) * (y - iy)) / (jy - iy) + ix) {\n inside = !inside;\n }\n }\n }\n return inside;\n }\n\n /**\n * Sets the polygon's points to new values.\n * @param {object[]} points - The array of points to define the polygon.\n * @returns {Polygon} This polygon instance for chaining.\n */\n setTo(points) {\n this.area = 0;\n this._points = [];\n if (points) {\n // If points isn't an array, use arguments as the array\n if (!Array.isArray(points)) {\n console.error('[Polygon] setTo() error, input parameter is not an array', points);\n }\n /* if (!Array.isArray(points)) {\n points = Array.prototype.slice.call(arguments);\n } */\n let y0 = Number.MAX_VALUE;\n // Allows for mixed-type arguments\n for (let i = 0, len = points.length; i < len; i += 1) {\n let p;\n if (typeof points[i] === 'number') {\n p = new Point(points[i], points[i + 1]);\n i += 1;\n } else if (Array.isArray(points[i])) {\n p = new Point(points[i][0], points[i][1]);\n } else {\n p = new Point(points[i].x, points[i].y);\n }\n this._points.push(p);\n // Lowest boundary\n if (p.y < y0) {\n y0 = p.y;\n }\n }\n this.calculateArea(y0);\n }\n return this;\n }\n\n /**\n * Calculates the area of this polygon.\n * @param {number} y0 - The y coordinate of the lowest boundary (internal use).\n * @returns {number} The area of this polygon.\n */\n calculateArea(y0) {\n let p1;\n let p2;\n let avgHeight;\n let width;\n for (let i = 0, len = this._points.length; i < len; i += 1) {\n p1 = this._points[i];\n if (i === len - 1) {\n p2 = this._points[0];\n } else {\n p2 = this._points[i + 1];\n }\n avgHeight = (p1.y - y0 + (p2.y - y0)) / 2;\n width = p1.x - p2.x;\n this.area += avgHeight * width;\n }\n return this.area;\n }\n\n /**\n * Gets the points of this polygon.\n * @returns {object[]} The array of points that define this polygon.\n */\n get points() {\n return this._points;\n }\n\n /**\n * Sets the points of this polygon.\n */\n set points(value) {\n if (value !== null) {\n this.setTo(value);\n } else {\n this.area = 0;\n this._points = [];\n }\n }\n}\n","import { RoundedRectangle } from '../rounded_rectangle.js';\n\n/**\n * Clones a rounded rectangle.\n * @param {RoundedRectangle} input - The rounded rectangle to clone.\n * @param {RoundedRectangle} output - Optional rounded rectangle to store the result in.\n * @returns {RoundedRectangle} The cloned rounded rectangle.\n */\nexport const clone = (input, output = null) => {\n const result = output || new RoundedRectangle();\n result.x = input.x;\n result.y = input.y;\n result.width = input.width;\n result.height = input.height;\n result.radius = input.radius;\n return result;\n};\n","import { clone } from './util/rounded_rectangle.js';\nimport { GEOM_ROUNDED_RECTANGLE } from '../core/const.js';\n\nexport class RoundedRectangle {\n x: number;\n y: number;\n width: number;\n height: number;\n radius: number;\n type: number;\n\n /**\n * Creates a new RoundedRectangle instance.\n * @param {number} x - The x coordinate of the top-left corner of the rectangle (default: 0).\n * @param {number} y - The y coordinate of the top-left corner of the rectangle (default: 0).\n * @param {number} width - The width of the rectangle (default: 0).\n * @param {number} height - The height of the rectangle (default: 0).\n * @param {number} radius - The corner radius (default: 20).\n */\n constructor(x = 0, y = 0, width = 0, height = 0, radius = 20) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.radius = radius;\n this.type = GEOM_ROUNDED_RECTANGLE;\n }\n\n /**\n * Checks if the specified point is contained within this rounded rectangle.\n * @param {number} x - The x coordinate of the point to check.\n * @param {number} y - The y coordinate of the point to check.\n * @returns {boolean} True if the point is contained within this rounded rectangle, false otherwise.\n */\n contains(x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n if (x >= this.x && x <= this.x + this.width) {\n if (y >= this.y && y <= this.y + this.height) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Creates a clone of this rounded rectangle.\n * @returns {RoundedRectangle} A new rounded rectangle with the same values as this one.\n */\n clone() {\n return clone(this);\n }\n}\n","// @ts-nocheck\nimport { create, removeByCanvas } from './pool.js';\n\nexport class CanvasBuffer {\n /**\n * Creates a new CanvasBuffer instance.\n * @param {number} width - The width of the canvas buffer.\n * @param {number} height - The height of the canvas buffer.\n */\n constructor(width, height) {\n this.width = width;\n this.height = height;\n this.canvas = create(this, this.width, this.height);\n this.context = this.canvas.getContext('2d', { willReadFrequently: false });\n this.canvas.width = width;\n this.canvas.height = height;\n }\n\n /**\n * Clears the canvas buffer.\n */\n clear() {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.width, this.height);\n }\n\n /**\n * Resizes the canvas buffer.\n * @param {number} width - The new width of the canvas buffer.\n * @param {number} height - The new height of the canvas buffer.\n */\n resize(width, height) {\n this.width = width;\n this.height = height;\n this.canvas.width = width;\n this.canvas.height = height;\n }\n\n /**\n * Destroys the canvas buffer and cleans up resources.\n */\n destroy() {\n try {\n this.context?.reset();\n } catch {\n // pass\n }\n removeByCanvas(this.canvas);\n }\n}\n","// @ts-nocheck\nimport { GEOM_CIRCLE, GEOM_ELLIPSE, GEOM_POLYGON, GEOM_RECTANGLE, GEOM_ROUNDED_RECTANGLE } from '../../core/const.js';\n\n/**\n * Renders a graphics object to canvas.\n * @param {import('../graphics.js').Graphics} graphics - The graphics object to render.\n */\nexport const updateGraphicsTint = (graphics) => {\n if (graphics.tint === 0xffffff) {\n return;\n }\n const tintR = ((graphics.tint >> 16) & 0xff) / 255;\n const tintG = ((graphics.tint >> 8) & 0xff) / 255;\n const tintB = (graphics.tint & 0xff) / 255;\n for (let i = 0; i < graphics.graphicsData.length; i += 1) {\n const data = graphics.graphicsData[i];\n const fillColor = data.fillColor | 0;\n const lineColor = data.lineColor | 0;\n data._fillTint =\n (((((fillColor >> 16) & 0xff) / 255) * tintR * 255) << 16) +\n (((((fillColor >> 8) & 0xff) / 255) * tintG * 255) << 8) +\n ((fillColor & 0xff) / 255) * tintB * 255;\n data._lineTint =\n (((((lineColor >> 16) & 0xff) / 255) * tintR * 255) << 16) +\n (((((lineColor >> 8) & 0xff) / 255) * tintG * 255) << 8) +\n ((lineColor & 0xff) / 255) * tintB * 255;\n }\n};\n\n/**\n * Renders a graphics object to canvas.\n * @param {import('../graphics.js').Graphics} graphics - The graphics object to render.\n * @param {object} context - The canvas rendering context.\n */\nexport const renderGraphics = (graphics, context) => {\n const worldAlpha = graphics.worldAlpha;\n if (graphics.dirty) {\n updateGraphicsTint(graphics);\n graphics.dirty = false;\n }\n for (let i = 0; i < graphics.graphicsData.length; i += 1) {\n const data = graphics.graphicsData[i];\n const shape = data.shape;\n const fillColor = data._fillTint;\n const lineColor = data._lineTint;\n context.lineWidth = data.lineWidth;\n if (data.type === GEOM_POLYGON) {\n context.beginPath();\n const points = shape.points;\n context.moveTo(points[0], points[1]);\n for (let j = 1; j < points.length / 2; j += 1) {\n context.lineTo(points[j * 2], points[j * 2 + 1]);\n }\n if (shape.closed) {\n context.lineTo(points[0], points[1]);\n }\n // if the first and last point are the same close the path - much neater :)\n if (points[0] === points[points.length - 2] && points[1] === points[points.length - 1]) {\n context.closePath();\n }\n if (data.fill) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = `#${`00000${(fillColor | 0).toString(16)}`.substr(-6)}`;\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = `#${`00000${(lineColor | 0).toString(16)}`.substr(-6)}`;\n context.stroke();\n }\n } else if (data.type === GEOM_RECTANGLE) {\n if (data.fillColor || data.fillColor === 0) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = `#${`00000${(fillColor | 0).toString(16)}`.substr(-6)}`;\n context.fillRect(shape.x, shape.y, shape.width, shape.height);\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = `#${`00000${(lineColor | 0).toString(16)}`.substr(-6)}`;\n context.strokeRect(shape.x, shape.y, shape.width, shape.height);\n }\n } else if (data.type === GEOM_CIRCLE) {\n context.beginPath();\n context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI);\n context.closePath();\n if (data.fill) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = `#${`00000${(fillColor | 0).toString(16)}`.substr(-6)}`;\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = `#${`00000${(lineColor | 0).toString(16)}`.substr(-6)}`;\n context.stroke();\n }\n } else if (data.type === GEOM_ELLIPSE) {\n // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n const w = shape.width * 2;\n const h = shape.height * 2;\n const x = shape.x - w / 2;\n const y = shape.y - h / 2;\n context.beginPath();\n const kappa = 0.5522848;\n const ox = (w / 2) * kappa; // control point offset horizontal\n const oy = (h / 2) * kappa; // control point offset vertical\n const xe = x + w; // x-end\n const ye = y + h; // y-end\n const xm = x + w / 2; // x-middle\n const ym = y + h / 2; // y-middle\n context.moveTo(x, ym);\n context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n context.closePath();\n if (data.fill) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = `#${`00000${(fillColor | 0).toString(16)}`.substr(-6)}`;\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = `#${`00000${(lineColor | 0).toString(16)}`.substr(-6)}`;\n context.stroke();\n }\n } else if (data.type === GEOM_ROUNDED_RECTANGLE) {\n const rx = shape.x;\n const ry = shape.y;\n const width = shape.width;\n const height = shape.height;\n let radius = shape.radius;\n const maxRadius = (Math.min(width, height) / 2) | 0;\n radius = radius > maxRadius ? maxRadius : radius;\n context.beginPath();\n context.moveTo(rx, ry + radius);\n context.lineTo(rx, ry + height - radius);\n context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);\n context.lineTo(rx + width - radius, ry + height);\n context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);\n context.lineTo(rx + width, ry + radius);\n context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);\n context.lineTo(rx + radius, ry);\n context.quadraticCurveTo(rx, ry, rx, ry + radius);\n context.closePath();\n if (data.fillColor || data.fillColor === 0) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = `#${`00000${(fillColor | 0).toString(16)}`.substr(-6)}`;\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = `#${`00000${(lineColor | 0).toString(16)}`.substr(-6)}`;\n context.stroke();\n }\n }\n }\n};\n\n/**\n * Renders a graphics object to canvas.\n * @param {import('../graphics.js').Graphics} graphics - The graphics object to render.\n * @param {object} context - The canvas rendering context.\n */\nexport const renderGraphicsMask = (graphics, context) => {\n const len = graphics.graphicsData.length;\n if (len === 0) {\n return;\n }\n context.beginPath();\n for (let i = 0; i < len; i += 1) {\n const data = graphics.graphicsData[i];\n const shape = data.shape;\n if (data.type === GEOM_POLYGON) {\n const points = shape.points;\n context.moveTo(points[0], points[1]);\n for (let j = 1; j < points.length / 2; j += 1) {\n context.lineTo(points[j * 2], points[j * 2 + 1]);\n }\n // if the first and last point are the same close the path - much neater :)\n if (points[0] === points[points.length - 2] && points[1] === points[points.length - 1]) {\n context.closePath();\n }\n } else if (data.type === GEOM_RECTANGLE) {\n context.rect(shape.x, shape.y, shape.width, shape.height);\n context.closePath();\n } else if (data.type === GEOM_CIRCLE) {\n context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI);\n context.closePath();\n } else if (data.type === GEOM_ELLIPSE) {\n // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n const w = shape.width * 2;\n const h = shape.height * 2;\n const x = shape.x - w / 2;\n const y = shape.y - h / 2;\n const kappa = 0.5522848;\n const ox = (w / 2) * kappa; // control point offset horizontal\n const oy = (h / 2) * kappa; // control point offset vertical\n const xe = x + w; // x-end\n const ye = y + h; // y-end\n const xm = x + w / 2; // x-middle\n const ym = y + h / 2; // y-middle\n context.moveTo(x, ym);\n context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n context.closePath();\n } else if (data.type === GEOM_ROUNDED_RECTANGLE) {\n const rx = shape.x;\n const ry = shape.y;\n const width = shape.width;\n const height = shape.height;\n let radius = shape.radius;\n const maxRadius = (Math.min(width, height) / 2) | 0;\n radius = radius > maxRadius ? maxRadius : radius;\n context.moveTo(rx, ry + radius);\n context.lineTo(rx, ry + height - radius);\n context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);\n context.lineTo(rx + width - radius, ry + height);\n context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);\n context.lineTo(rx + width, ry + radius);\n context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);\n context.lineTo(rx + radius, ry);\n context.quadraticCurveTo(rx, ry, rx, ry + radius);\n context.closePath();\n }\n }\n};\n","// @ts-nocheck\nimport { GraphicsData } from './graphics_data.js';\n\n/**\n * Clones a GraphicsData object.\n * @param {GraphicsData} source - The source GraphicsData to clone.\n * @returns {GraphicsData} A new cloned GraphicsData object.\n */\nexport const clone = (source) => {\n return new GraphicsData(\n source.lineWidth,\n source.lineColor,\n source.lineAlpha,\n source.fillColor,\n source.fillAlpha,\n source.fill,\n source.shape\n );\n};\n","// @ts-nocheck\nimport { clone } from './graphics_data_util.js';\n\nexport class GraphicsData {\n /**\n * Creates a new GraphicsData object.\n * @param {number} lineWidth - The line width.\n * @param {number} lineColor - The line color.\n * @param {number} lineAlpha - The line alpha.\n * @param {number} fillColor - The fill color.\n * @param {number} fillAlpha - The fill alpha.\n * @param {boolean} fill - Whether to fill the shape.\n * @param {object} shape - The shape to draw.\n */\n constructor(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) {\n this.lineWidth = lineWidth;\n this.lineColor = lineColor;\n this.lineAlpha = lineAlpha;\n this._lineTint = lineColor;\n this.fillColor = fillColor;\n this.fillAlpha = fillAlpha;\n this._fillTint = fillColor;\n this.fill = fill;\n this.shape = shape;\n this.type = shape.type;\n }\n\n /**\n * Clones this GraphicsData object.\n * @returns {GraphicsData} A new cloned GraphicsData object.\n */\n clone() {\n return clone(this);\n }\n}\n","export class Node {\n i: number;\n x: number;\n y: number;\n prev: Node | null;\n next: Node | null;\n z: number | null;\n prevZ: Node | null;\n nextZ: Node | null;\n steiner: boolean;\n\n /**\n * Creates a new Node instance.\n * @param {number} i - The vertice index in coordinates array.\n * @param {number} x - The x coordinate of the vertex.\n * @param {number} y - The y coordinate of the vertex.\n */\n constructor(i, x, y) {\n // vertice index in coordinates array\n this.i = i;\n // vertex coordinates\n this.x = x;\n this.y = y;\n // previous and next vertice nodes in a polygon ring\n this.prev = null;\n this.next = null;\n // z-order curve value\n this.z = null;\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n // indicates whether this is a steiner point\n this.steiner = false;\n }\n}\n","import { Node } from './earcut_node.js';\n\n/**\n * Calculates the area of a triangle defined by three points.\n * @param {object} list - The list of points to process.\n * @returns {object} The processed earcut data structure.\n */\nexport function sortLinked(list) {\n let i;\n let p;\n let q;\n let e;\n let tail;\n let numMerges;\n let pSize;\n let qSize;\n let inSize = 1;\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n while (p) {\n numMerges += 1;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i += 1) {\n pSize += 1;\n q = q.nextZ;\n if (!q) {\n break;\n }\n }\n qSize = inSize;\n while (pSize > 0 || (qSize > 0 && q)) {\n if (pSize === 0) {\n e = q;\n q = q.nextZ;\n qSize -= 1;\n } else if (qSize === 0 || !q) {\n e = p;\n p = p.nextZ;\n pSize -= 1;\n } else if (p.z <= q.z) {\n e = p;\n p = p.nextZ;\n pSize -= 1;\n } else {\n e = q;\n q = q.nextZ;\n qSize -= 1;\n }\n if (tail) {\n tail.nextZ = e;\n } else {\n list = e;\n }\n e.prevZ = tail;\n tail = e;\n }\n p = q;\n }\n tail.nextZ = null;\n inSize *= 2;\n } while (numMerges > 1);\n return list;\n}\n\n/**\n * Calculates the area of a triangle defined by three points.\n * @param {object} a - The first point of the triangle.\n * @param {object} b - The second point of the triangle.\n * @returns {number} The calculated area of the triangle.\n */\nexport function compareX(a, b) {\n return a.x - b.x;\n}\n\n/**\n * Determines if a point is inside a triangle.\n * @param {number} x - The x-coordinate of the point to test.\n * @param {number} y - The y-coordinate of the point to test.\n * @param {number} minX - The minimum x-coordinate of the bounding box.\n * @param {number} minY - The minimum y-coordinate of the bounding box.\n * @param {number} size - The size of the bounding box.\n * @returns {number} The calculated distance from the point to the triangle edge.\n */\nexport function zOrder(x, y, minX, minY, size) {\n // coords are transformed into non-negative 15-bit integer range\n x = (32767 * (x - minX)) / size;\n y = (32767 * (y - minY)) / size;\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 y = (y | (y << 8)) & 0x00ff00ff;\n y = (y | (y << 4)) & 0x0f0f0f0f;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n return x | (y << 1);\n}\n\n/**\n * Calculates the orientation of three points (clockwise, counterclockwise, or collinear).\n * @param {object} start - The starting point of the triangle edge.\n * @param {number} minX - The minimum x-coordinate of the bounding box.\n * @param {number} minY - The minimum y-coordinate of the bounding box.\n * @param {number} size - The size of the bounding box.\n */\nexport function indexCurve(start, minX, minY, size) {\n let p = start;\n do {\n if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, size);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n p.prevZ.nextZ = null;\n p.prevZ = null;\n sortLinked(p);\n}\n\n/**\n * TBD.\n * @param {object} start - TBD.\n * @returns {object} The calculated point that is the closest to the triangle edge.\n */\nexport function getLeftmost(start) {\n let p = start;\n let leftmost = start;\n do {\n if (p.x < leftmost.x) leftmost = p;\n p = p.next;\n } while (p !== start);\n return leftmost;\n}\n\n/**\n * Determines if a point is inside the triangle defined by three points.\n * @param {number} ax - TBD.\n * @param {number} ay - TBD.\n * @param {number} bx - TBD.\n * @param {number} by - TBD.\n * @param {number} cx - TBD.\n * @param {number} cy - TBD.\n * @param {number} px - TBD.\n * @param {number} py - TBD.\n * @returns {object} TBD.\n */\nexport function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (\n (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0\n );\n}\n\n/**\n * TBD.\n * @param {object} p - TBD.\n * @param {object} q - TBD.\n * @param {object} r - TBD.\n * @returns {number} TBD.\n */\nexport function 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/**\n * TBD.\n * @param {object} p1 - The first point of the triangle.\n * @param {object} p2 - The second point of the triangle.\n * @returns {boolean} True if the point is inside the triangle, false otherwise.\n */\nexport function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n/**\n * Determines if two line segments intersect.\n * @param {object} p1 - The first point of the first line segment.\n * @param {object} q1 - The second point of the first line segment.\n * @param {object} p2 - The first point of the second line segment.\n * @param {object} q2 - The second point of the second line segment.\n * @returns {boolean} True if the line segments intersect, false otherwise.\n */\nexport function intersects(p1, q1, p2, q2) {\n return area(p1, q1, p2) > 0 !== area(p1, q1, q2) > 0 && area(p2, q2, p1) > 0 !== area(p2, q2, q1) > 0;\n}\n\n/**\n * Determines if two line segments intersect.\n * @param {object} a - The first point of the line segment.\n * @param {object} b - The second point of the line segment.\n * @returns {boolean} True if the points are collinear, false otherwise.\n */\nexport function 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 && intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n return false;\n}\n\n/**\n * Calculates the cross product of three points.\n * @param {object} a - The first point of the cross product.\n * @param {object} b - The second point of the cross product.\n * @returns {object} The calculated cross product result.\n */\nexport function 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/**\n * Determines if a point is inside the triangle defined by three points.\n * @param {object} a - The first point of the triangle.\n * @param {object} b - The second point of the triangle.\n * @returns {boolean} True if the point is inside the triangle, false otherwise.\n */\nexport function 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 && px < ((p.next.x - p.x) * (py - p.y)) / (p.next.y - p.y) + p.x) {\n inside = !inside;\n }\n p = p.next;\n } while (p !== a);\n return inside;\n}\n\n/**\n * Determines if a point is inside the triangle defined by three points.\n * @param {object} a - The first point of the triangle.\n * @param {object} b - The second point of the triangle.\n * @returns {boolean} True if the point is inside the triangle, false otherwise.\n */\nexport function isValidDiagonal(a, b) {\n return (\n equals(a, b) ||\n (a.next.i !== b.i &&\n a.prev.i !== b.i &&\n !intersectsPolygon(a, b) &&\n locallyInside(a, b) &&\n locallyInside(b, a) &&\n middleInside(a, b))\n );\n}\n\n/**\n * Calculates the distance from a point to a triangle edge.\n * @param {object} a - TBD.\n * @param {object} b - TBD.\n * @returns {object} TBD.\n */\nexport function splitPolygon(a, b) {\n const a2 = new Node(a.i, a.x, a.y);\n const b2 = new Node(b.i, b.x, b.y);\n const an = a.next;\n const bp = b.prev;\n a.next = b;\n b.prev = a;\n a2.next = an;\n an.prev = a2;\n b2.next = a2;\n a2.prev = b2;\n bp.next = b2;\n b2.prev = bp;\n return b2;\n}\n\n/**\n * TBD.\n * @param {number} i - TBD.\n * @param {number} x - TBD.\n * @param {number} y - TBD.\n * @param {object} last - TBD.\n * @returns {object} TBD.\n */\nexport function insertNode(i, x, y, last) {\n const p = new Node(i, x, y);\n if (!last) {\n p.prev = p;\n p.next = p;\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\n/**\n * TBD.\n * @param {object} p - TBD.\n */\nexport function removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n if (p.prevZ) {\n p.prevZ.nextZ = p.nextZ;\n }\n if (p.nextZ) {\n p.nextZ.prevZ = p.prevZ;\n }\n}\n\n/**\n * TBD.\n * @param {object} ear - TBD.\n * @returns {boolean} TBD.\n */\nexport function isEar(ear) {\n const a = ear.prev;\n const b = ear;\n const c = ear.next;\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n // now make sure we don't have other points inside the potential ear\n let p = ear.next.next;\n while (p !== ear.prev) {\n if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n return true;\n}\n\n/**\n * TBD.\n * @param {object} ear - TBD.\n * @param {number} minX - TBD.\n * @param {number} minY - TBD.\n * @param {number} size - TBD.\n * @returns {boolean} TBD.\n */\nexport function isEarHashed(ear, minX, minY, size) {\n const a = ear.prev;\n const b = ear;\n const c = ear.next;\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n // triangle bbox; min & max are calculated like this for speed\n const minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : b.x < c.x ? b.x : c.x;\n const minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : b.y < c.y ? b.y : c.y;\n const maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : b.x > c.x ? b.x : c.x;\n const maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : b.y > c.y ? b.y : c.y;\n // z-order range for the current triangle bbox;\n const minZ = zOrder(minTX, minTY, minX, minY, size);\n const maxZ = zOrder(maxTX, maxTY, minX, minY, size);\n // first look for points inside the triangle in increasing z-order\n let p = ear.nextZ;\n while (p && p.z <= maxZ) {\n if (\n p !== ear.prev &&\n p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0\n ) {\n return false;\n }\n p = p.nextZ;\n }\n // then look for points in decreasing z-order\n p = ear.prevZ;\n while (p && p.z >= minZ) {\n if (\n p !== ear.prev &&\n p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0\n ) {\n return false;\n }\n p = p.prevZ;\n }\n return true;\n}\n\n/**\n * TBD.\n * @param {object} data - The earcut data structure containing the points.\n * @param {number} start - The starting index in the data structure.\n * @param {number} end - The ending index in the data structure.\n * @param {number} dim - The dimension of the data (2 or 3).\n * @param {boolean} clockwise - Whether the triangles should be clockwise or counterclockwise.\n * @returns {object} The processed earcut data structure with triangulation information.\n */\nexport function linkedList(data, start, end, dim, clockwise) {\n let sum = 0;\n let i;\n let j;\n let last;\n // calculate original winding order of a polygon ring\n for (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 // link points into circular doubly-linked list in the specified winding order\n if (clockwise === sum > 0) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n return last;\n}\n\n/**\n * Calculates the minimum and maximum coordinates of a set of points.\n * @param {object} start - The starting point in the data structure.\n * @param {object} end - The ending point in the data structure.\n * @returns {object} The calculated bounding box with min and max coordinates.\n */\nexport function filterPoints(start, end?) {\n if (!start) return start;\n if (!end) end = start;\n let p = start;\n let again;\n do {\n again = false;\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = p.prev;\n end = p;\n if (p === p.next) return null;\n again = true;\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n return end;\n}\n\n/**\n * Calculates the minimum and maximum coordinates of a set of points.\n * @param {object} hole - The hole to process.\n * @param {object} outerNode - The outer node that contains the hole.\n * @returns {object} The processed hole data structure.\n */\nexport function 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 // 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 do {\n if (hy <= p.y && hy >= p.next.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 }\n }\n p = p.next;\n } while (p !== outerNode);\n if (!m) return null;\n if (hole.x === m.x) return m.prev; // hole touches outer segment; pick lower endpoint\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 const stop = m;\n let tanMin = Infinity;\n let tan;\n p = m.next;\n while (p !== stop) {\n if (\n hx >= p.x &&\n p.x >= m.x &&\n pointInTriangle(hy < m.y ? hx : qx, hy, m.x, m.y, hy < m.y ? qx : hx, hy, p.x, p.y)\n ) {\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n if ((tan < tanMin || (tan === tanMin && p.x > m.x)) && locallyInside(p, hole)) {\n m = p;\n tanMin = tan;\n }\n }\n p = p.next;\n }\n return m;\n}\n\n/**\n * Processes a hole in the triangulation data structure.\n * @param {object} hole - The hole to process.\n * @param {object} outerNode - The outer node that contains the hole.\n */\nexport function eliminateHole(hole, outerNode) {\n outerNode = findHoleBridge(hole, outerNode);\n if (outerNode) {\n const b = splitPolygon(outerNode, hole);\n filterPoints(b, b.next);\n }\n}\n\n/**\n * Calculates the centroid of a polygon.\n * @param {object} data - The earcut data structure containing the points.\n * @param {object} holeIndices - The indices of the holes in the data structure.\n * @param {object} outerNode - The outer node that contains the holes.\n * @param {object} dim - The dimension of the data (2 or 3).\n * @returns {object} The processed earcut data structure with holes included.\n */\nexport function eliminateHoles(data, holeIndices, outerNode, dim) {\n const queue = [];\n let i;\n let len;\n let start;\n let end;\n let list;\n for (i = 0, len = holeIndices.length; i < len; i += 1) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n queue.sort(compareX);\n // process holes from left to right\n for (i = 0; i < queue.length; i += 1) {\n eliminateHole(queue[i], outerNode);\n outerNode = filterPoints(outerNode, outerNode.next);\n }\n return outerNode;\n}\n\n/**\n * Calculates the centroid of a polygon.\n * @param {object} start - The starting point in the data structure.\n * @param {object} triangles - The triangles to process.\n * @param {number} dim - The dimension of the data (2 or 3).\n * @returns {object} The processed triangulation data structure.\n */\nexport function cureLocalIntersections(start, triangles, dim) {\n let p = start;\n do {\n const a = p.prev;\n const b = p.next.next;\n // a self-intersection where edge (v[i-1],v[i]) intersects (v[i+1],v[i+2])\n if (intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n triangles.push(a.i / dim);\n triangles.push(p.i / dim);\n triangles.push(b.i / dim);\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n p = b;\n start = p;\n }\n p = p.next;\n } while (p !== start);\n return p;\n}\n\n/**\n * Calculates the centroid of a polygon.\n * @param {object} start - The starting point in the data structure.\n * @param {object} triangles - The triangles to process.\n * @param {number} dim - The dimension of the data (2 or 3).\n * @param {number} minX - The minimum x-coordinate of the bounding box.\n * @param {number} minY - The minimum y-coordinate of the bounding box.\n * @param {number} size - The size of the bounding box.\n */\nexport function splitEarcut(start, triangles, dim, minX, minY, size) {\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 // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, size);\n earcutLinked(c, triangles, dim, minX, minY, size);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n/**\n * Calculates the centroid of a polygon.\n * @param {object} ear - The ear to process.\n * @param {object} triangles - The triangles to process.\n * @param {number} dim - The dimension of the data (2 or 3).\n * @param {number} minX - The minimum x-coordinate of the bounding box.\n * @param {number} minY - The minimum y-coordinate of the bounding box.\n * @param {number} size - The size of the bounding box.\n * @param {object} pass - The pass information for triangulation.\n */\nexport function earcutLinked(ear, triangles, dim, minX?, minY?, size?, pass?) {\n if (!ear) return;\n // interlink polygon nodes in z-order\n if (!pass && size) indexCurve(ear, minX, minY, size);\n let stop = ear;\n let prev;\n let next;\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n if (size ? isEarHashed(ear, minX, minY, size) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim);\n triangles.push(ear.i / dim);\n triangles.push(next.i / dim);\n removeNode(ear);\n // skipping the next vertice leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n continue;\n }\n ear = next;\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, size, 1);\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(ear, triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, size, 2);\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, size);\n }\n break;\n }\n }\n}\n\n/**\n * Calculates the centroid of a polygon.\n * @param {object} data - The earcut data structure containing the points.\n * @param {object} holeIndices - The indices of the holes in the data structure.\n * @param {number} dim - The dimension of the data (2 or 3).\n * @returns {object} The processed earcut data structure with triangulation information.\n */\nexport function triangulate(data, holeIndices, dim) {\n dim = dim || 2;\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 if (!outerNode) return triangles;\n let minX;\n let minY;\n let maxX;\n let maxY;\n let x;\n let y;\n let size;\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\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 maxX = data[0];\n minY = data[1];\n maxY = data[1];\n for (let i = dim; i < outerLen; i += dim) {\n x = data[i];\n 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 // minX, minY and size are later used to transform coords into integers for z-order calculation\n size = Math.max(maxX - minX, maxY - minY);\n }\n earcutLinked(outerNode, triangles, dim, minX, minY, size);\n return triangles;\n}\n","// @ts-nocheck\nexport class GraphicsData {\n /**\n * Creates a new GraphicsData instance.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n */\n constructor(gl) {\n this.gl = gl;\n // TODO does this need to be split before uploading??\n this.color = [0, 0, 0]; // color split!\n this.points = [];\n this.indices = [];\n this.buffer = gl.createBuffer();\n this.indexBuffer = gl.createBuffer();\n this.mode = 1;\n this.alpha = 1;\n this.dirty = true;\n }\n\n /**\n * Destroys this graphics data and cleans up resources.\n */\n reset() {\n this.points = [];\n this.indices = [];\n this.glPoints = null;\n this.glIndicies = null;\n }\n\n /**\n * Updates the graphics data for WebGL rendering.\n */\n upload() {\n const gl = this.gl;\n // this.lastIndex = graphics.graphicsData.length;\n this.glPoints = new Float32Array(this.points);\n gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer);\n gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW);\n this.glIndicies = new Uint16Array(this.indices);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW);\n this.dirty = false;\n }\n}\n","// @ts-nocheck\nimport { GEOM_CIRCLE, GEOM_ELLIPSE, GEOM_POLYGON, GEOM_RECTANGLE, GEOM_ROUNDED_RECTANGLE } from '../../core/const.js';\nimport { Point } from '../../geom/point.js';\nimport { hex2rgb } from '../../util/math.js';\nimport { triangulate } from './earcut.js';\nimport { GraphicsData } from './graphics_data.js';\n\n/**\n * Updates the graphics data for WebGL rendering.\n * @returns {number} The number of vertices in the graphics data.\n */\nexport const getStencilBufferLimit = () => {\n if (!window.PhaserRegistry.stencilBufferLimit) {\n window.PhaserRegistry.stencilBufferLimit = 6;\n }\n return window.PhaserRegistry.stencilBufferLimit;\n};\n\n/**\n * Updates the graphics data for WebGL rendering.\n * @returns {object[]} The graphics data array.\n */\nexport const getGraphicsDataPool = () => {\n if (!window.PhaserRegistry.graphicsDataPool) {\n window.PhaserRegistry.graphicsDataPool = [];\n }\n return window.PhaserRegistry.graphicsDataPool;\n};\n\n/**\n * Updates the graphics data for WebGL rendering.\n * @param {object} webGL - The WebGL context.\n * @param {number} type - The type of graphics data to create.\n * @returns {object} The newly created graphics data object.\n */\nexport const switchMode = (webGL, type) => {\n let webGLData;\n if (!webGL.data.length) {\n webGLData = getGraphicsDataPool().pop() || new GraphicsData(webGL.gl);\n webGLData.mode = type;\n webGL.data.push(webGLData);\n } else {\n webGLData = webGL.data[webGL.data.length - 1];\n if (webGLData.mode !== type || type === 1) {\n webGLData = getGraphicsDataPool().pop() || new GraphicsData(webGL.gl);\n webGLData.mode = type;\n webGL.data.push(webGLData);\n }\n }\n webGLData.dirty = true;\n return webGLData;\n};\n\n/**\n * Updates the graphics data for WebGL rendering.\n * @param {object} graphicsData - The graphics data to update.\n * @param {GraphicsData} webGLData - The WebGL graphics data object.\n */\nexport const buildLine = (graphicsData, webGLData) => {\n // TODO OPTIMISE!\n let i = 0;\n let points = graphicsData.points;\n if (points.length === 0) {\n return;\n }\n // if the line width is an odd number add 0.5 to align to a whole pixel\n if (graphicsData.lineWidth % 2) {\n for (i = 0; i < points.length; i += 1) {\n points[i] += 0.5;\n }\n }\n // get first and last point.. figure out the middle!\n const firstPoint = new Point(points[0], points[1]);\n let lastPoint = new Point(points[points.length - 2], points[points.length - 1]);\n // if the first point is the last point - gonna have issues :)\n if (firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y) {\n // need to clone as we are going to slightly modify the shape..\n points = points.slice();\n points.pop();\n points.pop();\n lastPoint = new Point(points[points.length - 2], points[points.length - 1]);\n const midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) * 0.5;\n const midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) * 0.5;\n points.unshift(midPointX, midPointY);\n points.push(midPointX, midPointY);\n }\n const verts = webGLData.points;\n const indices = webGLData.indices;\n const length = points.length / 2;\n let indexCount = points.length;\n let indexStart = verts.length / 6;\n // DRAW the Line\n const width = graphicsData.lineWidth / 2;\n // sort color\n const color = hex2rgb(graphicsData.lineColor);\n const alpha = graphicsData.lineAlpha;\n const r = color[0] * alpha;\n const g = color[1] * alpha;\n const b = color[2] * alpha;\n let px;\n let py;\n let p1x;\n let p1y;\n let p2x;\n let p2y;\n let p3x;\n let p3y;\n let perpx;\n let perpy;\n let perp2x;\n let perp2y;\n let perp3x;\n let perp3y;\n let a1;\n let b1;\n let c1;\n let a2;\n let b2;\n let c2;\n let denom;\n let pdist;\n let dist;\n p1x = points[0];\n p1y = points[1];\n p2x = points[2];\n p2y = points[3];\n perpx = -(p1y - p2y);\n perpy = p1x - p2x;\n dist = Math.sqrt(perpx * perpx + perpy * perpy);\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n // start\n verts.push(p1x - perpx, p1y - perpy, r, g, b, alpha);\n verts.push(p1x + perpx, p1y + perpy, r, g, b, alpha);\n for (i = 1; i < length - 1; i += 1) {\n p1x = points[(i - 1) * 2];\n p1y = points[(i - 1) * 2 + 1];\n p2x = points[i * 2];\n p2y = points[i * 2 + 1];\n p3x = points[(i + 1) * 2];\n p3y = points[(i + 1) * 2 + 1];\n perpx = -(p1y - p2y);\n perpy = p1x - p2x;\n dist = Math.sqrt(perpx * perpx + perpy * perpy);\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n perp2x = -(p2y - p3y);\n perp2y = p2x - p3x;\n dist = Math.sqrt(perp2x * perp2x + perp2y * perp2y);\n perp2x /= dist;\n perp2y /= dist;\n perp2x *= width;\n perp2y *= width;\n a1 = -perpy + p1y - (-perpy + p2y);\n b1 = -perpx + p2x - (-perpx + p1x);\n c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y);\n a2 = -perp2y + p3y - (-perp2y + p2y);\n b2 = -perp2x + p2x - (-perp2x + p3x);\n c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y);\n denom = a1 * b2 - a2 * b1;\n if (Math.abs(denom) < 0.1) {\n denom += 10.1;\n verts.push(p2x - perpx, p2y - perpy, r, g, b, alpha);\n verts.push(p2x + perpx, p2y + perpy, r, g, b, alpha);\n continue;\n }\n px = (b1 * c2 - b2 * c1) / denom;\n py = (a2 * c1 - a1 * c2) / denom;\n pdist = (px - p2x) * (px - p2x) + (py - p2y) + (py - p2y);\n if (pdist > 140 * 140) {\n perp3x = perpx - perp2x;\n perp3y = perpy - perp2y;\n dist = Math.sqrt(perp3x * perp3x + perp3y * perp3y);\n perp3x /= dist;\n perp3y /= dist;\n perp3x *= width;\n perp3y *= width;\n verts.push(p2x - perp3x, p2y - perp3y);\n verts.push(r, g, b, alpha);\n verts.push(p2x + perp3x, p2y + perp3y);\n verts.push(r, g, b, alpha);\n verts.push(p2x - perp3x, p2y - perp3y);\n verts.push(r, g, b, alpha);\n indexCount += 1;\n } else {\n verts.push(px, py);\n verts.push(r, g, b, alpha);\n verts.push(p2x - (px - p2x), p2y - (py - p2y));\n verts.push(r, g, b, alpha);\n }\n }\n p1x = points[(length - 2) * 2];\n p1y = points[(length - 2) * 2 + 1];\n p2x = points[(length - 1) * 2];\n p2y = points[(length - 1) * 2 + 1];\n perpx = -(p1y - p2y);\n perpy = p1x - p2x;\n dist = Math.sqrt(perpx * perpx + perpy * perpy);\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n verts.push(p2x - perpx, p2y - perpy);\n verts.push(r, g, b, alpha);\n verts.push(p2x + perpx, p2y + perpy);\n verts.push(r, g, b, alpha);\n indices.push(indexStart);\n for (i = 0; i < indexCount; i += 1) {\n indices.push(indexStart);\n indexStart += 1;\n }\n indices.push(indexStart - 1);\n};\n\n/**\n * Updates the graphics data for WebGL rendering.\n * @param {object} graphicsData - The graphics data to update.\n * @param {GraphicsData} webGLData - The WebGL graphics data object.\n */\nexport const buildRectangle = (graphicsData, webGLData) => {\n //\n // need to convert points to a nice regular data\n //\n const rectData = graphicsData.shape;\n const x = rectData.x;\n const y = rectData.y;\n const width = rectData.width;\n const height = rectData.height;\n\n if (graphicsData.fill) {\n const color = hex2rgb(graphicsData.fillColor);\n const alpha = graphicsData.fillAlpha;\n const r = color[0] * alpha;\n const g = color[1] * alpha;\n const b = color[2] * alpha;\n const verts = webGLData.points;\n const indices = webGLData.indices;\n const vertPos = verts.length / 6;\n // start\n verts.push(x, y);\n verts.push(r, g, b, alpha);\n verts.push(x + width, y);\n verts.push(r, g, b, alpha);\n verts.push(x, y + height);\n verts.push(r, g, b, alpha);\n verts.push(x + width, y + height);\n verts.push(r, g, b, alpha);\n // insert 2 dead triangles..\n indices.push(vertPos, vertPos, vertPos + 1, vertPos + 2, vertPos + 3, vertPos + 3);\n }\n if (graphicsData.lineWidth) {\n const tempPoints = graphicsData.points;\n graphicsData.points = [x, y, x + width, y, x + width, y + height, x, y + height, x, y];\n buildLine(graphicsData, webGLData);\n graphicsData.points = tempPoints;\n }\n};\n\n/**\n * Updates the graphics data for WebGL rendering.\n * @param {number} fromX - The starting x-coordinate.\n * @param {number} fromY - The starting y-coordinate.\n * @param {number} cpX - The control point x-coordinate.\n * @param {number} cpY - The control point y-coordinate.\n * @param {number} toX - The ending x-coordinate.\n * @param {number} toY - The ending y-coordinate.\n * @returns {number[]} The calculated points for the quadratic bezier curve.\n */\nexport const quadraticBezierCurve = (fromX, fromY, cpX, cpY, toX, toY) => {\n let xa;\n let ya;\n let xb;\n let yb;\n let x;\n let y;\n const n = 20;\n const points = [];\n const getPt = (n1, n2, perc) => {\n const diff = n2 - n1;\n return n1 + diff * perc;\n };\n let j = 0;\n for (let i = 0; i <= n; i += 1) {\n j = i / n;\n // The Green Line\n xa = getPt(fromX, cpX, j);\n ya = getPt(fromY, cpY, j);\n xb = getPt(cpX, toX, j);\n yb = getPt(cpY, toY, j);\n // The Black Dot\n x = getPt(xa, xb, j);\n y = getPt(ya, yb, j);\n points.push(x, y);\n }\n return points;\n};\n\n/**\n * Updates the graphics data for WebGL rendering.\n * @param {object} graphicsData - The graphics data to update.\n * @param {GraphicsData} webGLData - The WebGL graphics data object.\n */\nexport const buildRoundedRectangle = (graphicsData, webGLData) => {\n const rrectData = graphicsData.shape;\n const x = rrectData.x;\n const y = rrectData.y;\n const width = rrectData.width;\n const height = rrectData.height;\n const radius = rrectData.radius;\n let recPoints = [];\n recPoints.push(x, y + radius);\n recPoints = recPoints.concat(quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height));\n recPoints = recPoints.concat(\n quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius)\n );\n recPoints = recPoints.concat(quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y));\n recPoints = recPoints.concat(quadraticBezierCurve(x + radius, y, x, y, x, y + radius));\n if (graphicsData.fill) {\n const color = hex2rgb(graphicsData.fillColor);\n const alpha = graphicsData.fillAlpha;\n const r = color[0] * alpha;\n const g = color[1] * alpha;\n const b = color[2] * alpha;\n const verts = webGLData.points;\n const indices = webGLData.indices;\n const vecPos = verts.length / 6;\n const triangles = triangulate(recPoints, null, 2);\n for (let i = 0; i < triangles.length; i += 3) {\n indices.push(triangles[i] + vecPos);\n indices.push(triangles[i] + vecPos);\n indices.push(triangles[i + 1] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n }\n for (let i = 0; i < recPoints.length; i += 2) {\n // TODO verify\n verts.push(recPoints[i], recPoints[i + 1], r, g, b, alpha);\n }\n }\n if (graphicsData.lineWidth) {\n const tempPoints = graphicsData.points;\n graphicsData.points = recPoints;\n buildLine(graphicsData, webGLData);\n graphicsData.points = tempPoints;\n }\n};\n\n/**\n * Updates the graphics data for WebGL rendering.\n * @param {object} graphicsData - The graphics data to update.\n * @param {GraphicsData} webGLData - The WebGL graphics data object.\n */\nexport const buildCircle = (graphicsData, webGLData) => {\n // need to convert points to a nice regular data\n const circleData = graphicsData.shape;\n const x = circleData.x;\n const y = circleData.y;\n let width;\n let height;\n // TODO - bit hacky??\n if (graphicsData.type === GEOM_CIRCLE) {\n width = circleData.radius;\n height = circleData.radius;\n } else {\n width = circleData.width;\n height = circleData.height;\n }\n const totalSegs = 40;\n const seg = (Math.PI * 2) / totalSegs;\n if (graphicsData.fill) {\n const color = hex2rgb(graphicsData.fillColor);\n const alpha = graphicsData.fillAlpha;\n const r = color[0] * alpha;\n const g = color[1] * alpha;\n const b = color[2] * alpha;\n const verts = webGLData.points;\n const indices = webGLData.indices;\n let vecPos = verts.length / 6;\n indices.push(vecPos);\n for (let i = 0; i < totalSegs + 1; i += 1) {\n verts.push(x, y, r, g, b, alpha);\n verts.push(x + Math.sin(seg * i) * width, y + Math.cos(seg * i) * height, r, g, b, alpha);\n indices.push(vecPos, vecPos + 1);\n vecPos += 2;\n }\n indices.push(vecPos - 1);\n }\n if (graphicsData.lineWidth) {\n const tempPoints = graphicsData.points;\n graphicsData.points = [];\n for (let i = 0; i < totalSegs + 1; i += 1) {\n graphicsData.points.push(x + Math.sin(seg * i) * width, y + Math.cos(seg * i) * height);\n }\n buildLine(graphicsData, webGLData);\n graphicsData.points = tempPoints;\n }\n};\n\n/**\n * Updates the graphics data for WebGL rendering.\n * @param {object} graphicsData - The graphics data to update.\n * @param {GraphicsData} webGLData - The WebGL graphics data object.\n */\nexport const buildComplexPoly = (graphicsData, webGLData) => {\n // TODO - no need to copy this as it gets turned into a Float32Array anyways..\n const points = graphicsData.points.slice();\n if (points.length < 6) {\n return;\n }\n // get first and last point.. figure out the middle!\n const indices = webGLData.indices;\n webGLData.points = points;\n webGLData.alpha = graphicsData.fillAlpha;\n webGLData.color = hex2rgb(graphicsData.fillColor);\n /*\n calculate the bounds..\n */\n let minX = Infinity;\n let maxX = -Infinity;\n let minY = Infinity;\n let maxY = -Infinity;\n let x;\n let y;\n // get size..\n for (let i = 0; i < points.length; i += 2) {\n x = points[i];\n y = points[i + 1];\n minX = x < minX ? x : minX;\n maxX = x > maxX ? x : maxX;\n minY = y < minY ? y : minY;\n maxY = y > maxY ? y : maxY;\n }\n // add a quad to the end cos there is no point making another buffer!\n points.push(minX, minY, maxX, minY, maxX, maxY, minX, maxY);\n // push a quad onto the end..\n // TODO - this aint needed!\n const length = points.length / 2;\n for (let i = 0; i < length; i += 1) {\n indices.push(i);\n }\n};\n\n/**\n * Updates the graphics data for WebGL rendering.\n * @param {object} graphicsData - TBD.\n * @param {GraphicsData} webGLData - TBD.\n * @returns {boolean} TBD.\n */\nexport const buildPoly = (graphicsData, webGLData) => {\n const points = graphicsData.points;\n if (points.length < 6) {\n return false;\n }\n // get first and last point.. figure out the middle!\n const verts = webGLData.points;\n const indices = webGLData.indices;\n const length = points.length / 2;\n // sort color\n const color = hex2rgb(graphicsData.fillColor);\n const alpha = graphicsData.fillAlpha;\n const r = color[0] * alpha;\n const g = color[1] * alpha;\n const b = color[2] * alpha;\n const triangles = triangulate(points, null, 2);\n if (!triangles) {\n return false;\n }\n const vertPos = verts.length / 6;\n for (let i = 0; i < triangles.length; i += 3) {\n indices.push(triangles[i] + vertPos);\n indices.push(triangles[i] + vertPos);\n indices.push(triangles[i + 1] + vertPos);\n indices.push(triangles[i + 2] + vertPos);\n indices.push(triangles[i + 2] + vertPos);\n }\n for (let i = 0; i < length; i += 1) {\n verts.push(points[i * 2], points[i * 2 + 1], r, g, b, alpha);\n }\n return true;\n};\n\n/**\n * TBD.\n * @param {import('../graphics.js').Graphics} graphics - The graphics object to update.\n * @param {WebGLRenderingContext & { id: number }} gl - The WebGL rendering context.\n */\nexport const updateGraphics = (graphics, gl) => {\n const stencilBufferLimit = getStencilBufferLimit();\n // get the contexts graphics object\n let webGL = graphics._webGL[gl.id];\n // if the graphics object does not exist in the webGL context time to create it!\n if (!webGL) {\n webGL = { lastIndex: 0, data: [], gl };\n graphics._webGL[gl.id] = webGL;\n }\n // flag the graphics as not dirty as we are about to update it...\n graphics.dirty = false;\n let i;\n // if the user cleared the graphics object we will need to clear every object\n if (graphics.clearDirty) {\n graphics.clearDirty = false;\n // lop through and return all the webGLDatas to the object pool so than can be reused later on\n for (i = 0; i < webGL.data.length; i += 1) {\n const graphicsData = webGL.data[i];\n graphicsData.reset();\n getGraphicsDataPool().push(graphicsData);\n }\n // clear the array and reset the index..\n webGL.data = [];\n webGL.lastIndex = 0;\n }\n let webGLData;\n // loop through the graphics datas and construct each one..\n // if the object is a complex fill then the new stencil buffer technique will be used\n // other wise graphics objects will be pushed into a batch..\n for (i = webGL.lastIndex; i < graphics.graphicsData.length; i += 1) {\n const data = graphics.graphicsData[i];\n if (data.type === GEOM_POLYGON) {\n // need to add the points the the graphics object..\n data.points = data.shape.points.slice();\n if (data.shape.closed) {\n // close the poly if the value is true!\n if (\n data.points[0] !== data.points[data.points.length - 2] ||\n data.points[1] !== data.points[data.points.length - 1]\n ) {\n data.points.push(data.points[0], data.points[1]);\n }\n }\n // MAKE SURE WE HAVE THE CORRECT TYPE..\n if (data.fill) {\n if (data.points.length >= stencilBufferLimit) {\n if (data.points.length < stencilBufferLimit * 2) {\n webGLData = switchMode(webGL, 0);\n const canDrawUsingSimple = buildPoly(data, webGLData);\n if (!canDrawUsingSimple) {\n webGLData = switchMode(webGL, 1);\n buildComplexPoly(data, webGLData);\n }\n } else {\n webGLData = switchMode(webGL, 1);\n buildComplexPoly(data, webGLData);\n }\n }\n }\n if (data.lineWidth > 0) {\n webGLData = switchMode(webGL, 0);\n buildLine(data, webGLData);\n }\n } else {\n webGLData = switchMode(webGL, 0);\n if (data.type === GEOM_RECTANGLE) {\n buildRectangle(data, webGLData);\n } else if (data.type === GEOM_CIRCLE || data.type === GEOM_ELLIPSE) {\n buildCircle(data, webGLData);\n } else if (data.type === GEOM_ROUNDED_RECTANGLE) {\n buildRoundedRectangle(data, webGLData);\n }\n }\n webGL.lastIndex += 1;\n }\n // upload all the dirty data...\n for (i = 0; i < webGL.data.length; i += 1) {\n webGLData = webGL.data[i];\n if (webGLData.dirty) {\n webGLData.upload();\n }\n }\n};\n\n/**\n * Updates the graphics data for WebGL rendering.\n * @param {import('../graphics.js').Graphics} graphics - The graphics object to update.\n * @param {object} renderSession - The rendering session.\n */\nexport const renderGraphics = (graphics, renderSession) => {\n const gl = renderSession.gl;\n const projection = renderSession.projection;\n const offset = renderSession.offset;\n let shader = renderSession.shaderManager.primitiveShader;\n let webGLData;\n if (graphics.dirty) {\n updateGraphics(graphics, gl);\n }\n const webGL = graphics._webGL[gl.id];\n // https://github.com/photonstorm/phaser-ce/pull/179\n if (!webGL) {\n return;\n }\n // This could be speeded up for sure!\n for (let i = 0; i < webGL.data.length; i += 1) {\n if (webGL.data[i].mode === 1) {\n webGLData = webGL.data[i];\n renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession);\n // render quad..\n gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, (webGLData.indices.length - 4) * 2);\n renderSession.stencilManager.popStencil(graphics, webGLData, renderSession);\n } else {\n webGLData = webGL.data[i];\n renderSession.shaderManager.setShader(shader); // activatePrimitiveShader();\n shader = renderSession.shaderManager.primitiveShader;\n gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));\n gl.uniform1f(shader.flipY, 1);\n gl.uniform2f(shader.projectionVector, projection.x, -projection.y);\n gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);\n gl.uniform3fv(shader.tintColor, hex2rgb(graphics.tint));\n gl.uniform1f(shader.alpha, graphics.worldAlpha);\n gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);\n gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0);\n gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false, 4 * 6, 2 * 4);\n // set the index buffer!\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);\n gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0);\n }\n }\n};\n","// @ts-nocheck\nimport { removeByCanvas } from '../canvas/pool.js';\n\nexport class BaseTexture {\n /**\n * Updates the base texture with a new source.\n * @param {HTMLCanvasElement} source - The new canvas element to use as the texture source.\n * @param {number} [scaleMode] - The scale mode to use for the texture.\n */\n constructor(source, scaleMode) {\n this.resolution = 1;\n this.width = 100;\n this.height = 100;\n this.scaleMode = scaleMode || window.PhaserRegistry.TEXTURE_SCALE_MODE;\n this.hasLoaded = false;\n this.source = source;\n this.premultipliedAlpha = true;\n this._glTextures = [];\n this.mipmap = false;\n this.skipRender = false;\n this._powerOf2 = false;\n this._dirty = [true, true, true, true];\n if (source) {\n if ((this.source.complete || this.source.getContext) && this.source.width && this.source.height) {\n this.hasLoaded = true;\n this.width = this.source.naturalWidth || this.source.width;\n this.height = this.source.naturalHeight || this.source.height;\n this.dirty();\n }\n }\n }\n\n /**\n * Updates the base texture with new dimensions.\n * @param {number} width - The new width of the texture.\n * @param {number} height - The new height of the texture.\n */\n forceLoaded(width, height) {\n this.hasLoaded = true;\n this.width = width;\n this.height = height;\n this.dirty();\n }\n\n /**\n * Destroys the texture.\n */\n destroy() {\n if (this.source) {\n removeByCanvas(this.source);\n }\n this.source = null;\n this.unloadFromGPU();\n }\n\n /**\n * Marks the texture as dirty.\n */\n dirty() {\n for (let i = 0; i < this._glTextures.length; i += 1) {\n this._dirty[i] = true;\n }\n }\n\n /**\n * Unloads the texture from the GPU.\n */\n unloadFromGPU() {\n this.dirty();\n for (let i = this._glTextures.length - 1; i >= 0; i -= 1) {\n const glTexture = this._glTextures[i];\n const gl = window.PhaserRegistry.GL_CONTEXTS[i];\n if (gl && glTexture) {\n gl.deleteTexture(glTexture);\n }\n }\n this._glTextures.length = 0;\n this.dirty();\n }\n}\n","// @ts-nocheck\nimport { BaseTexture } from './base_texture.js';\nimport { Texture } from './texture.js';\n\n/**\n * Creates a new BaseTexture from a canvas element.\n * @param {HTMLCanvasElement} canvas - The canvas element to use as the texture source.\n * @param {number} [scaleMode] - The scale mode to use for the texture.\n * @returns {BaseTexture} The newly created BaseTexture instance.\n */\nexport const baseTextureFromCanvas = (canvas, scaleMode) => {\n if (canvas.width === 0) {\n canvas.width = 1;\n }\n if (canvas.height === 0) {\n canvas.height = 1;\n }\n return new BaseTexture(canvas, scaleMode);\n};\n\n/**\n * Creates a new Texture from a canvas element.\n * @param {HTMLCanvasElement} canvas - The canvas element to use as the texture source.\n * @param {number} [scaleMode] - The scale mode to use for the texture.\n * @returns {Texture} The newly created Texture instance.\n */\nexport const textureFromCanvas = (canvas, scaleMode) => {\n return new Texture(baseTextureFromCanvas(canvas, scaleMode));\n};\n","// @ts-nocheck\nimport {\n BLEND_NORMAL,\n GEOM_CIRCLE,\n GEOM_ELLIPSE,\n GEOM_POLYGON,\n GEOM_RECTANGLE,\n GEOM_ROUNDED_RECTANGLE,\n GRAPHICS,\n} from '../core/const.js';\nimport { Circle } from '../geom/circle.js';\nimport { Ellipse } from '../geom/ellipse.js';\nimport { Point } from '../geom/point.js';\nimport { Polygon } from '../geom/polygon.js';\nimport { Rectangle } from '../geom/rectangle.js';\nimport { RoundedRectangle } from '../geom/rounded_rectangle.js';\nimport { getIdentityMatrix } from '../geom/util/matrix.js';\nimport { getEmptyRectangle } from '../geom/util/rectangle.js';\nimport { CanvasBuffer } from './canvas/buffer.js';\nimport { renderGraphics as renderCanvasGraphics } from './canvas/graphics.js';\nimport { DisplayObject } from './display_object.js';\nimport { GraphicsData } from './graphics_data.js';\nimport { Image } from './image.js';\nimport { renderCanvas as renderSpriteCanvas, renderWebGL as renderSpriteWebGL } from './sprite_util.js';\nimport { renderGraphics as renderWebGLGraphics } from './webgl/graphics.js';\nimport { textureFromCanvas } from './webgl/texture_util.js';\n\nexport class Graphics extends DisplayObject {\n /**\n * Creates a new Graphics object.\n * @param {import('../core/game.js').Game} game - The game instance.\n * @param {number} x - The x coordinate of the graphics object.\n * @param {number} y - The y coordinate of the graphics object.\n */\n constructor(game, x = 0, y = 0) {\n super(game);\n /** @type {number} */\n this.type = GRAPHICS;\n this.position.setTo(x, y);\n /** @type {boolean} */\n this.renderable = true;\n /** @type {number} */\n this.fillAlpha = 1;\n /** @type {number} */\n this.lineWidth = 0;\n /** @type {number} */\n this.lineColor = 0;\n this.graphicsData = [];\n /** @type {number} */\n this.tint = 0xffffff;\n /** @type {number} */\n this.blendMode = BLEND_NORMAL;\n /** @type {GraphicsData} */\n this.currentPath = null;\n /** @type {object[]} */\n this._webGL = [];\n /** @type {boolean} */\n this.isMask = false;\n /** @type {number} */\n this.boundsPadding = 0;\n /** @type {Rectangle} */\n this._localBounds = new Rectangle(0, 0, 1, 1);\n /** @type {boolean} */\n this.dirty = true;\n /** @type {boolean} */\n this._boundsDirty = false;\n /** @type {boolean} */\n this._cacheAsBitmap = false;\n /** @type {boolean} */\n this.webGLDirty = false;\n /** @type {boolean} */\n this.cachedSpriteDirty = false;\n }\n\n /**\n * Destroys the graphics object and clears all data.\n */\n destroy() {\n // TODO\n this.clear();\n super.destroy();\n }\n\n /**\n * Sets the line style for subsequent drawing operations.\n * @param {number} lineWidth - The width of the line to draw.\n * @param {number} color - The color of the line to draw.\n * @param {number} alpha - The alpha (transparency) of the line to draw.\n * @returns {Graphics} This Graphics object for chaining.\n */\n lineStyle(lineWidth = 0, color = 0, alpha = 1) {\n this.lineWidth = lineWidth || 0;\n this.lineColor = color || 0;\n this.lineAlpha = alpha === undefined ? 1 : alpha;\n if (this.currentPath) {\n if (this.currentPath.shape.points.length) {\n // halfway through a line? start a new one!\n this.drawShape(new Polygon(this.currentPath.shape.points.slice(-2)));\n } else {\n // otherwise its empty so lets just set the line properties\n this.currentPath.lineWidth = this.lineWidth;\n this.currentPath.lineColor = this.lineColor;\n this.currentPath.lineAlpha = this.lineAlpha;\n }\n }\n return this;\n }\n\n /**\n * Moves the drawing cursor to the specified point.\n * @param {number} x - The x coordinate to move to.\n * @param {number} y - The y coordinate to move to.\n * @returns {Graphics} This Graphics object for chaining.\n */\n moveTo(x, y) {\n this.drawShape(new Polygon([x, y]));\n return this;\n }\n\n /**\n * Draws a line from the current drawing position to the specified point.\n * @param {number} x - The x coordinate to draw to.\n * @param {number} y - The y coordinate to draw to.\n * @returns {Graphics} This Graphics object for chaining.\n */\n lineTo(x, y) {\n if (!this.currentPath) {\n this.moveTo(0, 0);\n }\n this.currentPath.shape.points.push(x, y);\n this.dirty = true;\n this._boundsDirty = true;\n return this;\n }\n\n /**\n * Draws a quadratic curve from the current position to the specified point.\n * @param {number} cpX - The x coordinate of the control point.\n * @param {number} cpY - The y coordinate of the control point.\n * @param {number} toX - The x coordinate to draw to.\n * @param {number} toY - The y coordinate to draw to.\n * @returns {Graphics} This Graphics object for chaining.\n */\n quadraticCurveTo(cpX, cpY, toX, toY) {\n if (this.currentPath) {\n if (this.currentPath.shape.points.length === 0) {\n this.currentPath.shape.points = [0, 0];\n }\n } else {\n this.moveTo(0, 0);\n }\n let xa;\n let ya;\n const n = 20;\n const points = this.currentPath.shape.points;\n if (points.length === 0) {\n this.moveTo(0, 0);\n }\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\n let j = 0;\n for (let i = 1; i <= n; i += 1) {\n j = i / n;\n xa = fromX + (cpX - fromX) * j;\n ya = fromY + (cpY - fromY) * j;\n points.push(xa + (cpX + (toX - cpX) * j - xa) * j, ya + (cpY + (toY - cpY) * j - ya) * j);\n }\n this.dirty = true;\n this._boundsDirty = true;\n return this;\n }\n\n /**\n * Draws a cubic Bezier curve from the current position to the specified point.\n * @param {number} cpX - The x coordinate of the first control point.\n * @param {number} cpY - The y coordinate of the first control point.\n * @param {number} cpX2 - The x coordinate of the second control point.\n * @param {number} cpY2 - The y coordinate of the second control point.\n * @param {number} toX - The x coordinate to draw to.\n * @param {number} toY - The y coordinate to draw to.\n * @returns {Graphics} This Graphics object for chaining.\n */\n bezierCurveTo(cpX, cpY, cpX2, cpY2, toX, toY) {\n if (this.currentPath) {\n if (this.currentPath.shape.points.length === 0) {\n this.currentPath.shape.points = [0, 0];\n }\n } else {\n this.moveTo(0, 0);\n }\n const n = 20;\n let dt;\n let dt2;\n let dt3;\n let t2;\n let t3;\n const points = this.currentPath.shape.points;\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\n let j = 0;\n for (let i = 1; i <= n; i += 1) {\n j = i / n;\n dt = 1 - j;\n dt2 = dt * dt;\n dt3 = dt2 * dt;\n t2 = j * j;\n t3 = t2 * j;\n points.push(\n dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX,\n dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY\n );\n }\n this.dirty = true;\n this._boundsDirty = true;\n return this;\n }\n\n /**\n * Draws an arc from the current position to the specified point.\n * @param {number} x1 - The x coordinate of the starting point.\n * @param {number} y1 - The y coordinate of the starting point.\n * @param {number} x2 - The x coordinate of the end point.\n * @param {number} y2 - The y coordinate of the end point.\n * @param {number} radius - The radius of the arc.\n * @returns {Graphics} This Graphics object for chaining.\n */\n arcTo(x1, y1, x2, y2, radius) {\n if (this.currentPath) {\n if (this.currentPath.shape.points.length === 0) {\n this.currentPath.shape.points.push(x1, y1);\n }\n } else {\n this.moveTo(x1, y1);\n }\n const points = this.currentPath.shape.points;\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\n const a1 = fromY - y1;\n const b1 = fromX - x1;\n const a2 = y2 - y1;\n const b2 = x2 - x1;\n const mm = Math.abs(a1 * b2 - b1 * a2);\n if (mm < 1e-8 || radius === 0) {\n if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) {\n points.push(x1, y1);\n }\n } else {\n const dd = a1 * a1 + b1 * b1;\n const cc = a2 * a2 + b2 * b2;\n const tt = a1 * a2 + b1 * b2;\n const k1 = (radius * Math.sqrt(dd)) / mm;\n const k2 = (radius * Math.sqrt(cc)) / mm;\n const j1 = (k1 * tt) / dd;\n const j2 = (k2 * tt) / cc;\n const cx = k1 * b2 + k2 * b1;\n const cy = k1 * a2 + k2 * a1;\n const px = b1 * (k2 + j1);\n const py = a1 * (k2 + j1);\n const qx = b2 * (k1 + j2);\n const qy = a2 * (k1 + j2);\n const startAngle = Math.atan2(py - cy, px - cx);\n const endAngle = Math.atan2(qy - cy, qx - cx);\n this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1);\n }\n this.dirty = true;\n this._boundsDirty = true;\n return this;\n }\n\n /**\n * Draws an arc with the specified center, radius, and angles.\n * @param {number} cx - The x coordinate of the center point.\n * @param {number} cy - The y coordinate of the center point.\n * @param {number} radius - The radius of the arc.\n * @param {number} startAngle - The starting angle in radians.\n * @param {number} endAngle - The ending angle in radians.\n * @param {boolean} anticlockwise - Whether to draw the arc anticlockwise.\n * @param {number} segments - The number of segments to use for drawing the arc.\n * @returns {Graphics} This Graphics object for chaining.\n */\n arc(cx, cy, radius, startAngle, endAngle, anticlockwise = false, segments = 40) {\n // If we do this we can never draw a full circle\n if (startAngle === endAngle) {\n return this;\n }\n if (!anticlockwise && endAngle <= startAngle) {\n endAngle += Math.PI * 2;\n } else if (anticlockwise && startAngle <= endAngle) {\n startAngle += Math.PI * 2;\n }\n const sweep = anticlockwise ? (startAngle - endAngle) * -1 : endAngle - startAngle;\n const segs = Math.ceil(Math.abs(sweep) / (Math.PI * 2)) * segments;\n // Sweep check - moved here because we don't want to do the moveTo below if the arc fails\n if (sweep === 0) {\n return this;\n }\n const startX = cx + Math.cos(startAngle) * radius;\n const startY = cy + Math.sin(startAngle) * radius;\n if (anticlockwise && this.filling) {\n this.moveTo(cx, cy);\n } else {\n this.moveTo(startX, startY);\n }\n // currentPath will always exist after calling a moveTo\n const points = this.currentPath.shape.points;\n const theta = sweep / (segs * 2);\n const theta2 = theta * 2;\n const cTheta = Math.cos(theta);\n const sTheta = Math.sin(theta);\n const segMinus = segs - 1;\n const remainder = (segMinus % 1) / segMinus;\n for (let i = 0; i <= segMinus; i += 1) {\n const real = i + remainder * i;\n const angle = theta + startAngle + theta2 * real;\n const c = Math.cos(angle);\n const s = -Math.sin(angle);\n points.push((cTheta * c + sTheta * s) * radius + cx, (cTheta * -s + sTheta * c) * radius + cy);\n }\n this.dirty = true;\n this._boundsDirty = true;\n return this;\n }\n\n /**\n * Begins filling with the specified color and alpha.\n * @param {number} color - The fill color to use.\n * @param {number} alpha - The fill alpha (transparency) to use.\n * @returns {Graphics} This Graphics object for chaining.\n */\n beginFill(color = 0, alpha = 1) {\n this.filling = true;\n this.fillColor = color || 0;\n this.fillAlpha = alpha === undefined ? 1 : alpha;\n if (this.currentPath) {\n if (this.currentPath.shape.points.length <= 2) {\n this.currentPath.fill = this.filling;\n this.currentPath.fillColor = this.fillColor;\n this.currentPath.fillAlpha = this.fillAlpha;\n }\n }\n return this;\n }\n\n /**\n * Ends the current fill operation.\n * @returns {Graphics} This Graphics object for chaining.\n */\n endFill() {\n this.filling = false;\n this.fillColor = null;\n this.fillAlpha = 1;\n return this;\n }\n\n /**\n * Draws a rectangle with the specified properties.\n * @param {number} x - The x coordinate of the rectangle.\n * @param {number} y - The y coordinate of the rectangle.\n * @param {number} width - The width of the rectangle.\n * @param {number} height - The height of the rectangle.\n * @returns {Graphics} This Graphics object for chaining.\n */\n drawRect(x, y, width, height) {\n this.drawShape(new Rectangle(x, y, width, height));\n return this;\n }\n\n /**\n * Draws a rounded rectangle with the specified properties.\n * @param {number} x - The x coordinate of the rectangle.\n * @param {number} y - The y coordinate of the rectangle.\n * @param {number} width - The width of the rectangle.\n * @param {number} height - The height of the rectangle.\n * @param {number} radius - The radius of the rounded corners.\n * @returns {Graphics} This Graphics object for chaining.\n */\n drawRoundedRect(x, y, width, height, radius) {\n this.drawShape(new RoundedRectangle(x, y, width, height, radius));\n return this;\n }\n\n /**\n * Draws a circle with the specified properties.\n * @param {number} x - The x coordinate of the center point.\n * @param {number} y - The y coordinate of the center point.\n * @param {number} diameter - The diameter of the circle.\n * @returns {Graphics} This Graphics object for chaining.\n */\n drawCircle(x, y, diameter) {\n this.drawShape(new Circle(x, y, diameter));\n return this;\n }\n\n /**\n * Draws an ellipse with the specified properties.\n * @param {number} x - The x coordinate of the center point.\n * @param {number} y - The y coordinate of the center point.\n * @param {number} width - The width of the ellipse.\n * @param {number} height - The height of the ellipse.\n * @returns {Graphics} This Graphics object for chaining.\n */\n drawEllipse(x, y, width, height) {\n this.drawShape(new Ellipse(x, y, width, height));\n return this;\n }\n\n /**\n * Draws a polygon with the specified path.\n * @param {Polygon} path - The polygon to draw.\n * @returns {Graphics} This Graphics object for chaining.\n */\n drawPolygon(path) {\n let points;\n if (path instanceof Polygon) {\n points = path.points;\n } else {\n points = path;\n }\n // TODO\n /*\n if (!Array.isArray(points)) {\n points = new Array(arguments.length);\n for (let i = 0; i < points.length; i += 1) {\n points[i] = arguments[i];\n }\n }\n */\n this.drawShape(new Polygon(points));\n return this;\n }\n\n /**\n * Clears all graphics data.\n * @returns {Graphics} This Graphics object for chaining.\n */\n clear() {\n this.lineWidth = 0;\n this.filling = false;\n this.dirty = true;\n this._boundsDirty = true;\n this.clearDirty = true;\n this.graphicsData = [];\n this.updateLocalBounds();\n return this;\n }\n\n /**\n * Generates a texture from the graphics object (not implemented).\n */\n generateTexture() {\n // TODO\n this.game.logger.warn('graphics.generateTexture() is not implemented');\n }\n\n /**\n * Renders the graphics object using WebGL.\n * @param {object} renderSession - The render session to use.\n */\n renderWebGL(renderSession) {\n // if the sprite is not visible or the alpha is 0 then no need to render this element\n if (this.visible === false || this.alpha === 0 || this.isMask === true) {\n return;\n }\n if (this._cacheAsBitmap) {\n if (this.dirty || this.cachedSpriteDirty) {\n this.generateCachedSprite();\n // we will also need to update the texture on the gpu too!\n this.updateCachedSpriteTexture();\n this.cachedSpriteDirty = false;\n this.dirty = false;\n }\n this._cachedSprite.worldAlpha = this.worldAlpha;\n renderSpriteWebGL.call(this._cachedSprite, renderSession);\n } else {\n renderSession.spriteBatch.stop();\n renderSession.blendModeManager.setBlendMode(this.blendMode);\n if (this._mask) {\n renderSession.maskManager.pushMask(this._mask, renderSession);\n }\n if (this._filters) {\n renderSession.filterManager.pushFilter(this._filterBlock);\n }\n // check blend mode\n if (this.blendMode !== renderSession.spriteBatch.currentBlendMode) {\n renderSession.spriteBatch.currentBlendMode = this.blendMode;\n const blendModeWebGL = window.PhaserRegistry.blendModesWebGL[renderSession.spriteBatch.currentBlendMode];\n renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);\n }\n // check if the webgl graphic needs to be updated\n if (this.webGLDirty) {\n this.dirty = true;\n this.webGLDirty = false;\n }\n renderWebGLGraphics(this, renderSession);\n // only render if it has children!\n if (this.children.length) {\n renderSession.spriteBatch.start();\n // simple render children!\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].renderWebGL(renderSession);\n }\n renderSession.spriteBatch.stop();\n }\n if (this._filters) {\n renderSession.filterManager.popFilter();\n }\n if (this._mask) {\n renderSession.maskManager.popMask(this.mask, renderSession);\n }\n renderSession.drawCount += 1;\n renderSession.spriteBatch.start();\n }\n }\n\n /**\n * Renders the graphics object using Canvas.\n * @param {object} renderSession - The render session to use.\n */\n renderCanvas(renderSession) {\n // if the sprite is not visible or the alpha is 0 then no need to render this element\n if (this.visible === false || this.alpha === 0 || this.isMask === true) {\n return;\n }\n // if the tint has changed, set the graphics object to dirty.\n if (this._prevTint !== this.tint) {\n this.dirty = true;\n this._prevTint = this.tint;\n }\n if (this._cacheAsBitmap) {\n if (this.dirty || this.cachedSpriteDirty) {\n this.generateCachedSprite();\n // we will also need to update the texture\n this.updateCachedSpriteTexture();\n this.cachedSpriteDirty = false;\n this.dirty = false;\n }\n this._cachedSprite.alpha = this.alpha;\n renderSpriteCanvas(this._cachedSprite, renderSession);\n } else {\n const context = renderSession.context;\n const transform = this.worldTransform;\n if (this.blendMode !== renderSession.currentBlendMode) {\n renderSession.currentBlendMode = this.blendMode;\n context.globalCompositeOperation = window.PhaserRegistry.blendModesCanvas[renderSession.currentBlendMode];\n }\n if (this._mask) {\n renderSession.maskManager.pushMask(this._mask, renderSession);\n }\n const resolution = renderSession.resolution;\n const tx = transform.tx * renderSession.resolution + renderSession.shakeX;\n const ty = transform.ty * renderSession.resolution + renderSession.shakeY;\n context.setTransform(\n transform.a * resolution,\n transform.b * resolution,\n transform.c * resolution,\n transform.d * resolution,\n tx,\n ty\n );\n renderCanvasGraphics(this, context);\n // simple render children!\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].renderCanvas(renderSession);\n }\n if (this._mask) {\n renderSession.maskManager.popMask(renderSession);\n }\n }\n }\n\n /**\n * Gets the bounds of the graphics object.\n * @param {import('../geom/matrix.js').Matrix} matrix - The transformation matrix to use.\n * @returns {Rectangle} The bounds rectangle of the graphics object.\n */\n getBounds(matrix = null) {\n if (!this.renderable) {\n return getEmptyRectangle();\n }\n if (this.dirty) {\n this.updateLocalBounds();\n this.webGLDirty = true;\n this.cachedSpriteDirty = true;\n this.dirty = false;\n } else if (this.currentBounds) {\n return this.currentBounds;\n }\n const bounds = this._localBounds;\n const w0 = bounds.x;\n const w1 = bounds.width + bounds.x;\n const h0 = bounds.y;\n const h1 = bounds.height + bounds.y;\n const worldTransform = matrix || this.worldTransform;\n const a = worldTransform.a;\n const b = worldTransform.b;\n const c = worldTransform.c;\n const d = worldTransform.d;\n const tx = worldTransform.tx;\n const ty = worldTransform.ty;\n const x1 = a * w1 + c * h1 + tx;\n const y1 = d * h1 + b * w1 + ty;\n const x2 = a * w0 + c * h1 + tx;\n const y2 = d * h1 + b * w0 + ty;\n const x3 = a * w0 + c * h0 + tx;\n const y3 = d * h0 + b * w0 + ty;\n const x4 = a * w1 + c * h0 + tx;\n const y4 = d * h0 + b * w1 + ty;\n let maxX = x1;\n let maxY = y1;\n let minX = x1;\n let minY = y1;\n minX = x2 < minX ? x2 : minX;\n minX = x3 < minX ? x3 : minX;\n minX = x4 < minX ? x4 : minX;\n minY = y2 < minY ? y2 : minY;\n minY = y3 < minY ? y3 : minY;\n minY = y4 < minY ? y4 : minY;\n maxX = x2 > maxX ? x2 : maxX;\n maxX = x3 > maxX ? x3 : maxX;\n maxX = x4 > maxX ? x4 : maxX;\n maxY = y2 > maxY ? y2 : maxY;\n maxY = y3 > maxY ? y3 : maxY;\n maxY = y4 > maxY ? y4 : maxY;\n this.cachedBounds.x = minX;\n this.cachedBounds.width = maxX - minX;\n this.cachedBounds.y = minY;\n this.cachedBounds.height = maxY - minY;\n this.currentBounds = this.cachedBounds;\n return this.currentBounds;\n }\n\n /**\n * Gets the local bounds of the graphics object.\n * @returns {Rectangle} The local bounds rectangle of the graphics object.\n */\n getLocalBounds() {\n const matrixCache = this.worldTransform;\n this.worldTransform = getIdentityMatrix();\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].updateTransform();\n }\n const bounds = this.getBounds();\n this.worldTransform = matrixCache;\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].updateTransform();\n }\n return bounds;\n }\n\n /**\n * Checks if the graphics object contains a point.\n * @param {Point} point - The point to check.\n * @param {Point} tempPoint - A temporary point object to use.\n * @returns {boolean} True if the graphics object contains the point, otherwise false.\n */\n containsPoint(point, tempPoint) {\n this.worldTransform.applyInverse(point, tempPoint);\n const graphicsData = this.graphicsData;\n for (let i = 0; i < graphicsData.length; i += 0) {\n const data = graphicsData[i];\n if (data.fill && data.shape) {\n if (data.shape.contains(tempPoint.x, tempPoint.y)) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * Updates the local bounds of the graphics object.\n */\n updateLocalBounds() {\n let minX = Infinity;\n let maxX = -Infinity;\n let minY = Infinity;\n let maxY = -Infinity;\n if (this.graphicsData.length) {\n let shape;\n let points;\n let x;\n let y;\n let w;\n let h;\n for (let i = 0; i < this.graphicsData.length; i += 1) {\n const data = this.graphicsData[i];\n const type = data.type;\n const lineWidth = data.lineWidth;\n shape = data.shape;\n if (type === GEOM_RECTANGLE || type === GEOM_ROUNDED_RECTANGLE) {\n x = shape.x - lineWidth / 2;\n y = shape.y - lineWidth / 2;\n w = shape.width + lineWidth;\n h = shape.height + lineWidth;\n minX = x < minX ? x : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y < minY ? y : minY;\n maxY = y + h > maxY ? y + h : maxY;\n } else if (type === GEOM_CIRCLE) {\n x = shape.x;\n y = shape.y;\n w = shape.radius + lineWidth / 2;\n h = shape.radius + lineWidth / 2;\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n } else if (type === GEOM_ELLIPSE) {\n x = shape.x;\n y = shape.y;\n w = shape.width + lineWidth / 2;\n h = shape.height + lineWidth / 2;\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n } else {\n // POLY - assumes points are sequential, not Point objects\n points = shape.points;\n for (let j = 0; j < points.length; j += 1) {\n if (points[j] instanceof Point) {\n x = points[j].x;\n y = points[j].y;\n } else {\n x = points[j];\n y = points[j + 1];\n if (j < points.length - 1) {\n j += 1;\n }\n }\n minX = x - lineWidth < minX ? x - lineWidth : minX;\n maxX = x + lineWidth > maxX ? x + lineWidth : maxX;\n minY = y - lineWidth < minY ? y - lineWidth : minY;\n maxY = y + lineWidth > maxY ? y + lineWidth : maxY;\n }\n }\n }\n } else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n const padding = this.boundsPadding;\n this._localBounds.x = minX - padding;\n this._localBounds.width = maxX - minX + padding * 2;\n this._localBounds.y = minY - padding;\n this._localBounds.height = maxY - minY + padding * 2;\n }\n\n /**\n * Generates a cached sprite representation of the graphics object.\n */\n generateCachedSprite() {\n const bounds = this.getLocalBounds();\n if (!this._cachedSprite) {\n const canvasBuffer = new CanvasBuffer(bounds.width, bounds.height);\n const texture = textureFromCanvas(canvasBuffer.canvas);\n this._cachedSprite = new Image(this.game, 0, 0, texture);\n this._cachedSprite.buffer = canvasBuffer;\n this._cachedSprite.worldTransform = this.worldTransform;\n } else {\n this._cachedSprite.buffer.resize(bounds.width, bounds.height);\n }\n // leverage the anchor to account for the offset of the element\n this._cachedSprite.anchor.x = -(bounds.x / bounds.width);\n this._cachedSprite.anchor.y = -(bounds.y / bounds.height);\n // this._cachedSprite.buffer.context.save();\n this._cachedSprite.buffer.context.translate(-bounds.x, -bounds.y);\n // make sure we set the alpha of the graphics to 1 for the render..\n this.worldAlpha = 1;\n // now render the graphic..\n renderCanvasGraphics(this, this._cachedSprite.buffer.context);\n this._cachedSprite.alpha = this.alpha;\n }\n\n /**\n * Updates the cached sprite texture.\n */\n updateCachedSpriteTexture() {\n const cachedSprite = this._cachedSprite;\n const texture = cachedSprite.texture;\n const canvas = cachedSprite.buffer.canvas;\n texture.baseTexture.width = canvas.width;\n texture.baseTexture.height = canvas.height;\n texture.crop.width = canvas.width;\n texture.crop.height = canvas.height;\n texture.frame.width = canvas.width;\n texture.frame.height = canvas.height;\n cachedSprite._width = canvas.width;\n cachedSprite._height = canvas.height;\n // update the dirty base textures\n texture.baseTexture.dirty();\n }\n\n /**\n * Destroys the cached sprite.\n */\n destroyCachedSprite() {\n if (!this._cachedSprite) {\n return;\n }\n this._cachedSprite.texture.destroy(true);\n this._cachedSprite = null;\n }\n\n /**\n * Draws a shape with the specified properties.\n * @param {object} shape - The shape to draw.\n * @returns {GraphicsData} The graphics data for the drawn shape.\n */\n drawShape(shape) {\n if (this.currentPath) {\n // check current path!\n if (this.currentPath.shape.points.length <= 2) {\n this.graphicsData.pop();\n }\n }\n this.currentPath = null;\n // Handle mixed-type polygons\n if (shape instanceof Polygon) {\n shape = shape.clone();\n shape.flatten();\n }\n const data = new GraphicsData(\n this.lineWidth,\n this.lineColor,\n this.lineAlpha,\n this.fillColor,\n this.fillAlpha,\n this.filling,\n shape\n );\n this.graphicsData.push(data);\n if (data.type === GEOM_POLYGON) {\n data.shape.closed = this.filling;\n this.currentPath = data;\n }\n this.dirty = true;\n this._boundsDirty = true;\n return data;\n }\n\n /**\n * Performs post-update operations for the graphics object.\n */\n postUpdate() {\n if (this._boundsDirty) {\n this.updateLocalBounds();\n this._boundsDirty = false;\n }\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].postUpdate();\n }\n }\n\n /**\n * Draws a triangle with the specified points and culling options.\n * @param {Point[]} points - The points of the triangle.\n * @param {boolean} cull - Whether to perform backface culling.\n */\n drawTriangle(points, cull = false) {\n const triangle = new Polygon(points);\n if (cull) {\n const cameraToFace = new Point(0 - points[0].x, 0 - points[0].y);\n const ab = new Point(points[1].x - points[0].x, points[1].y - points[0].y);\n const cb = new Point(points[1].x - points[2].x, points[1].y - points[2].y);\n const faceNormal = cb.cross(ab);\n if (cameraToFace.dot(faceNormal) > 0) {\n this.drawPolygon(triangle);\n }\n } else {\n this.drawPolygon(triangle);\n }\n }\n\n /**\n * Draws triangles with the specified vertices and indices.\n * @param {number[]|Point[]} vertices - The vertices of the triangles.\n * @param {number[]} indices - The indices of the vertices to use.\n * @param {boolean} cull - Whether to perform backface culling.\n */\n drawTriangles(vertices, indices, cull = false) {\n const point1 = new Point();\n const point2 = new Point();\n const point3 = new Point();\n let points = [];\n let i;\n if (!indices) {\n if (vertices[0] instanceof Point) {\n for (i = 0; i < vertices.length / 3; i += 1) {\n this.drawTriangle([vertices[i * 3], vertices[i * 3 + 1], vertices[i * 3 + 2]], cull);\n }\n } else {\n for (i = 0; i < vertices.length / 6; i += 1) {\n point1.x = vertices[i * 6 + 0];\n point1.y = vertices[i * 6 + 1];\n point2.x = vertices[i * 6 + 2];\n point2.y = vertices[i * 6 + 3];\n point3.x = vertices[i * 6 + 4];\n point3.y = vertices[i * 6 + 5];\n this.drawTriangle([point1, point2, point3], cull);\n }\n }\n } else if (vertices[0] instanceof Point) {\n for (i = 0; i < indices.length / 3; i += 1) {\n points.push(vertices[indices[i * 3]]);\n points.push(vertices[indices[i * 3 + 1]]);\n points.push(vertices[indices[i * 3 + 2]]);\n if (points.length === 3) {\n this.drawTriangle(points, cull);\n points = [];\n }\n }\n } else {\n for (i = 0; i < indices.length; i += 1) {\n point1.x = vertices[indices[i] * 2];\n point1.y = vertices[indices[i] * 2 + 1];\n points.push(point1.copyTo({}));\n if (points.length === 3) {\n this.drawTriangle(points, cull);\n points = [];\n }\n }\n }\n }\n}\n","// @ts-nocheck\nimport { GROUP } from '../core/const.js';\nimport { Signal } from '../core/signal.js';\nimport { DisplayObject } from './display_object.js';\nimport { Image } from './image.js';\n\nexport const SORT_ASCENDING = -1;\nexport const SORT_DESCENDING = 1;\n\nexport class Group extends DisplayObject {\n /**\n * Creates a new Group object.\n * @param {import('../core/game.js').Game} game - The game instance this group belongs to.\n * @param {DisplayObject} parent - The parent display object.\n * @param {string} name - The name of this group.\n * @param {boolean} addToStage - Whether to add this group to the stage.\n */\n constructor(game, parent = null, name = null, addToStage = false) {\n super(game);\n /** @type {number} */\n this.type = GROUP;\n if (!parent) {\n parent = game.world;\n }\n /** @type {string} */\n this.name = name || 'group';\n /** @type {number} */\n this.z = 0;\n if (addToStage) {\n this.game.stage.addChild(this);\n this.z = this.game.stage.children.length;\n } else if (parent) {\n parent.addChild(this);\n this.z = parent.children.length;\n }\n /** @type {boolean} */\n this.ignoreDestroy = false;\n /** @type {boolean} */\n this.pendingDestroy = false;\n this.classType = Image;\n this.cursor = null;\n /** @type {boolean} */\n this.inputEnableChildren = false;\n /** @type {Signal} */\n this.onChildInputDown = new Signal();\n /** @type {Signal} */\n this.onChildInputUp = new Signal();\n /** @type {Signal} */\n this.onChildInputOver = new Signal();\n /** @type {Signal} */\n this.onChildInputOut = new Signal();\n /** @type {Signal} */\n this.onDestroy = new Signal();\n /** @type {number} */\n this.cursorIndex = 0;\n /** @type {string} */\n this._sortProperty = 'z';\n }\n\n /**\n * Destroys this group and cleans up resources.\n * @param {boolean} destroyChildren - Whether to destroy children as well.\n * @param {boolean} soft - Whether to perform a soft destroy (leaving the group in the parent's children list).\n */\n destroy(destroyChildren = true, soft = false) {\n if (this.game === null || this.ignoreDestroy) {\n return;\n }\n this.onDestroy.dispatch(this, destroyChildren, soft);\n this.removeAll(destroyChildren);\n this.cursor = null;\n this.filters = null;\n this.pendingDestroy = false;\n if (!soft) {\n if (this.parent) {\n this.parent.removeChild(this);\n }\n this.game = null;\n this.exists = false;\n }\n }\n\n /**\n * Adds a child to this group.\n * @param {DisplayObject} child - The child to add.\n * @param {boolean} silent - Whether to dispatch events.\n * @param {number} index - The index to add the child at.\n * @returns {DisplayObject} The added child.\n */\n add(child, silent = false, index = -1) {\n if (child.parent === this) {\n return child;\n }\n if (index === -1) {\n child.z = this.children.length;\n this.addChild(child);\n } else {\n this.addChildAt(child, index);\n this.updateZ();\n }\n if (this.inputEnableChildren && (!child.input || child.inputEnabled)) {\n child.inputEnabled = true;\n }\n if (!silent && child.events) {\n child.events.onAddedToGroup$dispatch(child, this);\n }\n if (this.cursor === null) {\n this.cursor = child;\n }\n return child;\n }\n\n /**\n * Adds a child to this group at a specific index.\n * @param {DisplayObject} child - The child to add.\n * @param {number} index - The index to add the child at.\n * @param {boolean} silent - Whether to dispatch events.\n */\n addAt(child, index, silent) {\n this.add(child, silent, index);\n }\n\n /**\n * Gets a child at the specified index.\n * @param {number} index - The index of the child to get.\n * @returns {DisplayObject} The child at the specified index, or -1 if not found.\n */\n getAt(index) {\n if (index < 0 || index >= this.children.length) {\n return -1;\n }\n return this.getChildAt(index);\n }\n\n /**\n * Updates the Z indices of all children in this group.\n */\n updateZ() {\n let i = this.children.length;\n while (i) {\n i -= 1;\n this.children[i].z = i;\n }\n }\n\n /**\n * Gets the next child in this group (with circular wrapping).\n * @returns {DisplayObject} The next child, or null if no children exist.\n */\n next() {\n if (this.cursor) {\n // Wrap the cursor?\n if (this.cursorIndex >= this.children.length - 1) {\n this.cursorIndex = 0;\n } else {\n this.cursorIndex += 1;\n }\n this.cursor = this.children[this.cursorIndex];\n return this.cursor;\n }\n return null;\n }\n\n /**\n * Gets the previous child in this group (with circular wrapping).\n * @returns {DisplayObject} The previous child, or null if no children exist.\n */\n previous() {\n if (this.cursor) {\n // Wrap the cursor?\n if (this.cursorIndex === 0) {\n this.cursorIndex = this.children.length - 1;\n } else {\n this.cursorIndex -= 1;\n }\n this.cursor = this.children[this.cursorIndex];\n return this.cursor;\n }\n return null;\n }\n\n /**\n * Swaps the positions of two children in this group.\n * @param {DisplayObject} child1 - The first child to swap.\n * @param {DisplayObject} child2 - The second child to swap.\n */\n swap(child1, child2) {\n this.swapChildren(child1, child2);\n this.updateZ();\n }\n\n /**\n * Brings a child to the top of this group.\n * @param {DisplayObject} child - The child to bring to the top.\n * @returns {DisplayObject} The child that was brought to the top.\n */\n bringToTop(child) {\n if (child.parent === this && this.getIndex(child) < this.children.length) {\n this.remove(child, false, true);\n this.add(child, true);\n }\n return child;\n }\n\n /**\n * Sends a child to the back of this group.\n * @param {DisplayObject} child - The child to send to the back.\n * @returns {DisplayObject} The child that was sent to the back.\n */\n sendToBack(child) {\n if (child.parent === this && this.getIndex(child) > 0) {\n this.remove(child, false, true);\n this.addAt(child, 0, true);\n }\n return child;\n }\n\n /**\n * Reverses the order of children in this group.\n */\n reverse() {\n this.children.reverse();\n this.updateZ();\n }\n\n /**\n * Gets the index of a child in this group.\n * @param {DisplayObject} child - The child to get the index of.\n * @returns {number} The index of the child, or -1 if not found.\n */\n getIndex(child) {\n return this.children.indexOf(child);\n }\n\n /**\n * Updates the Z indices of all children in this group before the update cycle.\n */\n preUpdate() {\n if (this.pendingDestroy) {\n this.destroy();\n return;\n }\n if (!this.exists || !this.parent.exists) {\n this.renderOrderID = -1;\n return;\n }\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].preUpdate();\n }\n }\n\n /**\n * Updates all children in this group during the update cycle.\n */\n update() {\n let i = this.children.length;\n while (i) {\n i -= 1;\n this.children[i].update();\n }\n }\n\n /**\n * Updates all children in this group after the update cycle.\n */\n postUpdate() {\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].postUpdate();\n }\n }\n\n /**\n * Removes a child from this group.\n * @param {DisplayObject} child - The child to remove.\n * @param {boolean} destroy - Whether to destroy the child after removing it.\n * @param {boolean} silent - Whether to dispatch events.\n * @returns {boolean} True if the child was removed, false otherwise.\n */\n remove(child, destroy = true, silent = false) {\n if (this.children.length === 0 || this.children.indexOf(child) === -1) {\n return false;\n }\n if (!silent && child.events && !child.destroyPhase) {\n child.events.onRemovedFromGroup$dispatch(child, this);\n }\n const removed = this.removeChild(child);\n this.updateZ();\n if (this.cursor === child) {\n this.next();\n }\n if (destroy && removed) {\n removed.destroy(true);\n }\n return true;\n }\n\n /**\n * Removes all children from this group.\n * @param {boolean} destroy - Whether to destroy children as well.\n * @param {boolean} silent - Whether to dispatch events.\n * @param {boolean} destroyTexture - Whether to destroy textures as well.\n */\n removeAll(destroy = true, silent = false, destroyTexture = false) {\n if (this.children.length === 0) {\n return;\n }\n do {\n if (!silent && this.children[0].events) {\n this.children[0].events.onRemovedFromGroup$dispatch(this.children[0], this);\n }\n const removed = this.removeChild(this.children[0]);\n if (destroy && removed) {\n removed.destroy(true, destroyTexture);\n }\n } while (this.children.length > 0);\n this.cursor = null;\n }\n}\n","// @ts-nocheck\nimport { TEXT } from '../core/const.js';\nimport { Point } from '../geom/point.js';\nimport { Rectangle } from '../geom/rectangle.js';\nimport { snapToCeil } from '../util/math.js';\nimport { create, remove } from './canvas/pool.js';\nimport { Image } from './image.js';\nimport { getBounds, renderCanvas, renderWebGL } from './sprite_util.js';\nimport { textureFromCanvas } from './webgl/texture_util.js';\n\nexport class Text extends Image {\n /**\n * Creates a new Text object.\n * @param {import('../core/game.js').Game} game - The game instance this text belongs to.\n * @param {number} x - The x position of the text.\n * @param {number} y - The y position of the text.\n * @param {string} text - The text content to display.\n * @param {object} style - The style settings for the text.\n */\n constructor(game, x, y, text = '', style = {}) {\n super(game, x, y, null);\n this.game = game;\n /** @type {number} */\n this.type = TEXT;\n this.canvas = create(this);\n this.context = this.canvas.getContext('2d', { willReadFrequently: false });\n this.padding = new Point();\n this.textBounds = null;\n this.style = null;\n /** @type {string[]} */\n this.colors = [];\n /** @type {string[]} */\n this.strokeColors = [];\n /** @type {string[]} */\n this.fontStyles = [];\n /** @type {number[]} */\n this.fontWeights = [];\n this.autoRound = false;\n this.useAdvancedWrap = false;\n this._res = game.renderer.resolution;\n this._text = text.toString();\n this._fontComponents = null;\n /** @type {number} */\n this._lineSpacing = 0;\n /** @type {number} */\n this._charCount = 0;\n /** @type {number} */\n this._width = 0;\n /** @type {number} */\n this._height = 0;\n this.loadTexture(textureFromCanvas(this.canvas));\n this.setStyle(style);\n if (this._text !== '') {\n this.updateText();\n }\n }\n\n /**\n * Destroys this text object and cleans up resources.\n */\n destroy() {\n this.texture.destroy(true);\n remove(this);\n this.canvas = null;\n this.context = null;\n this.textBounds = null;\n this.style = null;\n this.colors = null;\n this.strokeColors = null;\n this.fontStyles = null;\n this.fontWeights = null;\n this.padding = null;\n this._text = null;\n this._fontComponents = null;\n super.destroy();\n }\n\n /**\n * Sets the drop shadow properties for this text.\n * @param {number} x - The horizontal offset of the shadow.\n * @param {number} y - The vertical offset of the shadow.\n * @param {string} color - The color of the shadow.\n * @param {number} blur - The blur radius of the shadow.\n * @param {boolean} shadowStroke - Whether to apply the shadow to the stroke.\n * @param {boolean} shadowFill - Whether to apply the shadow to the fill.\n * @returns {Text} This Text object for chaining.\n */\n setShadow(x = 0, y = 0, color = 'rgba(0, 0, 0, 1)', blur = 0, shadowStroke = true, shadowFill = true) {\n this.style.shadowOffsetX = x;\n this.style.shadowOffsetY = y;\n this.style.shadowColor = color;\n this.style.shadowBlur = blur;\n this.style.shadowStroke = shadowStroke;\n this.style.shadowFill = shadowFill;\n this.dirty = true;\n return this;\n }\n\n /**\n * Sets the style properties for this text.\n * @param {object} style - The style settings to apply.\n * @param {boolean} update - Whether to update the text immediately.\n * @returns {Text} This Text object for chaining.\n */\n setStyle(style = null, update = false) {\n style = JSON.parse(JSON.stringify(style)) || {};\n style.font = style.font || 'bold 20pt Arial';\n style.backgroundColor = style.backgroundColor || null;\n style.fill = style.fill || 'black';\n style.align = style.align || 'left';\n style.boundsAlignH = style.boundsAlignH || 'left';\n style.boundsAlignV = style.boundsAlignV || 'top';\n style.stroke = style.stroke || 'black'; // provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136\n style.strokeThickness = style.strokeThickness || 0;\n style.wordWrap = style.wordWrap || false;\n style.wordWrapWidth = style.wordWrapWidth || 100;\n style.maxLines = style.maxLines || 0;\n style.shadowOffsetX = style.shadowOffsetX || 0;\n style.shadowOffsetY = style.shadowOffsetY || 0;\n style.shadowColor = style.shadowColor || 'rgba(0,0,0,0)';\n style.shadowBlur = style.shadowBlur || 0;\n style.tabs = style.tabs || 0;\n const components = this.fontToComponents(style.font);\n if (style.fontStyle) {\n components.fontStyle = style.fontStyle;\n }\n if (style.fontVariant) {\n components.fontVariant = style.fontVariant;\n }\n if (style.fontWeight) {\n components.fontWeight = style.fontWeight;\n }\n if (style.fontSize) {\n if (typeof style.fontSize === 'number') {\n style.fontSize += 'px';\n }\n components.fontSize = style.fontSize;\n }\n this._fontComponents = components;\n style.font = this.componentsToFont(this._fontComponents);\n this.style = style;\n this.dirty = true;\n if (update) {\n this.updateText();\n }\n return this;\n }\n\n /**\n * Updates the text content and renders it to the canvas.\n */\n updateText() {\n this.texture.baseTexture.resolution = this._res;\n this.context.font = this.style.font;\n let outputText = this.text;\n if (this.style.wordWrap) {\n outputText = this.runWordWrap(this.text);\n }\n // Split text into lines\n const lines = outputText.split(/(?:\\r\\n|\\r|\\n)/);\n // Calculate text width\n const tabs = this.style.tabs;\n const lineWidths = [];\n let lineWidth = 0;\n let maxLineWidth = 0;\n let fontProperties = this.determineFontProperties(this.style.font);\n if (!fontProperties.fontSize) {\n fontProperties = this.determineFontPropertiesFallback(this.style.font);\n }\n let drawnLines = lines.length;\n if (this.style.maxLines > 0 && this.style.maxLines < lines.length) {\n drawnLines = this.style.maxLines;\n }\n this._charCount = 0;\n for (let i = 0; i < drawnLines; i += 1) {\n if (tabs === 0) {\n // Simple layout (no tabs)\n lineWidth = this.style.strokeThickness + this.padding.x;\n if (\n this.colors.length > 0 ||\n this.strokeColors.length > 0 ||\n this.fontWeights.length > 0 ||\n this.fontStyles.length > 0\n ) {\n lineWidth += this.measureLine(lines[i]);\n } else {\n lineWidth += this.context.measureText(lines[i]).width;\n }\n // Adjust for wrapped text\n if (this.style.wordWrap) {\n lineWidth -= this.context.measureText(' ').width;\n }\n } else {\n // Complex layout (tabs)\n const line = lines[i].split(/(?:\\t)/);\n lineWidth = this.padding.x + this.style.strokeThickness;\n if (Array.isArray(tabs)) {\n let tab = 0;\n for (let c = 0; c < line.length; c += 1) {\n let section = 0;\n if (\n this.colors.length > 0 ||\n this.strokeColors.length > 0 ||\n this.fontWeights.length > 0 ||\n this.fontStyles.length > 0\n ) {\n section = this.measureLine(line[c]);\n } else {\n section = Math.ceil(this.context.measureText(line[c]).width);\n }\n if (c > 0) {\n tab += tabs[c - 1];\n }\n lineWidth = tab + section;\n }\n } else {\n for (let c = 0; c < line.length; c += 1) {\n // How far to the next tab?\n if (\n this.colors.length > 0 ||\n this.strokeColors.length > 0 ||\n this.fontWeights.length > 0 ||\n this.fontStyles.length > 0\n ) {\n lineWidth += this.measureLine(line[c]);\n } else {\n lineWidth += Math.ceil(this.context.measureText(line[c]).width);\n }\n const diff = snapToCeil(lineWidth, tabs) - lineWidth;\n lineWidth += diff;\n }\n }\n }\n lineWidths[i] = Math.ceil(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidths[i]);\n }\n this.canvas.width = maxLineWidth * this._res;\n // Calculate text height\n const lineHeight = fontProperties.fontSize + this.style.strokeThickness + this.padding.y;\n let height = lineHeight * drawnLines;\n let lineSpacing = this._lineSpacing;\n if (lineSpacing < 0 && Math.abs(lineSpacing) > lineHeight) {\n lineSpacing = -lineHeight;\n }\n // Adjust for line spacing\n if (lineSpacing !== 0) {\n height += lineSpacing > 0 ? lineSpacing * lines.length : lineSpacing * (lines.length - 1);\n }\n this.canvas.height = height * this._res;\n this.context.scale(this._res, this._res);\n if (this.style.backgroundColor) {\n this.context.fillStyle = this.style.backgroundColor;\n this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);\n }\n this.context.fillStyle = this.style.fill;\n this.context.font = this.style.font;\n this.context.strokeStyle = this.style.stroke;\n this.context.textBaseline = 'alphabetic';\n this.context.lineWidth = this.style.strokeThickness;\n this.context.lineCap = 'round';\n this.context.lineJoin = 'round';\n let linePositionX;\n let linePositionY;\n this._charCount = 0;\n // Draw text line by line\n for (let i = 0; i < drawnLines; i += 1) {\n // Split the line by\n linePositionX = this.style.strokeThickness / 2;\n linePositionY = this.style.strokeThickness / 2 + i * lineHeight + fontProperties.ascent;\n if (i > 0) {\n linePositionY += lineSpacing * i;\n }\n if (this.style.align === 'right') {\n linePositionX += maxLineWidth - lineWidths[i];\n } else if (this.style.align === 'center') {\n linePositionX += (maxLineWidth - lineWidths[i]) / 2;\n }\n if (this.autoRound) {\n linePositionX = Math.round(linePositionX);\n linePositionY = Math.round(linePositionY);\n }\n if (\n this.colors.length > 0 ||\n this.strokeColors.length > 0 ||\n this.fontWeights.length > 0 ||\n this.fontStyles.length > 0\n ) {\n this.updateLine(lines[i], linePositionX, linePositionY);\n } else {\n if (this.style.stroke && this.style.strokeThickness) {\n this.updateShadow(this.style.shadowStroke);\n if (tabs === 0) {\n this.context.strokeText(lines[i], linePositionX, linePositionY);\n } else {\n this.renderTabLine(lines[i], linePositionX, linePositionY, false);\n }\n }\n if (this.style.fill) {\n this.updateShadow(this.style.shadowFill);\n if (tabs === 0) {\n this.context.fillText(lines[i], linePositionX, linePositionY);\n } else {\n this.renderTabLine(lines[i], linePositionX, linePositionY, true);\n }\n }\n }\n }\n this.updateTexture();\n this.dirty = false;\n }\n\n /**\n * Renders a tabbed line of text to the canvas.\n * @param {string} line - The line of text to render.\n * @param {number} x - The x position to start rendering from.\n * @param {number} y - The y position to start rendering from.\n * @param {boolean} fill - True to fill the text, false to stroke it.\n */\n renderTabLine(line, x, y, fill) {\n const text = line.split(/(?:\\t)/);\n const tabs = this.style.tabs;\n let snap = 0;\n if (Array.isArray(tabs)) {\n let tab = 0;\n for (let c = 0; c < text.length; c += 1) {\n if (c > 0) {\n tab += tabs[c - 1];\n }\n snap = x + tab;\n if (fill) {\n this.context.fillText(text[c], snap, y);\n } else {\n this.context.strokeText(text[c], snap, y);\n }\n }\n } else {\n for (let c = 0; c < text.length; c += 1) {\n const section = Math.ceil(this.context.measureText(text[c]).width);\n // How far to the next tab?\n snap = snapToCeil(x, tabs);\n if (fill) {\n this.context.fillText(text[c], snap, y);\n } else {\n this.context.strokeText(text[c], snap, y);\n }\n x = snap + section;\n }\n }\n }\n\n /**\n * Updates the shadow properties for this text.\n * @param {string} state - The shadow state to update ('stroke' or 'fill').\n */\n updateShadow(state) {\n if (state) {\n this.context.shadowOffsetX = this.style.shadowOffsetX;\n this.context.shadowOffsetY = this.style.shadowOffsetY;\n this.context.shadowColor = this.style.shadowColor;\n this.context.shadowBlur = this.style.shadowBlur;\n } else {\n this.context.shadowOffsetX = 0;\n this.context.shadowOffsetY = 0;\n this.context.shadowColor = 0;\n this.context.shadowBlur = 0;\n }\n }\n\n /**\n * Measures the width of a line of text.\n * @param {string} line - The line of text to measure.\n * @returns {number} The width of the line in pixels.\n */\n measureLine(line) {\n let lineLength = 0;\n for (let i = 0; i < line.length; i += 1) {\n const letter = line[i];\n if (this.fontWeights.length > 0 || this.fontStyles.length > 0) {\n const components = this.fontToComponents(this.context.font);\n if (this.fontStyles[this._charCount]) {\n components.fontStyle = this.fontStyles[this._charCount];\n }\n if (this.fontWeights[this._charCount]) {\n components.fontWeight = this.fontWeights[this._charCount];\n }\n this.context.font = this.componentsToFont(components);\n }\n if (this.style.stroke && this.style.strokeThickness) {\n if (this.strokeColors[this._charCount]) {\n this.context.strokeStyle = this.strokeColors[this._charCount];\n }\n this.updateShadow(this.style.shadowStroke);\n }\n if (this.style.fill) {\n if (this.colors[this._charCount]) {\n this.context.fillStyle = this.colors[this._charCount];\n }\n this.updateShadow(this.style.shadowFill);\n }\n lineLength += this.context.measureText(letter).width;\n this._charCount += 1;\n }\n return Math.ceil(lineLength);\n }\n\n /**\n * Updates a line of text to the canvas.\n * @param {string} line - The line of text to update.\n * @param {number} x - The x position to start updating from.\n * @param {number} y - The y position to start updating from.\n */\n updateLine(line, x, y) {\n for (let i = 0; i < line.length; i += 1) {\n const letter = line[i];\n if (this.fontWeights.length > 0 || this.fontStyles.length > 0) {\n const components = this.fontToComponents(this.context.font);\n if (this.fontStyles[this._charCount]) {\n components.fontStyle = this.fontStyles[this._charCount];\n }\n if (this.fontWeights[this._charCount]) {\n components.fontWeight = this.fontWeights[this._charCount];\n }\n this.context.font = this.componentsToFont(components);\n }\n if (this.style.stroke && this.style.strokeThickness) {\n if (this.strokeColors[this._charCount]) {\n this.context.strokeStyle = this.strokeColors[this._charCount];\n }\n this.updateShadow(this.style.shadowStroke);\n this.context.strokeText(letter, x, y);\n }\n if (this.style.fill) {\n if (this.colors[this._charCount]) {\n this.context.fillStyle = this.colors[this._charCount];\n }\n this.updateShadow(this.style.shadowFill);\n this.context.fillText(letter, x, y);\n }\n x += this.context.measureText(letter).width;\n this._charCount += 1;\n }\n }\n\n /**\n * Clears all color values from this text object.\n * @returns {Text} This Text object for chaining.\n */\n clearColors() {\n this.colors = [];\n this.strokeColors = [];\n this.dirty = true;\n return this;\n }\n\n /**\n * Clears all font style values from this text object.\n * @returns {Text} This Text object for chaining.\n */\n clearFontValues() {\n this.fontStyles = [];\n this.fontWeights = [];\n this.dirty = true;\n return this;\n }\n\n /**\n * Adds a color to this text object at the specified position.\n * @param {string} color - The color to apply.\n * @param {number} position - The character position to apply the color at.\n * @returns {Text} This Text object for chaining.\n */\n addColor(color, position) {\n this.colors[position] = color;\n this.dirty = true;\n return this;\n }\n\n /**\n * Adds a stroke color to this text object at the specified position.\n * @param {number} color - The stroke color to apply.\n * @param {number} position - The character position to apply the stroke color at.\n * @returns {Text} This Text object for chaining.\n */\n addStrokeColor(color, position) {\n this.strokeColors[position] = color;\n this.dirty = true;\n return this;\n }\n\n /**\n * Adds a font style to this text object at the specified position.\n * @param {object} style - The font style to apply.\n * @param {number} position - The character position to apply the font style at.\n * @returns {Text} This Text object for chaining.\n */\n addFontStyle(style, position) {\n this.fontStyles[position] = style;\n this.dirty = true;\n return this;\n }\n\n /**\n * Adds a font weight to this text object at the specified position.\n * @param {number} weight - The font weight to apply.\n * @param {number} position - The character position to apply the font weight at.\n * @returns {Text} This Text object for chaining.\n */\n addFontWeight(weight, position) {\n this.fontWeights[position] = weight;\n this.dirty = true;\n return this;\n }\n\n /**\n * Precalculates word wrap for the given text.\n * @param {string} text - The text to precalculate word wrap for.\n * @returns {string[]} The wrapped lines of text.\n */\n precalculateWordWrap(text) {\n this.texture.baseTexture.resolution = this._res;\n this.context.font = this.style.font;\n const wrappedLines = this.runWordWrap(text);\n return wrappedLines.split(/(?:\\r\\n|\\r|\\n)/);\n }\n\n /**\n * Runs word wrap on the given text.\n * @param {string} text - The text to run word wrap on.\n * @returns {string} The wrapped text.\n */\n runWordWrap(text) {\n if (this.useAdvancedWrap) {\n return this.advancedWordWrap(text);\n }\n return this.basicWordWrap(text);\n }\n\n /**\n * Runs advanced word wrap on the given text.\n * @param {string} text - The text to run advanced word wrap on.\n * @returns {string} The wrapped text.\n * @throws {Error} If the wordWrapWidth setting is less than a single character.\n */\n advancedWordWrap(text) {\n const context = this.context;\n const wordWrapWidth = this.style.wordWrapWidth;\n let output = '';\n // (1) condense whitespace\n // (2) split into lines\n const lines = text.replace(/ +/gi, ' ').split(/\\r?\\n/gi);\n let linesCount = lines.length;\n for (let i = 0; i < linesCount; i += 1) {\n let line = lines[i];\n let out = '';\n // trim whitespace\n line = line.replace(/^ *|\\s*$/gi, '');\n // if entire line is less than wordWrapWidth\n // append the entire line and exit early\n const lineWidth = context.measureText(line).width;\n if (lineWidth < wordWrapWidth) {\n output += `${line}\\n`;\n } else {\n // otherwise, calculate new lines\n let currentLineWidth = wordWrapWidth;\n // split into words\n const words = line.split(' ');\n for (let j = 0; j < words.length; j += 1) {\n const word = words[j];\n const wordWithSpace = `${word} `;\n let wordWidth = context.measureText(wordWithSpace).width;\n if (wordWidth > currentLineWidth) {\n // break word\n if (j === 0) {\n // shave off letters from word until it's small enough\n let newWord = wordWithSpace;\n while (newWord.length) {\n newWord = newWord.slice(0, -1);\n wordWidth = context.measureText(newWord).width;\n if (wordWidth <= currentLineWidth) {\n break;\n }\n }\n // if wordWrapWidth is too small for even a single\n // letter, shame user failure with a fatal error\n if (!newWord.length) {\n throw new Error(\"This text's wordWrapWidth setting is less than a single character!\");\n }\n // replace current word in array with remainder\n const secondPart = word.substr(newWord.length);\n words[j] = secondPart;\n // append first piece to output\n out += newWord;\n }\n // if existing word length is 0, don't include it\n const offset = words[j].length ? j : j + 1;\n // collapse rest of sentence\n // remove any trailing white space\n const remainder = words\n .slice(offset)\n .join(' ')\n .replace(/[ \\n]*$/gi, '');\n // prepend remainder to next line\n lines[i + 1] = `${remainder} ${lines[i + 1] || ''}`;\n linesCount = lines.length;\n break; // processing on this line\n // append word with space to output\n } else {\n out += wordWithSpace;\n currentLineWidth -= wordWidth;\n }\n }\n // append processed line to output\n output += `${out.replace(/[ \\n]*$/gi, '')}\\n`;\n }\n }\n // trim the end of the string\n output = output.replace(/[\\s|\\n]*$/gi, '');\n return output;\n }\n\n /**\n * Runs basic word wrap on the given text.\n * @param {string} text - The text to run basic word wrap on.\n * @returns {string} The wrapped text.\n */\n basicWordWrap(text) {\n let result = '';\n const lines = text.split('\\n');\n for (let i = 0; i < lines.length; i += 1) {\n let spaceLeft = this.style.wordWrapWidth;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j += 1) {\n const wordWidth = this.context.measureText(words[j]).width;\n const wordWidthWithSpace = wordWidth + this.context.measureText(' ').width;\n if (wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is greater than the word wrap width.\n if (j > 0) {\n result += '\\n';\n }\n result += `${words[j]} `;\n spaceLeft = this.style.wordWrapWidth - wordWidth;\n } else {\n spaceLeft -= wordWidthWithSpace;\n result += `${words[j]} `;\n }\n }\n if (i < lines.length - 1) {\n result += '\\n';\n }\n }\n return result;\n }\n\n /**\n * Updates the font properties based on the given components.\n * @param {object} components - The font components to update from.\n */\n updateFont(components) {\n const font = this.componentsToFont(components);\n if (this.style.font !== font) {\n this.style.font = font;\n this.dirty = true;\n if (this.parent) {\n this.updateTransform();\n }\n }\n }\n\n /**\n * Converts a font string to components.\n * @param {string} font - The font string to convert.\n * @returns {{ font: string, fontStyle?: string, fontVariant?: string, fontWeight?: string, fontSize?: string, fontFamily?: string }} The font components.\n */\n fontToComponents(font) {\n // The format is specified in http://www.w3.org/TR/CSS2/fonts.html#font-shorthand:\n // style - normal | italic | oblique | inherit\n // variant - normal | small-caps | inherit\n // weight - normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit\n // size - xx-small | x-small | small | medium | large | x-large | xx-large,\n // larger | smaller\n // {number} (em | ex | ch | rem | vh | vw | vmin | vmax | px | mm | cm | in | pt | pc | %)\n // font-family - rest (but identifiers or quoted with comma separation)\n const m = font.match(\n /^\\s*(?:\\b(normal|italic|oblique|inherit)?\\b)\\s*(?:\\b(normal|small-caps|inherit)?\\b)\\s*(?:\\b(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit)?\\b)\\s*(?:\\b(xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller|0|\\d*(?:[.]\\d*)?(?:%|[a-z]{2,5}))?\\b)\\s*(.*)\\s*$/\n );\n if (m) {\n let family = m[5].trim();\n // If it looks like the value should be quoted, but isn't, then quote it.\n if (!/^(?:inherit|serif|sans-serif|cursive|fantasy|monospace)$/.exec(family) && !/['\",]/.exec(family)) {\n family = `'${family}'`;\n }\n return {\n font,\n fontStyle: m[1] || 'normal',\n fontVariant: m[2] || 'normal',\n fontWeight: m[3] || 'normal',\n fontSize: m[4] || 'medium',\n fontFamily: family,\n };\n }\n this.game.logger.warn(`[Text] Error parsing CSS font: ${font}`);\n return { font };\n }\n\n /**\n * Converts font components to a font string.\n * @param {object} components - The font components to convert.\n * @returns {string} The font string.\n */\n componentsToFont(components) {\n const parts = [];\n let v;\n v = components.fontStyle;\n if (v && v !== 'normal') {\n parts.push(v);\n }\n v = components.fontVariant;\n if (v && v !== 'normal') {\n parts.push(v);\n }\n v = components.fontWeight;\n if (v && v !== 'normal') {\n parts.push(v);\n }\n v = components.fontSize;\n if (v && v !== 'medium') {\n parts.push(v);\n }\n v = components.fontFamily;\n if (v) {\n parts.push(v);\n }\n if (!parts.length) {\n // Fallback to whatever value the 'font' was\n parts.push(components.font);\n }\n return parts.join(' ');\n }\n\n /**\n * Sets the text content of this object.\n * @param {string} text - The new text to set.\n * @param {boolean} immediate - If true, updates the text immediately.\n * @returns {Text} This Text object for chaining.\n */\n setText(text, immediate = false) {\n this.text = text.toString() || '';\n if (immediate) {\n this.updateText();\n } else {\n this.dirty = true;\n }\n return this;\n }\n\n /**\n * Parses a list of text into this object.\n * @param {string[]|string[][]} list - The list of text to parse.\n * @returns {Text} This Text object for chaining.\n */\n parseList(list) {\n if (!Array.isArray(list)) {\n return this;\n }\n let s = '';\n for (let i = 0; i < list.length; i += 1) {\n if (Array.isArray(list[i])) {\n s += list[i].join('\\t');\n if (i < list.length - 1) {\n s += '\\n';\n }\n } else {\n s += list[i];\n if (i < list.length - 1) {\n s += '\\t';\n }\n }\n }\n this.text = s;\n this.dirty = true;\n return this;\n }\n\n /**\n * Sets the text bounds for this object.\n * @param {number} x - The x position of the bounds.\n * @param {number} y - The y position of the bounds.\n * @param {number} width - The width of the bounds.\n * @param {number} height - The height of the bounds.\n * @returns {Text} This Text object for chaining.\n */\n setTextBounds(x, y, width, height) {\n if (x === undefined) {\n this.textBounds = null;\n } else {\n if (!this.textBounds) {\n this.textBounds = new Rectangle(x, y, width, height);\n } else {\n this.textBounds.setTo(x, y, width, height);\n }\n if (this.style.wordWrapWidth > width) {\n this.style.wordWrapWidth = width;\n }\n }\n this.updateTexture();\n return this;\n }\n\n /**\n * Updates the texture of this object.\n */\n updateTexture() {\n const base = this.texture.baseTexture;\n const crop = this.texture.crop;\n const frame = this.texture.frame;\n const w = this.canvas.width;\n const h = this.canvas.height;\n base.width = w;\n base.height = h;\n crop.width = w;\n crop.height = h;\n frame.width = w;\n frame.height = h;\n this.texture.width = w;\n this.texture.height = h;\n this._width = w;\n this._height = h;\n if (this.textBounds) {\n let x = this.textBounds.x;\n let y = this.textBounds.y;\n // Align the canvas based on the bounds\n if (this.style.boundsAlignH === 'right') {\n x += this.textBounds.width - this.canvas.width / this.resolution;\n } else if (this.style.boundsAlignH === 'center') {\n x += this.textBounds.halfWidth - this.canvas.width / this.resolution / 2;\n }\n if (this.style.boundsAlignV === 'bottom') {\n y += this.textBounds.height - this.canvas.height / this.resolution;\n } else if (this.style.boundsAlignV === 'middle') {\n y += this.textBounds.halfHeight - this.canvas.height / this.resolution / 2;\n }\n this.pivot.x = -x;\n this.pivot.y = -y;\n }\n // Can't render something with a zero sized dimension\n this.renderable = w !== 0 && h !== 0;\n this.texture.requiresReTint = true;\n this.texture.baseTexture.dirty();\n }\n\n /**\n * Renders this text object using WebGL.\n * @param {object} renderSession - The render session to use.\n */\n renderWebGL(renderSession) {\n if (this.dirty) {\n this.updateText();\n this.dirty = false;\n }\n renderWebGL(this, renderSession);\n }\n\n /**\n * Renders this text object using Canvas.\n * @param {object} renderSession - The render session to use.\n */\n renderCanvas(renderSession) {\n if (this.dirty) {\n this.updateText();\n this.dirty = false;\n }\n renderCanvas(this, renderSession);\n }\n\n /**\n * Gets the font properties cache object.\n * @returns {{[key: string]: {ascent: number, descent: number, fontSize: number}}} The font properties cache.\n */\n getFontPropertiesCache() {\n if (!window.PhaserRegistry.fontPropertiesCache) {\n window.PhaserRegistry.fontPropertiesCache = {};\n }\n return window.PhaserRegistry.fontPropertiesCache;\n }\n\n /**\n * Gets the font properties canvas element.\n * @returns {HTMLCanvasElement} The font properties canvas element.\n */\n getFontPropertiesCanvas() {\n if (!window.PhaserRegistry.fontPropertiesCanvas) {\n window.PhaserRegistry.fontPropertiesCanvas = document.createElement('canvas');\n }\n return window.PhaserRegistry.fontPropertiesCanvas;\n }\n\n /**\n * Gets the font properties canvas context.\n * @returns {CanvasRenderingContext2D} The font properties canvas context.\n */\n getFontPropertiesContext() {\n if (!window.PhaserRegistry.fontPropertiesContext) {\n const canvas = this.getFontPropertiesCanvas();\n const context = canvas.getContext('2d', { willReadFrequently: true });\n window.PhaserRegistry.fontPropertiesContext = context;\n }\n return window.PhaserRegistry.fontPropertiesContext;\n }\n\n /**\n * Determines the font properties for a given font.\n * @param {string} font - The font to determine properties for.\n * @returns {object} The font properties.\n */\n determineFontProperties(font) {\n const fontPropertiesCache = this.getFontPropertiesCache();\n let properties = fontPropertiesCache[font];\n if (properties) {\n return properties;\n }\n const METRICS_STRING = '|ÉqÅ';\n const BASELINE_SYMBOL = 'M';\n /** @type {CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D} */\n const context = this.getFontPropertiesContext();\n context.font = font;\n const metrics = context.measureText(METRICS_STRING + BASELINE_SYMBOL);\n properties = {\n ascent: Math.ceil(metrics.actualBoundingBoxAscent),\n descent: Math.ceil(metrics.actualBoundingBoxDescent),\n fontSize: Math.ceil(metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent),\n };\n return properties;\n }\n\n /**\n * Determines font properties using a fallback method.\n * @param {string} fontStyle - The font style to determine properties for.\n * @returns {{ascent: number, descent: number, fontSize: number}} The font properties.\n */\n determineFontPropertiesFallback(fontStyle) {\n const fontPropertiesCache = this.getFontPropertiesCache();\n let properties = fontPropertiesCache[fontStyle];\n if (!properties) {\n properties = {};\n const canvas = this.getFontPropertiesCanvas();\n const context = this.getFontPropertiesContext();\n context.font = fontStyle;\n const width = Math.ceil(context.measureText('|MÉq').width);\n let baseline = Math.ceil(context.measureText('|MÉq').width);\n const height = 2 * baseline;\n baseline = (baseline * 1.4) | 0;\n canvas.width = width;\n canvas.height = height;\n context.fillStyle = '#f00';\n context.fillRect(0, 0, width, height);\n context.font = fontStyle;\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#000';\n context.fillText('|MÉq', 0, baseline);\n if (!context.getImageData(0, 0, width, height)) {\n properties.ascent = baseline;\n properties.descent = baseline + 6;\n properties.fontSize = properties.ascent + properties.descent;\n fontPropertiesCache[fontStyle] = properties;\n return properties;\n }\n const imagedata = context.getImageData(0, 0, width, height).data;\n const pixels = imagedata.length;\n const line = width * 4;\n let i;\n let j;\n let idx = 0;\n let stop = false;\n // ascent. scan from top to bottom until we find a non red pixel\n for (i = 0; i < baseline; i += 1) {\n for (j = 0; j < line; j += 4) {\n // firefox returns 253 for red pixel\n if (imagedata[idx + j] < 253) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx += line;\n } else {\n break;\n }\n }\n properties.ascent = baseline - i;\n idx = pixels - line;\n stop = false;\n // descent. scan from bottom to top until we find a non red pixel\n for (i = height; i > baseline; i -= 1) {\n for (j = 0; j < line; j += 4) {\n // firefox returns 253 for red pixel\n if (imagedata[idx + j] < 253) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx -= line;\n } else {\n break;\n }\n }\n properties.descent = i - baseline;\n // TODO might need a tweak. kind of a temp fix!\n properties.descent += 6;\n properties.fontSize = properties.ascent + properties.descent;\n fontPropertiesCache[fontStyle] = properties;\n }\n return properties;\n }\n\n /**\n * Gets the bounds of this text object.\n * @param {import('../geom/matrix.js').Matrix} matrix - The transformation matrix to use.\n * @returns {Rectangle} The bounds of this text object.\n */\n getBounds(matrix = null) {\n if (this.dirty) {\n this.updateText();\n this.dirty = false;\n }\n return getBounds(this, matrix);\n }\n\n /**\n * Gets the text content of this object.\n * @returns {string} The current text content.\n */\n get text() {\n return this._text;\n }\n\n /**\n * Sets the text content of this object.\n * @param {string | number | boolean | Date} value - The new text content to set.\n */\n set text(value) {\n if (value !== this._text) {\n this._text = value.toString() || '';\n this.dirty = true;\n if (this.parent) {\n this.updateTransform();\n }\n }\n }\n\n /**\n * Gets the CSS font string for this object.\n * @returns {string} The CSS font string.\n */\n get cssFont() {\n return this.componentsToFont(this._fontComponents);\n }\n\n /**\n * Sets the CSS font string for this object.\n * @param {string} value - The new CSS font string to set.\n */\n set cssFont(value) {\n this._fontComponents = this.fontToComponents(value || 'bold 20pt Arial');\n this.updateFont(this._fontComponents);\n }\n\n /**\n * Gets the font family of this object.\n * @returns {number} The font family.\n */\n get font() {\n return this._fontComponents.fontFamily;\n }\n\n /**\n * Sets the font family of this object.\n * @param {string} value - The new font family to set.\n */\n set font(value) {\n let mutatedValue = value || 'Arial';\n mutatedValue = mutatedValue.trim();\n // If it looks like the value should be quoted, but isn't, then quote it.\n if (!/^(?:inherit|serif|sans-serif|cursive|fantasy|monospace)$/.exec(mutatedValue) && !/['\",]/.exec(mutatedValue)) {\n mutatedValue = `'${mutatedValue}'`;\n }\n\n this._fontComponents.fontFamily = mutatedValue;\n this.updateFont(this._fontComponents);\n }\n\n /**\n * Gets the font size of this object.\n * @returns {number} The font size.\n */\n get fontSize() {\n const size = this._fontComponents.fontSize;\n if (size && /(?:^0$|px$)/.exec(size)) {\n return Number.parseInt(size, 10);\n }\n return size;\n }\n\n /**\n * Sets the font size of this object.\n * @param {number} value - The new font size to set.\n */\n set fontSize(value) {\n let mutatedValue = value || '0';\n if (typeof mutatedValue === 'number') {\n mutatedValue += 'px';\n }\n this._fontComponents.fontSize = mutatedValue;\n this.updateFont(this._fontComponents);\n }\n\n /**\n * Gets the font weight of this object.\n * @returns {string} The font weight.\n */\n get fontWeight() {\n return this._fontComponents.fontWeight || 'normal';\n }\n\n /**\n * Sets the font weight of this object.\n * @param {string} value - The new font weight to set.\n */\n set fontWeight(value) {\n this._fontComponents.fontWeight = value || 'normal';\n this.updateFont(this._fontComponents);\n }\n\n /**\n * Gets the font style of this object.\n * @returns {string} The font style.\n */\n get fontStyle() {\n return this._fontComponents.fontStyle || 'normal';\n }\n\n /**\n * Sets the font style of this object.\n * @param {string} value - The new font style to set.\n */\n set fontStyle(value) {\n this._fontComponents.fontStyle = value || 'normal';\n this.updateFont(this._fontComponents);\n }\n\n /**\n * Gets the font variant of this object.\n * @returns {string} The font variant.\n */\n get fontVariant() {\n return this._fontComponents.fontVariant || 'normal';\n }\n\n /**\n * Sets the font variant of this object.\n * @param {string} value - The new font variant to set.\n */\n set fontVariant(value) {\n this._fontComponents.fontVariant = value || 'normal';\n this.updateFont(this._fontComponents);\n }\n\n /**\n * Gets the fill color of this object.\n * @returns {number} The fill color.\n */\n get fill() {\n return this.style.fill;\n }\n\n /**\n * Sets the fill color of this object.\n * @param {string} value - The new fill color to set.\n */\n set fill(value) {\n if (value !== this.style.fill) {\n this.style.fill = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the alignment of this object.\n * @returns {string} The text alignment.\n */\n get align() {\n return this.style.align;\n }\n\n /**\n * Sets the alignment of this object.\n * @param {string} value - The new text alignment to set.\n */\n set align(value) {\n if (value !== this.style.align) {\n this.style.align = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the resolution of this object.\n * @returns {number} The resolution.\n */\n get resolution() {\n return this._res;\n }\n\n /**\n * Sets the resolution of this object.\n * @param {number} value - The new resolution to set.\n */\n set resolution(value) {\n if (value !== this._res) {\n this._res = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the tabs setting of this object.\n * @returns {number} The tabs setting.\n */\n get tabs() {\n return this.style.tabs;\n }\n\n /**\n * Sets the tabs setting of this object.\n * @param {number} value - The new tabs setting to set.\n */\n set tabs(value) {\n if (value !== this.style.tabs) {\n this.style.tabs = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the horizontal bounds alignment of this object.\n * @returns {number} The horizontal bounds alignment.\n */\n get boundsAlignH() {\n return this.style.boundsAlignH;\n }\n\n /**\n * Sets the horizontal bounds alignment of this object.\n * @param {number} value - The new horizontal bounds alignment to set.\n */\n set boundsAlignH(value) {\n if (value !== this.style.boundsAlignH) {\n this.style.boundsAlignH = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the vertical bounds alignment of this object.\n * @returns {number} The vertical bounds alignment.\n */\n get boundsAlignV() {\n return this.style.boundsAlignV;\n }\n\n /**\n * Sets the vertical bounds alignment of this object.\n * @param {number} value - The new vertical bounds alignment to set.\n */\n set boundsAlignV(value) {\n if (value !== this.style.boundsAlignV) {\n this.style.boundsAlignV = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the stroke color of this object.\n * @returns {number} The stroke color.\n */\n get stroke() {\n return this.style.stroke;\n }\n\n /**\n * Sets the stroke color of this object.\n * @param {string} value - The new stroke color to set.\n */\n set stroke(value) {\n if (value !== this.style.stroke) {\n this.style.stroke = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the stroke thickness of this object.\n * @returns {number} The stroke thickness.\n */\n get strokeThickness() {\n return this.style.strokeThickness;\n }\n\n /**\n * Sets the stroke thickness of this object.\n * @param {number} value - The new stroke thickness to set.\n */\n set strokeThickness(value) {\n if (value !== this.style.strokeThickness) {\n this.style.strokeThickness = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the word wrap setting of this object.\n * @returns {number} The word wrap setting.\n */\n get wordWrap() {\n return this.style.wordWrap;\n }\n\n /**\n * Sets the word wrap setting of this object.\n * @param {boolean} value - The new word wrap setting to set.\n */\n set wordWrap(value) {\n if (value !== this.style.wordWrap) {\n this.style.wordWrap = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the word wrap width of this object.\n * @returns {number} The word wrap width.\n */\n get wordWrapWidth() {\n return this.style.wordWrapWidth;\n }\n\n /**\n * Sets the word wrap width of this object.\n * @param {number} value - The new word wrap width to set.\n */\n set wordWrapWidth(value) {\n if (value !== this.style.wordWrapWidth) {\n this.style.wordWrapWidth = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the line spacing of this object.\n * @returns {number} The line spacing.\n */\n get lineSpacing() {\n return this._lineSpacing;\n }\n\n /**\n * Sets the line spacing of this object.\n * @param {number} value - The new line spacing to set.\n */\n set lineSpacing(value) {\n if (value !== this._lineSpacing) {\n this._lineSpacing = Number.parseFloat(value);\n this.dirty = true;\n if (this.parent) {\n this.updateTransform();\n }\n }\n }\n\n /**\n * Gets the shadow offset X of this object.\n * @returns {number} The shadow offset X.\n */\n get shadowOffsetX() {\n return this.style.shadowOffsetX;\n }\n\n /**\n * Sets the shadow offset X of this object.\n * @param {number} value - The new shadow offset X to set.\n */\n set shadowOffsetX(value) {\n if (value !== this.style.shadowOffsetX) {\n this.style.shadowOffsetX = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the shadow offset Y of this object.\n * @returns {number} The shadow offset Y.\n */\n get shadowOffsetY() {\n return this.style.shadowOffsetY;\n }\n\n /**\n * Sets the shadow offset Y of this object.\n * @param {number} value - The new shadow offset Y to set.\n */\n set shadowOffsetY(value) {\n if (value !== this.style.shadowOffsetY) {\n this.style.shadowOffsetY = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the shadow color of this object.\n * @returns {number} The shadow color.\n */\n get shadowColor() {\n return this.style.shadowColor;\n }\n\n /**\n * Sets the shadow color of this object.\n * @param {string} value - The new shadow color to set.\n */\n set shadowColor(value) {\n if (value !== this.style.shadowColor) {\n this.style.shadowColor = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the shadow blur of this object.\n * @returns {number} The shadow blur.\n */\n get shadowBlur() {\n return this.style.shadowBlur;\n }\n\n /**\n * Sets the shadow blur of this object.\n * @param {number} value - The new shadow blur to set.\n */\n set shadowBlur(value) {\n if (value !== this.style.shadowBlur) {\n this.style.shadowBlur = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the shadow stroke setting of this object.\n * @returns {number} The shadow stroke setting.\n */\n get shadowStroke() {\n return this.style.shadowStroke;\n }\n\n /**\n * Sets the shadow stroke setting of this object.\n * @param {boolean} value - The new shadow stroke setting to set.\n */\n set shadowStroke(value) {\n if (value !== this.style.shadowStroke) {\n this.style.shadowStroke = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the shadow fill setting of this object.\n * @returns {number} The shadow fill setting.\n */\n get shadowFill() {\n return this.style.shadowFill;\n }\n\n /**\n * Sets the shadow fill setting of this object.\n * @param {boolean} value - The new shadow fill setting to set.\n */\n set shadowFill(value) {\n if (value !== this.style.shadowFill) {\n this.style.shadowFill = value;\n this.dirty = true;\n }\n }\n\n /**\n * Gets the width of this object.\n * @returns {number} The width in pixels.\n */\n get width() {\n if (this.dirty) {\n this.updateText();\n this.dirty = false;\n }\n return this.scale.x * this.texture.frame.width;\n }\n\n /**\n * Sets the width of this object.\n * @param {number} value - The new width to set in pixels.\n */\n set width(value) {\n this.scale.x = value / this.texture.frame.width;\n this._width = value;\n }\n\n /**\n * Gets the height of this object.\n * @returns {number} The height in pixels.\n */\n get height() {\n if (this.dirty) {\n this.updateText();\n this.dirty = false;\n }\n return this.scale.y * this.texture.frame.height;\n }\n\n /**\n * Sets the height of this object.\n * @param {number} value - The new height to set in pixels.\n */\n set height(value) {\n this.scale.y = value / this.texture.frame.height;\n this._height = value;\n }\n}\n","// @ts-nocheck\nimport { BitmapText } from '../display/bitmap_text.js';\nimport { Button } from '../display/button.js';\nimport { Graphics } from '../display/graphics.js';\nimport { Group } from '../display/group.js';\nimport { Image } from '../display/image.js';\nimport { Text } from '../display/text.js';\n\nexport class GameObjectFactory {\n /**\n * Creates a new GameObjectFactory instance.\n * @param {import('./game.js').Game} game - The game instance this factory belongs to.\n */\n constructor(game) {\n this.game = game;\n }\n\n /**\n * Creates a new Image object.\n * @param {number} x - The x coordinate of the image.\n * @param {number} y - The y coordinate of the image.\n * @param {string} key - The texture key for the image.\n * @param {string|number} frame - The frame to display.\n * @param {Group} group - The parent group for the image.\n * @returns {Image} The created Image object.\n */\n image(x, y, key, frame, group = null) {\n if (!group) {\n group = this.game.world;\n }\n return group.add(new Image(this.game, x, y, key, frame));\n }\n\n /**\n * Creates a new Group object.\n * @param {Group | null} parent - The parent group for the new group.\n * @param {string | null} name - The name of the group.\n * @param {boolean} addToStage - Whether to add the group to the stage.\n * @returns {Group} The created Group object.\n */\n group(parent = null, name = null, addToStage = false) {\n return new Group(this.game, parent, name, addToStage);\n }\n\n /**\n * Creates a new Text object.\n * @param {number} x - The x coordinate of the text.\n * @param {number} y - The y coordinate of the text.\n * @param {string} text - The text content to display.\n * @param {object} style - The style configuration for the text.\n * @param {Group | null} group - The parent group for the text.\n * @returns {Text} The created Text object.\n */\n text(x, y, text, style, group = null) {\n const parent = group || this.game.world;\n return parent.add(new Text(this.game, x, y, text, style));\n }\n\n /**\n * Creates a new Button object.\n * @param {number} x - The x coordinate of the button.\n * @param {number} y - The y coordinate of the button.\n * @param {string} key - The texture key for the button.\n * @param {Function | null} callback - The function to call when the button is clicked.\n * @param {object | null} callbackContext - The context to apply when calling the callback.\n * @param {string | null} overFrame - The frame to display when the mouse is over the button.\n * @param {string | null} outFrame - The frame to display when the mouse is not over the button.\n * @param {string | null} downFrame - The frame to display when the button is pressed.\n * @param {string | null} upFrame - The frame to display when the button is released.\n * @param {Group | null} group - The parent group for the button.\n * @returns {Button} The created Button object.\n */\n button(\n x,\n y,\n key,\n callback = null,\n callbackContext = null,\n overFrame = null,\n outFrame = null,\n downFrame = null,\n upFrame = null,\n group = null\n ) {\n const parent = group || this.game.world;\n return parent.add(\n new Button(this.game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame)\n );\n }\n\n /**\n * Creates a new Graphics object.\n * @param {number} x - The x coordinate of the graphics object.\n * @param {number} y - The y coordinate of the graphics object.\n * @param {Group | null} group - The parent group for the graphics object.\n * @returns {Graphics} The created Graphics object.\n */\n graphics(x = 0, y = 0, group = null) {\n const parent = group || this.game.world;\n return parent.add(new Graphics(this.game, x, y));\n }\n\n /**\n * Creates a new BitmapText object.\n * @param {number} x - The x coordinate of the bitmap text.\n * @param {number} y - The y coordinate of the bitmap text.\n * @param {string} font - The font key for the bitmap text.\n * @param {string} text - The text content to display.\n * @param {number} size - The font size.\n * @param {Group | null} group - The parent group for the bitmap text.\n * @param {string} align - The alignment of the text.\n * @returns {BitmapText} The created BitmapText object.\n */\n bitmapText(x, y, font, text, size, group = null, align = 'left') {\n const parent = group || this.game.world;\n return parent.add(new BitmapText(this.game, x, y, font, text, size, align));\n }\n}\n","// @ts-nocheck\nimport { renderGraphicsMask } from './graphics.js';\n\n/**\n * Pushes a mask onto the rendering stack.\n * @param {object} maskData - The mask data to apply.\n * @param {object} renderSession - The rendering session object.\n */\nexport const pushMask = (maskData, renderSession) => {\n const context = renderSession.context;\n context.save();\n const cacheAlpha = maskData.alpha;\n const transform = maskData.worldTransform;\n const resolution = renderSession.resolution;\n context.setTransform(\n transform.a * resolution,\n transform.b * resolution,\n transform.c * resolution,\n transform.d * resolution,\n transform.tx * resolution,\n transform.ty * resolution\n );\n renderGraphicsMask(maskData, context);\n context.clip();\n maskData.worldAlpha = cacheAlpha;\n};\n\n/**\n * Pops a mask from the rendering stack.\n * @param {object} renderSession - The rendering session object.\n */\nexport const popMask = (renderSession) => {\n renderSession.context.restore();\n};\n","import { create as createCanvas } from './pool.js';\n\n/**\n * Creates a new HTML canvas element.\n * @param {object} parent - The parent element to append the canvas to.\n * @param {number} width - The width of the canvas.\n * @param {number} height - The height of the canvas.\n * @param {string} id - The ID to assign to the canvas.\n * @param {boolean} skipPool - Whether to skip using the canvas pool.\n * @returns {HTMLCanvasElement} The created HTML canvas element.\n */\nexport const create = (parent, width, height, id, skipPool) => {\n width = width || 256;\n height = height || 256;\n const canvas = skipPool ? document.createElement('canvas') : createCanvas(parent, width, height);\n if (typeof id === 'string' && id !== '') {\n canvas.id = id;\n }\n canvas.width = width;\n canvas.height = height;\n canvas.style.display = 'block';\n return canvas;\n};\n\n/**\n * Sets the background color of a canvas element.\n * @param {HTMLCanvasElement} canvas - The canvas element to modify.\n * @param {string} color - The background color to set.\n * @returns {HTMLCanvasElement} The modified canvas element.\n */\nexport const setBackgroundColor = (canvas, color) => {\n color = color || 'rgb(0,0,0)';\n canvas.style.backgroundColor = color;\n return canvas;\n};\n\n/**\n * Sets the touch action property of a canvas element.\n * @param {HTMLCanvasElement} canvas - The canvas element to modify.\n * @param {string} value - The touch action value to set.\n * @returns {HTMLCanvasElement} The modified canvas element.\n */\nexport const setTouchAction = (canvas, value = 'none') => {\n value = value || 'none';\n // @ts-ignore\n canvas.style.msTouchAction = value;\n canvas.style['ms-touch-action'] = value;\n canvas.style['touch-action'] = value;\n return canvas;\n};\n\n/**\n * Sets the user select property of a canvas element.\n * @param {HTMLCanvasElement} canvas - The canvas element to modify.\n * @param {string} value - The user select value to set.\n * @returns {HTMLCanvasElement} The modified canvas element.\n */\nexport const setUserSelect = (canvas, value = 'none') => {\n value = value || 'none';\n canvas.style['-webkit-touch-callout'] = value;\n canvas.style['-webkit-user-select'] = value;\n canvas.style['-khtml-user-select'] = value;\n canvas.style['-moz-user-select'] = value;\n canvas.style['-ms-user-select'] = value;\n canvas.style['user-select'] = value;\n canvas.style['-webkit-tap-highlight-color'] = 'rgba(0, 0, 0, 0)';\n return canvas;\n};\n\n/**\n * Adds a canvas element to the DOM.\n * @param {HTMLCanvasElement} canvas - The canvas element to add.\n * @param {object} parent - The parent element to append the canvas to.\n * @param {boolean} overflowHidden - Whether to set overflow hidden on the parent.\n * @returns {HTMLCanvasElement} The added canvas element.\n */\nexport const addToDOM = (canvas, parent, overflowHidden = true) => {\n let target;\n if (parent) {\n if (typeof parent === 'string') {\n // hopefully an element ID\n target = document.getElementById(parent);\n } else if (typeof parent === 'object' && parent.nodeType === 1) {\n // quick test for a HTMLelement\n target = parent;\n }\n }\n // Fallback, covers an invalid ID and a non HTMLelement object\n if (!target) {\n target = document.body;\n }\n if (overflowHidden && target.style) {\n target.style.overflow = 'hidden';\n }\n target.appendChild(canvas);\n return canvas;\n};\n\n/**\n * Removes a canvas element from the DOM.\n * @param {HTMLCanvasElement} canvas - The canvas element to remove.\n */\nexport const removeFromDOM = (canvas) => {\n if (canvas && canvas.parentNode) {\n canvas.parentNode.removeChild(canvas);\n }\n};\n\n/**\n * Sets the transformation matrix on a canvas rendering context.\n * @param {CanvasRenderingContext2D} context - The canvas rendering context.\n * @param {number} translateX - The X translation value.\n * @param {number} translateY - The Y translation value.\n * @param {number} scaleX - The X scale value.\n * @param {number} scaleY - The Y scale value.\n * @param {number} skewX - The X skew value.\n * @param {number} skewY - The Y skew value.\n * @returns {CanvasRenderingContext2D} The modified rendering context.\n */\nexport const setTransform = (context, translateX, translateY, scaleX, scaleY, skewX, skewY) => {\n context.setTransform(scaleX, skewX, skewY, scaleY, translateX, translateY);\n return context;\n};\n\n/**\n * Gets the smoothing prefix for a canvas rendering context.\n * @param {CanvasRenderingContext2D} context - The canvas rendering context.\n * @returns {string | null} The smoothing property name or null if not found.\n */\nexport const getSmoothingPrefix = (context) => {\n const VENDORS = ['i', 'webkitI', 'msI', 'mozI', 'oI'];\n for (let i = 0; i < VENDORS.length; i += 1) {\n const s = `${VENDORS[i]}mageSmoothingEnabled`;\n if (context && context[s]) {\n return s;\n }\n }\n return null;\n};\n\n/**\n * Sets the smoothing enabled property on a canvas rendering context.\n * @param {object} context - The canvas rendering context.\n * @param {number} value - The smoothing enabled value to set.\n * @returns {object} The modified rendering context.\n */\nexport const setSmoothingEnabled = (context, value) => {\n const s = getSmoothingPrefix(context);\n if (s) {\n context[s] = value;\n }\n return context;\n};\n","// @ts-nocheck\nimport {\n BLEND_ADD,\n BLEND_COLOR,\n BLEND_COLOR_BURN,\n BLEND_COLOR_DODGE,\n BLEND_DARKEN,\n BLEND_DIFFERENCE,\n BLEND_EXCLUSION,\n BLEND_HARD_LIGHT,\n BLEND_HUE,\n BLEND_LIGHTEN,\n BLEND_LUMINOSITY,\n BLEND_MULTIPLY,\n BLEND_NORMAL,\n BLEND_OVERLAY,\n BLEND_SATURATION,\n BLEND_SCREEN,\n BLEND_SOFT_LIGHT,\n RENDER_CANVAS,\n SCALE_LINEAR,\n SCALE_NEAREST,\n} from '../../core/const.js';\nimport { ENGINE_ERROR_CREATING_CANVAS_2D_CONTEXT } from '../../core/error_code.js';\nimport * as CanvasMaskManager from './masker.js';\nimport { detectCapabilities } from './tinter.js';\nimport { getSmoothingPrefix } from './util.js';\n\nexport class CanvasRenderer {\n /**\n * Creates a new CanvasRenderer instance.\n * @param {import('../../core/game.js').Game} game - The game instance.\n */\n constructor(game) {\n detectCapabilities(game);\n /** @type {number} */\n this.type = RENDER_CANVAS;\n this.resolution = game.config.resolution;\n this.clearBeforeRender = game.config.clearBeforeRender;\n this.transparent = game.config.transparent;\n this.autoResize = false;\n this.contextLost = false;\n this.width = game.width * this.resolution;\n this.height = game.height * this.resolution;\n this.view = game.canvas;\n /** @type {CanvasRenderingContext2D} */\n // @ts-ignore\n this.context = this.view.getContext('2d', { willReadFrequently: false, alpha: this.transparent });\n if (!this.context) {\n throw new Error(ENGINE_ERROR_CREATING_CANVAS_2D_CONTEXT);\n }\n this.refresh = true;\n this.count = 0;\n this.renderSession = {\n context: this.context,\n maskManager: CanvasMaskManager,\n scaleMode: game.config.antialias ? SCALE_LINEAR : SCALE_NEAREST,\n smoothProperty: getSmoothingPrefix(this.context),\n roundPixels: game.config.roundPixels,\n };\n this.mapBlendModes();\n this.resize(this.width, this.height);\n }\n\n /**\n * Renders the stage to canvas.\n * @param {import('../../core/stage.js').Stage} root - The root stage to render.\n */\n render(root) {\n if (!this.context) {\n return;\n }\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.globalAlpha = 1;\n this.renderSession.currentBlendMode = 0;\n this.renderSession.shakeX = 0;\n this.renderSession.shakeY = 0;\n this.context.globalCompositeOperation = 'source-over';\n if (this.clearBeforeRender) {\n if (this.transparent) {\n this.context.clearRect(0, 0, this.width, this.height);\n } else if (root._bgColor) {\n this.context.fillStyle = root._bgColor.rgba;\n this.context.fillRect(0, 0, this.width, this.height);\n }\n }\n this.renderDisplayObject(root);\n }\n\n /**\n * Destroys this renderer and cleans up resources.\n * @param {boolean} removeView - Whether to remove the view from the DOM.\n */\n destroy(removeView = true) {\n if (removeView && this.view.parent) {\n this.view.parent.removeChild(this.view);\n }\n this.view = null;\n this.context = null;\n this.renderSession = null;\n }\n\n /**\n * Resizes the canvas to the specified dimensions.\n * @param {number} width - The new width of the canvas.\n * @param {number} height - The new height of the canvas.\n */\n resize(width, height) {\n this.width = width * this.resolution;\n this.height = height * this.resolution;\n this.view.width = this.width;\n this.view.height = this.height;\n if (this.autoResize) {\n this.view.style.width = `${this.width / this.resolution}px`;\n this.view.style.height = `${this.height / this.resolution}px`;\n }\n if (this.renderSession.smoothProperty) {\n this.context[this.renderSession.smoothProperty] = this.renderSession.scaleMode === SCALE_LINEAR;\n }\n }\n\n /**\n * Renders a display object to canvas.\n * @param {import('../../display/image.js').Image} displayObject - The display object to render.\n * @param {CanvasRenderingContext2D} context - The canvas rendering context.\n * @param {import('../../geom/matrix.js').Matrix} matrix - The transformation matrix.\n */\n renderDisplayObject(displayObject, context, matrix) {\n this.renderSession.context = context || this.context;\n this.renderSession.resolution = this.resolution;\n displayObject.renderCanvas(this.renderSession, matrix);\n }\n\n /**\n * Maps blend modes to canvas rendering operations.\n */\n mapBlendModes() {\n if (window.PhaserRegistry.blendModesCanvas) {\n return;\n }\n const b = [];\n const useNew = window.PhaserRegistry.CAN_CANVAS_USE_MULTIPLY;\n b[BLEND_NORMAL] = 'source-over';\n b[BLEND_ADD] = 'lighter';\n b[BLEND_MULTIPLY] = useNew ? 'multiply' : 'source-over';\n b[BLEND_SCREEN] = useNew ? 'screen' : 'source-over';\n b[BLEND_OVERLAY] = useNew ? 'overlay' : 'source-over';\n b[BLEND_DARKEN] = useNew ? 'darken' : 'source-over';\n b[BLEND_LIGHTEN] = useNew ? 'lighten' : 'source-over';\n b[BLEND_COLOR_DODGE] = useNew ? 'color-dodge' : 'source-over';\n b[BLEND_COLOR_BURN] = useNew ? 'color-burn' : 'source-over';\n b[BLEND_HARD_LIGHT] = useNew ? 'hard-light' : 'source-over';\n b[BLEND_SOFT_LIGHT] = useNew ? 'soft-light' : 'source-over';\n b[BLEND_DIFFERENCE] = useNew ? 'difference' : 'source-over';\n b[BLEND_EXCLUSION] = useNew ? 'exclusion' : 'source-over';\n b[BLEND_HUE] = useNew ? 'hue' : 'source-over';\n b[BLEND_SATURATION] = useNew ? 'saturation' : 'source-over';\n b[BLEND_COLOR] = useNew ? 'color' : 'source-over';\n b[BLEND_LUMINOSITY] = useNew ? 'luminosity' : 'source-over';\n window.PhaserRegistry.blendModesCanvas = b;\n }\n\n /**\n * Initializes the WebGL context for rendering.\n * @param {import('../../core/game.js').Game} game - The game instance.\n */\n initContext(game) {\n // stub\n }\n}\n","// @ts-nocheck\nexport class WebGLBlendModeManager {\n /**\n * Creates a new BlendModeManager instance.\n */\n constructor() {\n this.gl = null;\n this.currentBlendMode = 99999;\n }\n\n /**\n * Initializes the blend mode manager with a WebGL context.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n */\n setContext(gl) {\n this.gl = gl;\n }\n\n /**\n * Sets the blend mode for the specified WebGL context.\n * @param {number} blendMode - The blend mode to set.\n * @returns {boolean} True if the blend mode was set successfully, false otherwise.\n */\n setBlendMode(blendMode) {\n if (this.currentBlendMode === blendMode) {\n return false;\n }\n this.currentBlendMode = blendMode;\n const blendModeWebGL = window.PhaserRegistry.blendModesWebGL[this.currentBlendMode];\n if (blendModeWebGL) {\n this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);\n }\n return true;\n }\n\n /**\n * Sets the blend mode for the WebGL context.\n */\n destroy() {\n this.gl = null;\n }\n}\n","// @ts-nocheck\nexport class WebGLFilterManager {\n /**\n * Creates a new FilterManager instance.\n */\n constructor() {\n this.filterStack = [];\n this.offsetX = 0;\n this.offsetY = 0;\n }\n\n /**\n * Initializes the filter manager with a WebGL context.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n */\n setContext(gl) {\n this.gl = gl;\n this.texturePool = [];\n this.initShaderBuffers();\n }\n\n /**\n * Applies a filter to the specified texture.\n */\n begin() {\n // TODO\n }\n\n /**\n * Updates the filter texture for the specified size.\n */\n pushFilter() {\n // TODO\n }\n\n /**\n * Resizes the filter manager to the specified dimensions.\n */\n popFilter() {\n // TODO\n }\n\n /**\n * Destroys this filter manager and cleans up resources.\n */\n applyFilterPass() {\n // TODO\n }\n\n /**\n * Initializes the filter manager.\n */\n initShaderBuffers() {\n // TODO\n }\n\n /**\n * Sets up the filter manager for WebGL rendering.\n */\n destroy() {\n // TODO\n }\n}\n","// @ts-nocheck\nimport { updateGraphics } from './graphics.js';\n\n/**\n * Sets up the mask manager for WebGL rendering.\n * @param {object} maskData - The mask data to apply.\n * @param {object} renderSession - The rendering session.\n */\nexport const pushMask = (maskData, renderSession) => {\n const gl = renderSession.gl;\n if (maskData.dirty) {\n updateGraphics(maskData, gl);\n }\n if (\n maskData._webGL[gl.id] === undefined ||\n maskData._webGL[gl.id].data === undefined ||\n maskData._webGL[gl.id].data.length === 0\n ) {\n return;\n }\n renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession);\n};\n\n/**\n * Sets up the mask manager for WebGL rendering.\n * @param {object} maskData - The mask data to apply.\n * @param {object} renderSession - The rendering session.\n */\nexport const popMask = (maskData, renderSession) => {\n const gl = renderSession.gl;\n if (\n maskData._webGL[gl.id] === undefined ||\n maskData._webGL[gl.id].data === undefined ||\n maskData._webGL[gl.id].data.length === 0\n ) {\n return;\n }\n renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession);\n};\n","// No error has been recorded. The value of this constant is 0.\nexport const NO_ERROR = 0;\n// An unacceptable value has been specified for an enumerated argument. The command is ignored and the error flag is set.\nexport const INVALID_ENUM = 0x0500;\n// A numeric argument is out of range. The command is ignored and the error flag is set.\nexport const INVALID_VALUE = 0x0501;\n// The specified command is not allowed for the current state. The command is ignored and the error flag is set.\nexport const INVALID_OPERATION = 0x0502;\n// The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.\nexport const INVALID_FRAMEBUFFER_OPERATION = 0x0506;\n// Not enough memory is left to execute the command.\nexport const OUT_OF_MEMORY = 0x0505;\n// If the WebGL context is lost, this error is returned on the first call to getError. Afterwards and until the context has been restored, it returns gl.NO_ERROR.\nexport const CONTEXT_LOST_WEBGL = 0x9242;\n\n/**\n * Gets the WebGL context error code.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n * @returns {number} The error code from the WebGL context.\n */\nexport const getWebGLContextErrorCode = (gl) => {\n return gl?.getError() ?? 0;\n};\n\n/**\n * Gets the WebGL context error name from an error code.\n * @param {number} errorCode - The error code to look up.\n * @returns {string} The name of the WebGL error.\n */\nexport const getWebGLContextErrorName = (errorCode) => {\n switch (errorCode) {\n case NO_ERROR:\n return 'NO_ERROR';\n case INVALID_ENUM:\n return 'INVALID_ENUM';\n case INVALID_VALUE:\n return 'INVALID_VALUE';\n case INVALID_OPERATION:\n return 'INVALID_OPERATION';\n case INVALID_FRAMEBUFFER_OPERATION:\n return 'INVALID_FRAMEBUFFER_OPERATION';\n case OUT_OF_MEMORY:\n return 'OUT_OF_MEMORY';\n case CONTEXT_LOST_WEBGL:\n return 'CONTEXT_LOST_WEBGL';\n default:\n return `UNKNOWN_ERROR_${errorCode}`;\n }\n};\n\n/**\n * Initializes default shaders.\n */\nexport const initDefaultShaders = () => {};\n\n/**\n * Compiles a WebGL shader.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n * @param {string[]|string} shaderSrc - The shader source code.\n * @param {object} shaderType - The type of shader to compile.\n * @returns {WebGLShader} The compiled WebGL shader or null if compilation failed.\n */\nexport const compileShader = (gl, shaderSrc, shaderType) => {\n const src = Array.isArray(shaderSrc) ? shaderSrc.join('\\n') : shaderSrc;\n const shader = gl.createShader(shaderType);\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n if (!window.PhaserRegistry) {\n window.PhaserRegistry = {};\n }\n window.PhaserRegistry.GL_SHADER_INFO_LOG = gl.getShaderInfoLog(shader);\n return null;\n }\n return shader;\n};\n\n/**\n * Compiles a WebGL vertex shader.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n * @param {string[]|string} shaderSrc - The vertex shader source code.\n * @returns {WebGLShader} The compiled WebGL vertex shader or null if compilation failed.\n */\nexport const compileVertexShader = (gl, shaderSrc) => {\n return compileShader(gl, shaderSrc, gl.VERTEX_SHADER);\n};\n\n/**\n * Compiles a WebGL fragment shader.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n * @param {string[]|string} shaderSrc - The fragment shader source code.\n * @returns {WebGLShader} The compiled WebGL fragment shader or null if compilation failed.\n */\nexport const compileFragmentShader = (gl, shaderSrc) => {\n return compileShader(gl, shaderSrc, gl.FRAGMENT_SHADER);\n};\n\n/**\n * Compiles a WebGL shader program.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n * @param {string[]|string} vertexSrc - The vertex shader source code.\n * @param {string[]|string} fragmentSrc - The fragment shader source code.\n * @returns {WebGLProgram} The compiled WebGL shader program or null if compilation failed.\n */\nexport const compileProgram = (gl, vertexSrc, fragmentSrc) => {\n const fragmentShader = compileFragmentShader(gl, fragmentSrc);\n const vertexShader = compileVertexShader(gl, vertexSrc);\n\n const shaderProgram = gl.createProgram();\n\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n if (!window.PhaserRegistry) {\n window.PhaserRegistry = {};\n }\n window.PhaserRegistry.GL_PROGRAM_INFO_LOG = gl.getProgramInfoLog(shaderProgram);\n }\n return shaderProgram;\n};\n","// @ts-nocheck\nimport { v4 as uuidv4 } from 'uuid';\nimport { compileProgram } from '../util.js';\n\n// the next one is used for rendering triangle strips\n\nexport class ComplexPrimitiveShader {\n /**\n * Creates a new ComplexShader instance.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n */\n constructor(gl) {\n this.gl = gl;\n this._UID = uuidv4();\n /** @type {WebGLProgram} */\n this.program = null;\n this.fragmentSrc = [\n 'precision mediump float;',\n 'varying vec4 vColor;',\n 'void main(void) {',\n ' gl_FragColor = vColor;',\n '}',\n ];\n this.vertexSrc = [\n 'attribute vec2 aVertexPosition;',\n // 'attribute vec4 aColor;',\n 'uniform mat3 translationMatrix;',\n 'uniform vec2 projectionVector;',\n 'uniform vec2 offsetVector;',\n\n 'uniform vec3 tint;',\n 'uniform float alpha;',\n 'uniform vec3 color;',\n 'uniform float flipY;',\n 'varying vec4 vColor;',\n\n 'void main(void) {',\n ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',\n ' v -= offsetVector.xyx;',\n ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);',\n ' vColor = vec4(color * alpha * tint, alpha);', // \" * vec4(tint * alpha, alpha);',\n '}',\n ];\n this.init();\n }\n\n /**\n * Destroys this shader and cleans up resources.\n */\n init() {\n const gl = this.gl;\n const program = compileProgram(gl, this.vertexSrc, this.fragmentSrc);\n gl.useProgram(program);\n // get and store the uniforms for the shader\n this.projectionVector = gl.getUniformLocation(program, 'projectionVector');\n this.offsetVector = gl.getUniformLocation(program, 'offsetVector');\n this.tintColor = gl.getUniformLocation(program, 'tint');\n this.color = gl.getUniformLocation(program, 'color');\n this.flipY = gl.getUniformLocation(program, 'flipY');\n // get and store the attributes\n this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');\n // this.colorAttribute = gl.getAttribLocation(program, 'aColor');\n this.attributes = [this.aVertexPosition, this.colorAttribute];\n this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');\n this.alpha = gl.getUniformLocation(program, 'alpha');\n this.program = program;\n }\n\n /**\n * Binds this shader to the WebGL context.\n */\n destroy() {\n this.gl.deleteProgram(this.program);\n this.uniforms = null;\n this.gl = null;\n this.attribute = null;\n }\n}\n","// @ts-nocheck\nimport { v4 as uuidv4 } from 'uuid';\nimport { compileProgram } from '../util.js';\n\n// this shader is used for the fast sprite rendering\n\nexport class FastShader {\n /**\n * Creates a new FastShader instance.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n */\n constructor(gl) {\n this.gl = gl;\n this._UID = uuidv4();\n /** @type {WebGLProgram} */\n this.program = null;\n this.textureCount = 0;\n this.fragmentSrc = [\n 'precision lowp float;',\n 'varying vec2 vTextureCoord;',\n 'varying float vColor;',\n 'uniform sampler2D uSampler;',\n 'void main(void) {',\n ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',\n '}',\n ];\n this.vertexSrc = [\n 'attribute vec2 aVertexPosition;',\n 'attribute vec2 aPositionCoord;',\n 'attribute vec2 aScale;',\n 'attribute float aRotation;',\n 'attribute vec2 aTextureCoord;',\n 'attribute float aColor;',\n\n 'uniform vec2 projectionVector;',\n 'uniform vec2 offsetVector;',\n 'uniform mat3 uMatrix;',\n\n 'varying vec2 vTextureCoord;',\n 'varying float vColor;',\n\n 'const vec2 center = vec2(-1.0, 1.0);',\n\n 'void main(void) {',\n ' vec2 v;',\n ' vec2 sv = aVertexPosition * aScale;',\n ' v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);',\n ' v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);',\n ' v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;',\n ' gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);',\n ' vTextureCoord = aTextureCoord;',\n // ' vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;',\n ' vColor = aColor;',\n '}',\n ];\n this.init();\n }\n\n /**\n * Creates a new FastShader instance.\n */\n init() {\n const gl = this.gl;\n const program = compileProgram(gl, this.vertexSrc, this.fragmentSrc);\n gl.useProgram(program);\n // get and store the uniforms for the shader\n this.uSampler = gl.getUniformLocation(program, 'uSampler');\n this.projectionVector = gl.getUniformLocation(program, 'projectionVector');\n this.offsetVector = gl.getUniformLocation(program, 'offsetVector');\n this.dimensions = gl.getUniformLocation(program, 'dimensions');\n this.uMatrix = gl.getUniformLocation(program, 'uMatrix');\n // get and store the attributes\n this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');\n this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord');\n this.aScale = gl.getAttribLocation(program, 'aScale');\n this.aRotation = gl.getAttribLocation(program, 'aRotation');\n this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');\n this.colorAttribute = gl.getAttribLocation(program, 'aColor');\n // Begin worst hack eva //\n // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?\n // maybe its somthing to do with the current state of the gl context.\n // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel\n // If theres any webGL people that know why could happen please help :)\n if (this.colorAttribute === -1) {\n this.colorAttribute = 2;\n }\n this.attributes = [\n this.aVertexPosition,\n this.aPositionCoord,\n this.aScale,\n this.aRotation,\n this.aTextureCoord,\n this.colorAttribute,\n ];\n // End worst hack eva //\n this.program = program;\n }\n\n /**\n * Destroys this shader and cleans up resources.\n */\n destroy() {\n this.gl.deleteProgram(this.program);\n this.uniforms = null;\n this.gl = null;\n this.attributes = null;\n }\n}\n","// @ts-nocheck\nimport { v4 as uuidv4 } from 'uuid';\nimport { compileProgram } from '../util.js';\n\nconst defaultVertexSrc = [\n 'attribute vec2 aVertexPosition;',\n 'attribute vec2 aTextureCoord;',\n 'attribute vec4 aColor;',\n\n 'uniform vec2 projectionVector;',\n 'uniform vec2 offsetVector;',\n\n 'varying vec2 vTextureCoord;',\n 'varying vec4 vColor;',\n\n 'const vec2 center = vec2(-1.0, 1.0);',\n\n 'void main(void) {',\n ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);',\n ' vTextureCoord = aTextureCoord;',\n ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);',\n '}',\n];\n\n// this shader is used for the default sprite rendering\n\nexport class NormalShader {\n /**\n * Creates a new NormalShader instance.\n * @param {WebGLRenderingContext & { id: number }} gl - The WebGL rendering context.\n */\n constructor(gl) {\n this.gl = gl;\n this._UID = uuidv4();\n /** @type {WebGLProgram} */\n this.program = null;\n this.fragmentSrc = [\n 'precision lowp float;',\n 'varying vec2 vTextureCoord;',\n 'varying vec4 vColor;',\n 'uniform sampler2D uSampler;',\n 'void main(void) {',\n ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',\n '}',\n ];\n /** @type {string[]} */\n this.vertexSrc = null;\n this.textureCount = 0;\n this.firstRun = true;\n this.dirty = true;\n this.uniforms = {};\n this.attributes = [];\n this.init();\n }\n\n /**\n * Destroys this shader and cleans up resources.\n */\n init() {\n const gl = this.gl;\n const program = compileProgram(gl, this.vertexSrc || defaultVertexSrc, this.fragmentSrc);\n gl.useProgram(program);\n // get and store the uniforms for the shader\n this.uSampler = gl.getUniformLocation(program, 'uSampler');\n this.projectionVector = gl.getUniformLocation(program, 'projectionVector');\n this.offsetVector = gl.getUniformLocation(program, 'offsetVector');\n this.dimensions = gl.getUniformLocation(program, 'dimensions');\n // get and store the attributes\n this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');\n this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');\n this.colorAttribute = gl.getAttribLocation(program, 'aColor');\n // Begin worst hack eva //\n // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?\n // maybe its something to do with the current state of the gl context.\n // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel\n // If theres any webGL people that know why could happen please help :)\n if (this.colorAttribute === -1) {\n this.colorAttribute = 2;\n }\n this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];\n // End worst hack eva //\n // add those custom shaders!\n const keys = Object.keys(this.uniforms);\n for (let i = 0; i < keys.length; i += 1) {\n // get the uniform locations..\n this.uniforms[keys[i]].uniformLocation = gl.getUniformLocation(program, keys[i]);\n }\n this.initUniforms();\n this.program = program;\n }\n\n /**\n * Binds this shader to the WebGL context.\n */\n initUniforms() {\n this.textureCount = 1;\n const gl = this.gl;\n let uniform;\n const keys = Object.keys(this.uniforms);\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i];\n uniform = this.uniforms[key];\n const type = uniform.type;\n if (type === 'sampler2D') {\n uniform._init = false;\n if (uniform.value !== null) {\n this.initSampler2D(uniform);\n }\n } else if (type === 'mat2' || type === 'mat3' || type === 'mat4') {\n // These require special handling\n uniform.glMatrix = true;\n uniform.glValueLength = 1;\n if (type === 'mat2') {\n uniform.glFunc = gl.uniformMatrix2fv;\n } else if (type === 'mat3') {\n uniform.glFunc = gl.uniformMatrix3fv;\n } else if (type === 'mat4') {\n uniform.glFunc = gl.uniformMatrix4fv;\n }\n } else {\n // GL function reference\n uniform.glFunc = gl[`uniform${type}`];\n if (type === '2f' || type === '2i') {\n uniform.glValueLength = 2;\n } else if (type === '3f' || type === '3i') {\n uniform.glValueLength = 3;\n } else if (type === '4f' || type === '4i') {\n uniform.glValueLength = 4;\n } else {\n uniform.glValueLength = 1;\n }\n }\n }\n }\n\n /**\n * Sets a uniform value for this shader.\n * @param {object} uniform - The uniform to set.\n */\n initSampler2D(uniform) {\n if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded) {\n return;\n }\n const gl = this.gl;\n gl.activeTexture(gl[`TEXTURE${this.textureCount}`]);\n gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]);\n // Extended texture data\n if (uniform.textureData) {\n const data = uniform.textureData;\n // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D);\n // GLTextureLinear = mag/min linear, wrap clamp\n // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat\n // GLTextureNearest = mag/min nearest, wrap clamp\n // AudioTexture = whatever + luminance + width 512, height 2, border 0\n // KeyTexture = whatever + luminance + width 256, height 2, border 0\n // magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST\n // wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT\n const magFilter = data.magFilter ? data.magFilter : gl.LINEAR;\n const minFilter = data.minFilter ? data.minFilter : gl.LINEAR;\n let wrapS = data.wrapS ? data.wrapS : gl.CLAMP_TO_EDGE;\n let wrapT = data.wrapT ? data.wrapT : gl.CLAMP_TO_EDGE;\n const format = data.luminance ? gl.LUMINANCE : gl.RGBA;\n if (data.repeat) {\n wrapS = gl.REPEAT;\n wrapT = gl.REPEAT;\n }\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY);\n if (data.width) {\n const width = data.width ? data.width : 512;\n const height = data.height ? data.height : 2;\n const border = data.border ? data.border : 0;\n\n // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels);\n gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null);\n } else {\n // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels);\n gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source);\n }\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT);\n }\n gl.uniform1i(uniform.uniformLocation, this.textureCount);\n uniform._init = true;\n this.textureCount += 1;\n }\n\n /**\n * Sets the shader to use for rendering.\n */\n syncUniforms() {\n this.textureCount = 1;\n let uniform;\n const gl = this.gl;\n // This would probably be faster in an array and it would guarantee key order\n const keys = Object.keys(this.uniforms);\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i];\n uniform = this.uniforms[key];\n if (uniform.glValueLength === 1) {\n if (uniform.glMatrix === true) {\n uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value);\n } else {\n uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value);\n }\n } else if (uniform.glValueLength === 2) {\n uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y);\n } else if (uniform.glValueLength === 3) {\n uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z);\n } else if (uniform.glValueLength === 4) {\n uniform.glFunc.call(\n gl,\n uniform.uniformLocation,\n uniform.value.x,\n uniform.value.y,\n uniform.value.z,\n uniform.value.w\n );\n } else if (uniform.type === 'sampler2D') {\n if (uniform._init) {\n gl.activeTexture(gl[`TEXTURE${this.textureCount}`]);\n if (uniform.value.baseTexture._dirty[gl.id]) {\n window.PhaserRegistry.INSTANCES[gl.id].updateTexture(uniform.value.baseTexture);\n } else {\n // bind the current texture\n gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]);\n }\n // gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl));\n gl.uniform1i(uniform.uniformLocation, this.textureCount);\n this.textureCount += 1;\n } else {\n this.initSampler2D(uniform);\n }\n }\n }\n }\n\n /**\n * Destroys this shader and cleans up resources.\n */\n destroy() {\n this.gl.deleteProgram(this.program);\n this.uniforms = null;\n this.gl = null;\n this.attributes = null;\n }\n}\n","// @ts-nocheck\nimport { v4 as uuidv4 } from 'uuid';\nimport { compileProgram } from '../util.js';\n\n// the next one is used for rendering primitives\n\nexport class PrimitiveShader {\n /**\n * Creates a new PrimitiveShader instance.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n */\n constructor(gl) {\n this.gl = gl;\n this._UID = uuidv4();\n /** @type {WebGLProgram} */\n this.program = null;\n this.fragmentSrc = [\n 'precision mediump float;',\n 'varying vec4 vColor;',\n\n 'void main(void) {',\n ' gl_FragColor = vColor;',\n '}',\n ];\n this.vertexSrc = [\n 'attribute vec2 aVertexPosition;',\n 'attribute vec4 aColor;',\n 'uniform mat3 translationMatrix;',\n 'uniform vec2 projectionVector;',\n 'uniform vec2 offsetVector;',\n 'uniform float alpha;',\n 'uniform float flipY;',\n 'uniform vec3 tint;',\n 'varying vec4 vColor;',\n\n 'void main(void) {',\n ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',\n ' v -= offsetVector.xyx;',\n ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);',\n ' vColor = aColor * vec4(tint * alpha, alpha);',\n '}',\n ];\n this.init();\n }\n\n /**\n * Destroys this shader and cleans up resources.\n */\n init() {\n const gl = this.gl;\n const program = compileProgram(gl, this.vertexSrc, this.fragmentSrc);\n gl.useProgram(program);\n // get and store the uniforms for the shader\n this.projectionVector = gl.getUniformLocation(program, 'projectionVector');\n this.offsetVector = gl.getUniformLocation(program, 'offsetVector');\n this.tintColor = gl.getUniformLocation(program, 'tint');\n this.flipY = gl.getUniformLocation(program, 'flipY');\n // get and store the attributes\n this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');\n this.colorAttribute = gl.getAttribLocation(program, 'aColor');\n this.attributes = [this.aVertexPosition, this.colorAttribute];\n this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');\n this.alpha = gl.getUniformLocation(program, 'alpha');\n this.program = program;\n }\n\n /**\n * Binds this shader to the WebGL context.\n */\n destroy() {\n this.gl.deleteProgram(this.program);\n this.uniforms = null;\n this.gl = null;\n this.attributes = null;\n }\n}\n","// @ts-nocheck\nimport { v4 as uuidv4 } from 'uuid';\nimport { compileProgram } from '../util.js';\n\n// the next one is used for rendering triangle strips\n\nexport class StripShader {\n /**\n * Creates a new StripShader instance.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n */\n constructor(gl) {\n this.gl = gl;\n this._UID = uuidv4();\n /** @type {WebGLProgram} */\n this.program = null;\n this.fragmentSrc = [\n 'precision mediump float;',\n 'varying vec2 vTextureCoord;',\n // 'varying float vColor;',\n 'uniform float alpha;',\n 'uniform sampler2D uSampler;',\n 'void main(void) {',\n ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;',\n // ' gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;',\n '}',\n ];\n this.vertexSrc = [\n 'attribute vec2 aVertexPosition;',\n 'attribute vec2 aTextureCoord;',\n 'uniform mat3 translationMatrix;',\n 'uniform vec2 projectionVector;',\n 'uniform vec2 offsetVector;',\n // 'uniform float alpha;',\n // 'uniform vec3 tint;',\n 'varying vec2 vTextureCoord;',\n // 'varying vec4 vColor;',\n 'void main(void) {',\n ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',\n ' v -= offsetVector.xyx;',\n ' gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',\n ' vTextureCoord = aTextureCoord;',\n // ' vColor = aColor * vec4(tint * alpha, alpha);',\n '}',\n ];\n\n this.init();\n }\n\n /**\n * Destroys this shader and cleans up resources.\n */\n init() {\n const gl = this.gl;\n const program = compileProgram(gl, this.vertexSrc, this.fragmentSrc);\n gl.useProgram(program);\n // get and store the uniforms for the shader\n this.uSampler = gl.getUniformLocation(program, 'uSampler');\n this.projectionVector = gl.getUniformLocation(program, 'projectionVector');\n this.offsetVector = gl.getUniformLocation(program, 'offsetVector');\n this.colorAttribute = gl.getAttribLocation(program, 'aColor');\n // this.dimensions = gl.getUniformLocation(this.program, 'dimensions');\n // get and store the attributes\n this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');\n this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');\n this.attributes = [this.aVertexPosition, this.aTextureCoord];\n this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');\n this.alpha = gl.getUniformLocation(program, 'alpha');\n this.program = program;\n }\n\n /**\n * Binds this shader to the WebGL context.\n */\n destroy() {\n this.gl.deleteProgram(this.program);\n this.uniforms = null;\n this.gl = null;\n this.attribute = null;\n }\n}\n","// @ts-nocheck\nimport { ComplexPrimitiveShader } from './shader/complex.js';\nimport { FastShader } from './shader/fast.js';\nimport { NormalShader } from './shader/normal.js';\nimport { PrimitiveShader } from './shader/primitive.js';\nimport { StripShader } from './shader/strip.js';\n\nexport class WebGLShaderManager {\n /**\n * Initializes the shader manager with a WebGL context.\n */\n constructor() {\n this.gl = null;\n this.primitiveShader = null;\n this.complexPrimitiveShader = null;\n this.defaultShader = null;\n this.fastShader = null;\n this.stripShader = null;\n this.maxAttibs = 10;\n this.attribState = [];\n this.tempAttribState = [];\n for (let i = 0; i < this.maxAttibs; i += 1) {\n this.attribState[i] = false;\n }\n this.stack = [];\n }\n\n /**\n * Initializes the shader manager with a WebGL context.\n * @param {WebGLRenderingContext & { id: number }} gl - The WebGL rendering context.\n */\n setContext(gl) {\n this.gl = gl;\n this.primitiveShader = new PrimitiveShader(gl);\n this.complexPrimitiveShader = new ComplexPrimitiveShader(gl);\n this.defaultShader = new NormalShader(gl);\n this.fastShader = new FastShader(gl);\n this.stripShader = new StripShader(gl);\n this.setShader(this.defaultShader);\n }\n\n /**\n * Sets up the shader manager for WebGL rendering.\n * @param {number[]} attribs - The attribute locations to set up.\n */\n setAttribs(attribs) {\n // reset temp state\n let i;\n for (i = 0; i < this.tempAttribState.length; i += 1) {\n this.tempAttribState[i] = false;\n }\n // set the new attribs\n for (i = 0; i < attribs.length; i += 1) {\n const attribId = attribs[i];\n this.tempAttribState[attribId] = true;\n }\n const gl = this.gl;\n for (i = 0; i < this.attribState.length; i += 1) {\n if (this.attribState[i] !== this.tempAttribState[i]) {\n this.attribState[i] = this.tempAttribState[i];\n if (this.tempAttribState[i]) {\n gl.enableVertexAttribArray(i);\n } else {\n gl.disableVertexAttribArray(i);\n }\n }\n }\n }\n\n /**\n * Sets up the shader manager for WebGL rendering.\n * @param {NormalShader} shader - The shader to set up.\n * @returns {boolean} Whether the shader setup was successful.\n */\n setShader(shader) {\n if (this._currentId === shader._UID) {\n return false;\n }\n this._currentId = shader._UID;\n this.currentShader = shader;\n this.gl.useProgram(shader.program);\n this.setAttribs(shader.attributes);\n return true;\n }\n\n /**\n * Destroys the manager.\n */\n destroy() {\n this.attribState = null;\n this.tempAttribState = null;\n this.currentShader = null;\n this._currentId = null;\n this.primitiveShader.destroy();\n this.complexPrimitiveShader.destroy();\n this.defaultShader.destroy();\n this.fastShader.destroy();\n this.stripShader.destroy();\n this.gl = null;\n }\n}\n","// @ts-nocheck\nexport class AbstractFilter {\n /**\n * Creates a new AbstractFilter instance.\n * @param {string[]} fragmentSrc - The fragment shader source.\n * @param {object} uniforms - The uniform variables for the shader.\n */\n constructor(fragmentSrc, uniforms) {\n this.passes = [this];\n this.shaders = [];\n this.dirty = true;\n this.padding = 0;\n this.uniforms = uniforms || {};\n this.fragmentSrc = fragmentSrc || [];\n }\n\n /**\n * Initializes the filter.\n */\n syncUniforms() {\n for (let i = 0, j = this.shaders.length; i < j; i += 1) {\n this.shaders[i].dirty = true;\n }\n }\n}\n","// @ts-nocheck\nimport { AbstractFilter } from './abstract_filter.js';\nimport { NormalShader } from './shader/normal.js';\n\nexport class WebGLSpriteBatch {\n /**\n * Creates a new SpriteBatch instance.\n */\n constructor() {\n this.vertSize = 5;\n this.size = 2000; // Math.pow(2, 16) / this.vertSize;\n // the total number of bytes in our batch\n const numVerts = this.size * 4 * 4 * this.vertSize;\n // the total number of indices in our batch\n const numIndices = this.size * 6;\n this.vertices = new ArrayBuffer(numVerts);\n this.positions = new Float32Array(this.vertices);\n this.colors = new Uint32Array(this.vertices);\n this.indices = new Uint16Array(numIndices);\n this.lastIndexCount = 0;\n for (let i = 0, j = 0; i < numIndices; i += 6, j += 4) {\n this.indices[i + 0] = j + 0;\n this.indices[i + 1] = j + 1;\n this.indices[i + 2] = j + 2;\n this.indices[i + 3] = j + 0;\n this.indices[i + 4] = j + 2;\n this.indices[i + 5] = j + 3;\n }\n this.drawing = false;\n this.currentBatchSize = 0;\n this.currentBaseTexture = null;\n this.dirty = true;\n this.textures = [];\n this.blendModes = [];\n this.shaders = [];\n this.sprites = [];\n this.defaultShader = new AbstractFilter([\n 'precision lowp float;',\n 'varying vec2 vTextureCoord;',\n 'varying vec4 vColor;',\n 'uniform sampler2D uSampler;',\n 'void main(void) {',\n ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',\n '}',\n ]);\n }\n\n /**\n * Renders a sprite using WebGL.\n * @param {WebGLRenderingContext & { id: number }} gl - The WebGL rendering context.\n */\n setContext(gl) {\n this.gl = gl;\n // create a couple of buffers\n this.vertexBuffer = gl.createBuffer();\n this.indexBuffer = gl.createBuffer();\n // 65535 is max index, so 65535 / 6 = 10922.\n // upload the index data\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW);\n this.currentBlendMode = 99999;\n const shader = new NormalShader(gl);\n shader.fragmentSrc = this.defaultShader.fragmentSrc;\n shader.uniforms = {};\n shader.init();\n this.defaultShader.shaders[gl.id] = shader;\n }\n\n /**\n * Renders the sprite batch using WebGL.\n * @param {object} renderSession - The render session to use.\n */\n begin(renderSession) {\n this.renderSession = renderSession;\n this.shader = this.renderSession.shaderManager.defaultShader;\n this.start();\n }\n\n /**\n * Updates the sprite batch.\n */\n end() {\n this.flush();\n }\n\n /**\n * Renders a sprite using the sprite batch.\n * @param {import('../../display/image.js').Image} sprite - The sprite to render.\n * @param {import('../../geom/matrix.js').Matrix} matrix - The transformation matrix.\n */\n render(sprite, matrix) {\n const texture = sprite.texture;\n // They provided an alternative rendering matrix, so use it\n let wt = sprite.worldTransform;\n if (matrix) {\n wt = matrix;\n }\n // check texture..\n if (this.currentBatchSize >= this.size) {\n this.flush();\n this.currentBaseTexture = texture.baseTexture;\n }\n // get the uvs for the texture\n const uvs = texture._uvs;\n // if the uvs have not updated then no point rendering just yet!\n if (!uvs) {\n return;\n }\n const aX = sprite.anchor.x;\n const aY = sprite.anchor.y;\n let w0;\n let w1;\n let h0;\n let h1;\n if (texture.trim) {\n // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords.\n const trim = texture.trim;\n w1 = trim.x - aX * trim.width;\n w0 = w1 + texture.crop.width;\n h1 = trim.y - aY * trim.height;\n h0 = h1 + texture.crop.height;\n } else {\n w0 = texture.frame.width * (1 - aX);\n w1 = texture.frame.width * -aX;\n h0 = texture.frame.height * (1 - aY);\n h1 = texture.frame.height * -aY;\n }\n const i = this.currentBatchSize * 4 * this.vertSize;\n const resolution = texture.baseTexture.resolution;\n const a = wt.a / resolution;\n const b = wt.b / resolution;\n const c = wt.c / resolution;\n const d = wt.d / resolution;\n const tx = wt.tx;\n const ty = wt.ty;\n const colors = this.colors;\n const positions = this.positions;\n if (this.renderSession.roundPixels) {\n // xy\n positions[i] = (a * w1 + c * h1 + tx) | 0;\n positions[i + 1] = (d * h1 + b * w1 + ty) | 0;\n // xy\n positions[i + 5] = (a * w0 + c * h1 + tx) | 0;\n positions[i + 6] = (d * h1 + b * w0 + ty) | 0;\n // xy\n positions[i + 10] = (a * w0 + c * h0 + tx) | 0;\n positions[i + 11] = (d * h0 + b * w0 + ty) | 0;\n // xy\n positions[i + 15] = (a * w1 + c * h0 + tx) | 0;\n positions[i + 16] = (d * h0 + b * w1 + ty) | 0;\n } else {\n // xy\n positions[i] = a * w1 + c * h1 + tx;\n positions[i + 1] = d * h1 + b * w1 + ty;\n // xy\n positions[i + 5] = a * w0 + c * h1 + tx;\n positions[i + 6] = d * h1 + b * w0 + ty;\n // xy\n positions[i + 10] = a * w0 + c * h0 + tx;\n positions[i + 11] = d * h0 + b * w0 + ty;\n // xy\n positions[i + 15] = a * w1 + c * h0 + tx;\n positions[i + 16] = d * h0 + b * w1 + ty;\n }\n // uv\n positions[i + 2] = uvs.x0;\n positions[i + 3] = uvs.y0;\n // uv\n positions[i + 7] = uvs.x1;\n positions[i + 8] = uvs.y1;\n // uv\n positions[i + 12] = uvs.x2;\n positions[i + 13] = uvs.y2;\n // uv\n positions[i + 17] = uvs.x3;\n positions[i + 18] = uvs.y3;\n // color and alpha\n const tint = sprite.tint;\n colors[i + 4] = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + ((sprite.worldAlpha * 255) << 24);\n colors[i + 9] = colors[i + 4];\n colors[i + 14] = colors[i + 4];\n colors[i + 19] = colors[i + 4];\n // increment the batchsize\n this.sprites[this.currentBatchSize] = sprite;\n this.currentBatchSize += 1;\n }\n\n /**\n * Binds the sprite batch to the WebGL context.\n */\n renderTilingSprite() {\n // TODO\n }\n\n /**\n * Updates the sprite batch.\n */\n flush() {\n // If the batch is length 0 then return as there is nothing to draw\n if (this.currentBatchSize === 0) {\n return;\n }\n const gl = this.gl;\n let shader;\n if (this.dirty) {\n this.dirty = false;\n // bind the main texture\n gl.activeTexture(gl.TEXTURE0);\n // bind the buffers\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);\n shader = this.defaultShader.shaders[gl.id];\n // this is the same for each shader?\n const stride = this.vertSize * 4;\n gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0);\n gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4);\n // color attributes will be interpreted as unsigned bytes and normalized\n gl.vertexAttribPointer(shader.colorAttribute, 4, gl.UNSIGNED_BYTE, true, stride, 4 * 4);\n }\n // upload the verts to the buffer\n if (this.currentBatchSize > this.size * 0.5) {\n gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices);\n } else {\n const view = this.positions.subarray(0, this.currentBatchSize * 4 * this.vertSize);\n gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);\n }\n let nextTexture;\n let nextBlendMode;\n let nextShader;\n let batchSize = 0;\n let start = 0;\n let currentBaseTexture = null;\n let currentBlendMode = this.renderSession.blendModeManager.currentBlendMode;\n let currentShader = null;\n let blendSwap = false;\n let shaderSwap = false;\n let sprite;\n for (let i = 0, j = this.currentBatchSize; i < j; i += 1) {\n sprite = this.sprites[i];\n if (sprite.tilingTexture) {\n nextTexture = sprite.tilingTexture.baseTexture;\n } else {\n nextTexture = sprite.texture.baseTexture;\n }\n nextBlendMode = sprite.blendMode;\n nextShader = sprite.shader || this.defaultShader;\n blendSwap = currentBlendMode !== nextBlendMode;\n shaderSwap = !currentShader || !nextShader || currentShader._UID !== nextShader._UID;\n let skip = nextTexture.skipRender;\n if (skip && sprite.children.length > 0) {\n skip = false;\n }\n if ((currentBaseTexture !== nextTexture && !skip) || blendSwap || shaderSwap) {\n this.renderBatch(currentBaseTexture, batchSize, start);\n start = i;\n batchSize = 0;\n currentBaseTexture = nextTexture;\n if (blendSwap) {\n currentBlendMode = nextBlendMode;\n this.renderSession.blendModeManager.setBlendMode(currentBlendMode);\n }\n if (shaderSwap) {\n currentShader = nextShader;\n shader = currentShader.shaders[gl.id];\n if (!shader) {\n shader = new NormalShader(gl);\n shader.fragmentSrc = currentShader.fragmentSrc;\n shader.uniforms = currentShader.uniforms;\n shader.init();\n currentShader.shaders[gl.id] = shader;\n }\n // set shader function???\n this.renderSession.shaderManager.setShader(shader);\n if (shader.dirty) {\n shader.syncUniforms();\n }\n // both these only need to be set if they are changing..\n // set the projection\n const projection = this.renderSession.projection;\n gl.uniform2f(shader.projectionVector, projection.x, projection.y);\n // TODO - this is temporary!\n const offsetVector = this.renderSession.offset;\n gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y);\n // set the pointers\n }\n }\n batchSize += 1;\n }\n this.renderBatch(currentBaseTexture, batchSize, start);\n // then reset the batch!\n this.currentBatchSize = 0;\n }\n\n /**\n * Updates the sprite batch with a new texture.\n * @param {import('./base_texture.js').BaseTexture} texture - The texture to use.\n * @param {number} size - The size of the batch.\n * @param {number} startIndex - The start index in the batch.\n */\n renderBatch(texture, size, startIndex) {\n if (size === 0) {\n return;\n }\n const gl = this.gl;\n // check if a texture is dirty..\n if (texture._dirty[gl.id]) {\n if (!this.renderSession.renderer.updateTexture(texture)) {\n // If updateTexture returns false then we cannot render it, so bail out now\n return;\n }\n } else {\n // bind the current texture\n gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);\n }\n // now draw those suckas!\n gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2);\n // increment the draw count\n this.renderSession.drawCount += 1;\n }\n\n /**\n * Destroys this sprite batch and cleans up resources.\n */\n stop() {\n this.flush();\n this.dirty = true;\n }\n\n /**\n * Renders the sprite batch using Canvas.\n */\n start() {\n this.dirty = true;\n }\n\n /**\n * Destroys the sprite batch instance.\n */\n destroy() {\n this.vertices = null;\n this.positions = null;\n this.colors = null;\n this.indices = null;\n this.gl.deleteBuffer(this.vertexBuffer);\n this.gl.deleteBuffer(this.indexBuffer);\n this.currentBaseTexture = null;\n this.gl = null;\n }\n}\n","// @ts-nocheck\nimport { hex2rgb } from '../../util/math.js';\n\nexport class WebGLStencilManager {\n /**\n * Initializes the stencil manager.\n */\n constructor() {\n this.stencilStack = [];\n this.reverse = true;\n this.count = 0;\n }\n\n /**\n * Binds the stencil buffer for rendering.\n * @param {WebGLRenderingContext} gl - The WebGL rendering context.\n */\n setContext(gl) {\n this.gl = gl;\n }\n\n /**\n * Sets up the stencil buffer for rendering.\n */\n destroy() {\n this.stencilStack = null;\n this.gl = null;\n }\n\n /**\n * Renders the stencil buffer for graphics.\n * @param {import('../graphics.js').Graphics} graphics - The graphics object to render.\n * @param {import('./graphics_data.js').GraphicsData} webGLData - The WebGL graphics data.\n * @param {object} renderSession - The rendering session.\n */\n pushStencil(graphics, webGLData, renderSession) {\n const gl = renderSession.gl;\n this.bindGraphics(graphics, webGLData, renderSession);\n if (this.stencilStack.length === 0) {\n gl.enable(gl.STENCIL_TEST);\n gl.clear(gl.STENCIL_BUFFER_BIT);\n this.reverse = true;\n this.count = 0;\n }\n this.stencilStack.push(webGLData);\n const level = this.count;\n gl.colorMask(false, false, false, false);\n gl.stencilFunc(gl.ALWAYS, 0, 0xff);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INVERT);\n // draw the triangle strip!\n if (webGLData.mode === 1) {\n gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0);\n if (this.reverse) {\n gl.stencilFunc(gl.EQUAL, 0xff - level, 0xff);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n } else {\n gl.stencilFunc(gl.EQUAL, level, 0xff);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n }\n // draw a quad to increment..\n gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, (webGLData.indices.length - 4) * 2);\n if (this.reverse) {\n gl.stencilFunc(gl.EQUAL, 0xff - (level + 1), 0xff);\n } else {\n gl.stencilFunc(gl.EQUAL, level + 1, 0xff);\n }\n this.reverse = !this.reverse;\n } else {\n if (!this.reverse) {\n gl.stencilFunc(gl.EQUAL, 0xff - level, 0xff);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n } else {\n gl.stencilFunc(gl.EQUAL, level, 0xff);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n }\n gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0);\n if (!this.reverse) {\n gl.stencilFunc(gl.EQUAL, 0xff - (level + 1), 0xff);\n } else {\n gl.stencilFunc(gl.EQUAL, level + 1, 0xff);\n }\n }\n gl.colorMask(true, true, true, true);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n this.count += 1;\n }\n\n /**\n * Renders the stencil buffer for graphics.\n * @param {import('../graphics.js').Graphics} graphics - The graphics object to render.\n * @param {import('./graphics_data.js').GraphicsData} webGLData - The WebGL graphics data.\n * @param {object} renderSession - The rendering session.\n */\n bindGraphics(graphics, webGLData, renderSession) {\n // if(this._currentGraphics === graphics)return;\n // this._currentGraphics = graphics;\n const gl = renderSession.gl;\n // bind the graphics object..\n const projection = renderSession.projection;\n const offset = renderSession.offset;\n let shader; // = renderSession.shaderManager.primitiveShader;\n if (webGLData.mode === 1) {\n shader = renderSession.shaderManager.complexPrimitiveShader;\n renderSession.shaderManager.setShader(shader);\n gl.uniform1f(shader.flipY, renderSession.flipY);\n gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));\n gl.uniform2f(shader.projectionVector, projection.x, -projection.y);\n gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);\n gl.uniform3fv(shader.tintColor, hex2rgb(graphics.tint));\n gl.uniform3fv(shader.color, webGLData.color);\n gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha);\n gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);\n gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0);\n // now do the rest..\n // set the index buffer!\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);\n } else {\n // renderSession.shaderManager.activatePrimitiveShader();\n shader = renderSession.shaderManager.primitiveShader;\n renderSession.shaderManager.setShader(shader);\n gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));\n gl.uniform1f(shader.flipY, renderSession.flipY);\n gl.uniform2f(shader.projectionVector, projection.x, -projection.y);\n gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);\n gl.uniform3fv(shader.tintColor, hex2rgb(graphics.tint));\n gl.uniform1f(shader.alpha, graphics.worldAlpha);\n gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);\n gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0);\n gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false, 4 * 6, 2 * 4);\n // set the index buffer!\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);\n }\n }\n\n /**\n * Renders the stencil buffer for graphics.\n * @param {import('../graphics.js').Graphics} graphics - The graphics object to render.\n * @param {import('./graphics_data.js').GraphicsData} webGLData - The WebGL graphics data.\n * @param {object} renderSession - The rendering session.\n */\n popStencil(graphics, webGLData, renderSession) {\n const gl = renderSession.gl;\n this.stencilStack.pop();\n this.count -= 1;\n if (this.stencilStack.length === 0) {\n // the stack is empty!\n gl.disable(gl.STENCIL_TEST);\n } else {\n const level = this.count;\n this.bindGraphics(graphics, webGLData, renderSession);\n gl.colorMask(false, false, false, false);\n if (webGLData.mode === 1) {\n this.reverse = !this.reverse;\n if (this.reverse) {\n gl.stencilFunc(gl.EQUAL, 0xff - (level + 1), 0xff);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n } else {\n gl.stencilFunc(gl.EQUAL, level + 1, 0xff);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n }\n // draw a quad to increment..\n gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, (webGLData.indices.length - 4) * 2);\n gl.stencilFunc(gl.ALWAYS, 0, 0xff);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INVERT);\n // draw the triangle strip!\n gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0);\n if (!this.reverse) {\n gl.stencilFunc(gl.EQUAL, 0xff - level, 0xff);\n } else {\n gl.stencilFunc(gl.EQUAL, level, 0xff);\n }\n } else {\n if (!this.reverse) {\n gl.stencilFunc(gl.EQUAL, 0xff - (level + 1), 0xff);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n } else {\n gl.stencilFunc(gl.EQUAL, level + 1, 0xff);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n }\n gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0);\n if (!this.reverse) {\n gl.stencilFunc(gl.EQUAL, 0xff - level, 0xff);\n } else {\n gl.stencilFunc(gl.EQUAL, level, 0xff);\n }\n }\n gl.colorMask(true, true, true, true);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n }\n }\n}\n","// @ts-nocheck\nimport {\n BLEND_ADD,\n BLEND_COLOR,\n BLEND_COLOR_BURN,\n BLEND_COLOR_DODGE,\n BLEND_DARKEN,\n BLEND_DIFFERENCE,\n BLEND_EXCLUSION,\n BLEND_HARD_LIGHT,\n BLEND_HUE,\n BLEND_LIGHTEN,\n BLEND_LUMINOSITY,\n BLEND_MULTIPLY,\n BLEND_NORMAL,\n BLEND_OVERLAY,\n BLEND_SATURATION,\n BLEND_SCREEN,\n BLEND_SOFT_LIGHT,\n RENDER_WEBGL,\n SCALE_LINEAR,\n} from '../../core/const.js';\nimport { ENGINE_ERROR_CREATING_WEBGL_CONTEXT, ENGINE_ERROR_WEBGL_CONTEXT_LOST } from '../../core/error_code.js';\nimport { Point } from '../../geom/point.js';\nimport { isPowerOfTwo } from '../../util/math.js';\nimport { remove } from '../canvas/pool.js';\nimport { WebGLBlendModeManager } from './blend_manager.js';\nimport { WebGLFilterManager } from './filter_manager.js';\nimport * as WebGLMaskManager from './mask_manager.js';\nimport { WebGLShaderManager } from './shader_manager.js';\nimport { WebGLSpriteBatch } from './sprite_batch.js';\nimport { WebGLStencilManager } from './stencil_manager.js';\nimport { getWebGLContextErrorCode, getWebGLContextErrorName } from './util.js';\n\nexport class WebGLRenderer {\n /**\n * Creates a new WebGLRenderer instance.\n * @param {import('../../core/game.js').Game} game - The game instance.\n */\n constructor(game) {\n /** @type {number} */\n this.type = RENDER_WEBGL;\n this.resolution = game.config.resolution;\n this.autoResize = false;\n this.contextLost = false;\n this.clearBeforeRender = game.config.clearBeforeRender;\n this.width = game.width;\n this.height = game.height;\n this.view = game.canvas;\n this._contextOptions = {\n alpha: game.config.transparent,\n depth: false,\n antialias: game.config.antialias,\n premultipliedAlpha: game.config.transparent && game.config.transparent !== 'notMultiplied',\n stencil: true,\n failIfMajorPerformanceCaveat: false,\n preserveDrawingBuffer: game.config.preserveDrawingBuffer,\n };\n this.projection = new Point();\n this.offset = new Point();\n this.shaderManager = new WebGLShaderManager();\n this.spriteBatch = new WebGLSpriteBatch();\n this.filterManager = new WebGLFilterManager();\n this.stencilManager = new WebGLStencilManager();\n this.blendModeManager = new WebGLBlendModeManager();\n this.renderSession = {};\n this.renderSession.gl = this.gl;\n this.renderSession.drawCount = 0;\n this.renderSession.shaderManager = this.shaderManager;\n this.renderSession.maskManager = WebGLMaskManager;\n this.renderSession.filterManager = this.filterManager;\n this.renderSession.blendModeManager = this.blendModeManager;\n this.renderSession.spriteBatch = this.spriteBatch;\n this.renderSession.stencilManager = this.stencilManager;\n this.renderSession.renderer = this;\n this.renderSession.resolution = this.resolution;\n this.initContext(game);\n this.mapBlendModes();\n }\n\n /**\n * Destroys this renderer and cleans up resources.\n */\n destroy() {\n window.PhaserRegistry.GL_CONTEXTS[this.glContextId] = null;\n this.projection = null;\n this.offset = null;\n this.shaderManager.destroy();\n this.spriteBatch.destroy();\n this.filterManager.destroy();\n this.shaderManager = null;\n this.spriteBatch = null;\n this.filterManager = null;\n if (this.gl) {\n this.gl.canvas.width = 1;\n this.gl.canvas.height = 1;\n const loseContextExt = this.gl.getExtension('WEBGL_lose_context');\n if (loseContextExt) {\n loseContextExt.loseContext();\n }\n }\n this.gl = null;\n this.renderSession = null;\n remove(this);\n window.PhaserRegistry.INSTANCES[this.glContextId] = null;\n window.PhaserRegistry.GL_CONTEXT_ID -= 1;\n }\n\n /**\n * Initializes the WebGL registry.\n */\n initRegistry() {\n if (!window.PhaserRegistry.GL_CONTEXT_ID) {\n window.PhaserRegistry.GL_CONTEXT_ID = 0;\n }\n if (!window.PhaserRegistry.GL_CONTEXTS) {\n window.PhaserRegistry.GL_CONTEXTS = [];\n }\n if (!window.PhaserRegistry.INSTANCES) {\n window.PhaserRegistry.INSTANCES = [];\n }\n }\n\n /**\n * Initializes the WebGL context for rendering.\n * @param {import('../../core/game.js').Game} game - The game instance.\n * @throws {Error}\n */\n initContext(game) {\n game.logger.info('initContext');\n // TODO: view.addEventListener('webglcontextcreationerror', this.onWebGLContextCreationError, false);\n /** @type {WebGLRenderingContext & { id: number }} */\n // @ts-ignore\n const gl = this.view.getContext('webgl', this._contextOptions);\n this.gl = gl;\n if (!gl) {\n throw new Error(ENGINE_ERROR_CREATING_WEBGL_CONTEXT);\n }\n const errorCode = getWebGLContextErrorCode(gl);\n if (errorCode) {\n const errorName = getWebGLContextErrorName(errorCode);\n game.logger.warn('WebGL context error', { errorCode, errorName });\n }\n if (gl?.isContextLost()) {\n throw new Error(ENGINE_ERROR_WEBGL_CONTEXT_LOST);\n }\n // set current context\n this.initRegistry();\n this.glContextId = window.PhaserRegistry.GL_CONTEXT_ID;\n gl.id = window.PhaserRegistry.GL_CONTEXT_ID;\n window.PhaserRegistry.GL_CONTEXTS[this.glContextId] = gl;\n window.PhaserRegistry.INSTANCES[this.glContextId] = this;\n window.PhaserRegistry.GL_CONTEXT_ID += 1;\n // set default settings\n gl.disable(gl.DEPTH_TEST);\n gl.disable(gl.CULL_FACE);\n gl.enable(gl.BLEND);\n // set context for managers\n this.shaderManager.setContext(gl);\n this.spriteBatch.setContext(gl);\n this.stencilManager.setContext(gl);\n this.filterManager.setContext(gl);\n this.blendModeManager.setContext(gl);\n this.renderSession.gl = gl;\n // set initial size\n this.resize(this.width, this.height);\n }\n\n /**\n * Renders the stage to WebGL.\n * @param {import('../../core/stage.js').Stage} stage - The root stage to render.\n */\n render(stage) {\n if (this.contextLost) {\n return;\n }\n const gl = this.gl;\n // -- Does this need to be set every frame? -- //\n // gl.viewport(0, 0, this.width, this.height);\n // make sure we are bound to the main frame buffer\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n if (this.clearBeforeRender) {\n gl.clearColor(stage._bgColor.r, stage._bgColor.g, stage._bgColor.b, stage._bgColor.a);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n this.offset.x = 0;\n this.offset.y = 0;\n this.renderDisplayObject(stage, this.projection);\n }\n\n /**\n * Renders a display object to WebGL.\n * @param {import('../../display/display_object.js').DisplayObject} displayObject - The display object to render.\n * @param {Point} projection - The projection matrix.\n * @param {object} buffer - The render buffer.\n * @param {import('../../geom/matrix.js').Matrix} matrix - The transformation matrix.\n */\n renderDisplayObject(displayObject, projection, buffer, matrix) {\n this.renderSession.blendModeManager.setBlendMode(BLEND_NORMAL);\n // reset the render session data..\n this.renderSession.drawCount = 0;\n // make sure to flip the Y if using a render texture..\n this.renderSession.flipY = buffer ? -1 : 1;\n // set the default projection\n this.renderSession.projection = projection;\n // set the default offset\n this.renderSession.offset = this.offset;\n // start the sprite batch\n this.spriteBatch.begin(this.renderSession);\n // start the filter manager\n this.filterManager.begin(this.renderSession, buffer);\n // render the scene!\n displayObject.renderWebGL(this.renderSession, matrix);\n // finish the sprite batch\n this.spriteBatch.end();\n }\n\n /**\n * Resizes the WebGL canvas to the specified dimensions.\n * @param {number} width - The new width of the canvas.\n * @param {number} height - The new height of the canvas.\n */\n resize(width, height) {\n this.width = width * this.resolution;\n this.height = height * this.resolution;\n this.view.width = this.width;\n this.view.height = this.height;\n if (this.autoResize) {\n this.view.style.width = `${this.width / this.resolution}px`;\n this.view.style.height = `${this.height / this.resolution}px`;\n }\n this.gl.viewport(0, 0, this.width, this.height);\n this.projection.x = this.width / 2 / this.resolution;\n this.projection.y = -this.height / 2 / this.resolution;\n }\n\n /**\n * Updates a texture in the WebGL context.\n * @param {import('./base_texture.js').BaseTexture} texture - The base texture to update.\n * @returns {boolean} Whether the update was successful.\n */\n updateTexture(texture) {\n if (!texture.hasLoaded) {\n return false;\n }\n const gl = this.gl;\n if (!texture._glTextures[gl.id]) {\n texture._glTextures[gl.id] = gl.createTexture();\n }\n gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === SCALE_LINEAR ? gl.LINEAR : gl.NEAREST);\n if (texture.mipmap && isPowerOfTwo(texture.width, texture.height)) {\n gl.texParameteri(\n gl.TEXTURE_2D,\n gl.TEXTURE_MIN_FILTER,\n texture.scaleMode === SCALE_LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST\n );\n gl.generateMipmap(gl.TEXTURE_2D);\n } else {\n gl.texParameteri(\n gl.TEXTURE_2D,\n gl.TEXTURE_MIN_FILTER,\n texture.scaleMode === SCALE_LINEAR ? gl.LINEAR : gl.NEAREST\n );\n }\n if (!texture._powerOf2) {\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n } else {\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);\n }\n texture._dirty[gl.id] = false;\n // return texture._glTextures[gl.id];\n return true;\n }\n\n /**\n * Maps blend modes to WebGL rendering operations.\n */\n mapBlendModes() {\n if (window.PhaserRegistry.blendModesWebGL) {\n return;\n }\n const gl = this.gl;\n const b = [];\n b[BLEND_NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_ADD] = [gl.SRC_ALPHA, gl.DST_ALPHA];\n b[BLEND_MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_SCREEN] = [gl.SRC_ALPHA, gl.ONE];\n b[BLEND_OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n b[BLEND_LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n window.PhaserRegistry.blendModesWebGL = b;\n }\n}\n","// @ts-nocheck\nimport { cloneFrameData } from './frame_util.js';\n\nexport class FrameData {\n /**\n * Creates a new FrameData instance.\n * This class holds data about frames in a texture atlas or sprite sheet.\n */\n constructor() {\n /**\n * @type {import('./frame.js').Frame[]}\n */\n this._frames = [];\n /**\n * @type {string[]}\n */\n this._frameNames = [];\n }\n\n /**\n * Add a frame to the frame data collection.\n * @param {import('./frame.js').Frame} frame - The frame to add.\n * @returns {import('./frame.js').Frame} The added frame.\n */\n addFrame(frame) {\n frame.index = this._frames.length;\n this._frames.push(frame);\n if (frame.name !== '') {\n this._frameNames[frame.name] = frame.index;\n }\n return frame;\n }\n\n /**\n * Get a frame by its index.\n * @param {number} index - The index of the frame to get.\n * @returns {import('./frame.js').Frame} The frame at the specified index, or the first frame if index is out of bounds.\n */\n getFrame(index = 0) {\n if (index >= this._frames.length) {\n index = 0;\n }\n return this._frames[index];\n }\n\n /**\n * Get a frame by its name.\n * @param {string} name - The name of the frame to get.\n * @returns {import('./frame.js').Frame} The frame with the specified name, or null if not found.\n */\n getFrameByName(name) {\n if (typeof this._frameNames[name] === 'number') {\n return this._frames[this._frameNames[name]];\n }\n return null;\n }\n\n /**\n * Check if a frame with the given name exists.\n * @param {string} name - The name of the frame to check.\n * @returns {boolean} True if a frame with this name exists, false otherwise.\n */\n checkFrameName(name) {\n if (this._frameNames[name] == null) {\n return false;\n }\n return true;\n }\n\n /**\n * Create a clone of this FrameData instance.\n * @returns {FrameData} A new FrameData instance with cloned frames.\n */\n clone() {\n return cloneFrameData(this);\n }\n\n /**\n * Get a range of frames by index.\n * @param {number} start - The starting index of the frame range.\n * @param {number} end - The ending index of the frame range.\n * @param {import('./frame.js').Frame[]} output - Optional array to populate with frames.\n * @returns {import('./frame.js').Frame[]} An array of frames in the specified range.\n */\n getFrameRange(start, end, output = null) {\n const result = output || [];\n for (let i = start; i <= end; i += 1) {\n result.push(this._frames[i]);\n }\n return result;\n }\n\n /**\n * Get frame indexes from an array of frame names or indices.\n * @param {number[]|string[]} frames - An array of frame names or indices.\n * @param {boolean} useNumericIndex - Whether to treat numeric values as frame indices.\n * @param {number[]} output - Optional array to populate with frame indexes.\n * @returns {number[]} An array of frame indexes.\n */\n getFrameIndexes(frames, useNumericIndex = true, output = null) {\n const result = output || [];\n if (frames && frames.length > 0) {\n for (let i = 0; i < frames.length; i += 1) {\n if (useNumericIndex && this._frames[frames[i]]) {\n result.push(this._frames[frames[i]].index);\n } else if (this.getFrameByName(frames[i])) {\n result.push(this.getFrameByName(frames[i]).index);\n }\n }\n } else {\n for (let i = 0; i < this._frames.length; i += 1) {\n result.push(this._frames[i].index);\n }\n }\n return result;\n }\n\n /**\n * Destroy this FrameData instance and clean up resources.\n * This method clears internal arrays and releases references to frames.\n */\n destroy() {\n this._frames = null;\n this._frameNames = null;\n }\n\n /**\n * Get the total number of frames in this FrameData instance.\n * @returns {number} The total number of frames.\n */\n get total() {\n return this._frames.length;\n }\n}","// @ts-nocheck\nimport { Frame } from './frame.js';\nimport { FrameData } from './frame_data.js';\n\n/**\n * Clone a Frame object.\n * @param {Frame} frame - The frame to clone.\n * @param {Frame} output - Optional output frame to populate.\n * @returns {Frame} The cloned frame or the provided output frame.\n */\nexport const cloneFrame = (frame, output = null) => {\n const result = output || new Frame(frame.index, frame.x, frame.y, frame.width, frame.height);\n result.initialize(frame.index, frame.x, frame.y, frame.width, frame.height);\n return result;\n};\n\n/**\n * Clone a FrameData object.\n * @param {FrameData} frameData - The frame data to clone.\n * @param {FrameData} output - Optional output frame data to populate.\n * @returns {FrameData} The cloned frame data or the provided output frame data.\n */\nexport const cloneFrameData = (frameData, output = null) => {\n const result = output || new FrameData();\n for (let i = 0; i < frameData.total; i += 1) {\n result.addFrame(frameData.getFrame(i).clone());\n }\n return result;\n};","// @ts-nocheck\nimport { Rectangle } from '../geom/rectangle.js';\nimport { distance } from '../util/math.js';\nimport { cloneFrame } from './frame_util.js';\n\nexport class Frame {\n /**\n * Creates a new Frame instance.\n * @param {number} index - The index of this frame in the animation.\n * @param {number} x - The x coordinate of this frame's position in the texture.\n * @param {number} y - The y coordinate of this frame's position in the texture.\n * @param {number} width - The width of this frame in pixels.\n * @param {number} height - The height of this frame in pixels.\n * @param {string} name - The name of this frame.\n */\n constructor(index, x, y, width, height, name) {\n this.initialize(index, x, y, width, height, name);\n }\n\n /**\n * Initializes this frame with the specified properties.\n * @param {number} index - The index of this frame in the animation.\n * @param {number} x - The x coordinate of this frame's position in the texture.\n * @param {number} y - The y coordinate of this frame's position in the texture.\n * @param {number} width - The width of this frame in pixels.\n * @param {number} height - The height of this frame in pixels.\n * @param {string} name - The name of this frame.\n */\n initialize(index, x, y, width, height, name) {\n this.index = index;\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.name = name;\n this.centerX = Math.floor(width / 2);\n this.centerY = Math.floor(height / 2);\n this.distance = distance(0, 0, width, height);\n this.rotated = false;\n this.rotationDirection = 'cw';\n this.trimmed = false;\n this.sourceSizeW = width;\n this.sourceSizeH = height;\n this.spriteSourceSizeX = 0;\n this.spriteSourceSizeY = 0;\n this.spriteSourceSizeW = 0;\n this.spriteSourceSizeH = 0;\n this.right = this.x + this.width;\n this.bottom = this.y + this.height;\n }\n\n /**\n * Resizes this frame to the specified dimensions.\n * @param {number} width - The new width of this frame in pixels.\n * @param {number} height - The new height of this frame in pixels.\n */\n resize(width, height) {\n this.width = width;\n this.height = height;\n this.centerX = Math.floor(width / 2);\n this.centerY = Math.floor(height / 2);\n this.distance = distance(0, 0, width, height);\n this.sourceSizeW = width;\n this.sourceSizeH = height;\n this.right = this.x + width;\n this.bottom = this.y + height;\n }\n\n /**\n * Sets the trim properties for this frame.\n * @param {boolean} trimmed - Whether this frame is trimmed.\n * @param {number} actualWidth - The actual width of the trimmed frame.\n * @param {number} actualHeight - The actual height of the trimmed frame.\n * @param {number} destX - The destination x coordinate for the trimmed frame.\n * @param {number} destY - The destination y coordinate for the trimmed frame.\n * @param {number} destWidth - The destination width of the trimmed frame.\n * @param {number} destHeight - The destination height of the trimmed frame.\n */\n setTrim(trimmed, actualWidth, actualHeight, destX, destY, destWidth, destHeight) {\n this.trimmed = trimmed;\n if (trimmed) {\n this.sourceSizeW = actualWidth;\n this.sourceSizeH = actualHeight;\n this.centerX = Math.floor(actualWidth / 2);\n this.centerY = Math.floor(actualHeight / 2);\n this.spriteSourceSizeX = destX;\n this.spriteSourceSizeY = destY;\n this.spriteSourceSizeW = destWidth;\n this.spriteSourceSizeH = destHeight;\n }\n }\n\n /**\n * Creates a clone of this frame.\n * @returns {Frame} A new Frame instance with the same properties.\n */\n clone() {\n return cloneFrame(this);\n }\n\n /**\n * Gets the rectangle bounds of this frame.\n * @param {Rectangle} output - The rectangle to use for the result (optional).\n * @returns {Rectangle} A Rectangle object representing this frame's bounds.\n */\n getRect(output = null) {\n const result = output || new Rectangle();\n result.setTo(this.x, this.y, this.width, this.height);\n return result;\n }\n}","import { Frame } from './frame.js';\nimport { FrameData } from './frame_data.js';\n\n/**\n * TBD.\n * @param {import('./game.js').Game} game - TBD.\n * @param {string} key - TBD.\n * @param {number} frameWidth - TBD.\n * @param {number} frameHeight - TBD.\n * @param {number} frameMax - TBD.\n * @param {number} margin - TBD.\n * @param {number} spacing - TBD.\n * @returns {FrameData} TBD.\n */\nexport const spriteSheet = (game, key, frameWidth, frameHeight, frameMax, margin, spacing) => {\n let img = key;\n if (typeof key === 'string') {\n img = game.cache.getImage(key);\n }\n if (img === null) {\n return null;\n }\n const width = img.width;\n const height = img.height;\n if (frameWidth <= 0) {\n frameWidth = Math.floor(-width / Math.min(-1, frameWidth));\n }\n if (frameHeight <= 0) {\n frameHeight = Math.floor(-height / Math.min(-1, frameHeight));\n }\n const row = Math.floor((width - margin) / (frameWidth + spacing));\n const column = Math.floor((height - margin) / (frameHeight + spacing));\n let total = row * column;\n if (frameMax !== -1) {\n total = frameMax;\n }\n // Zero or smaller than frame sizes?\n if (width === 0 || height === 0 || width < frameWidth || height < frameHeight || total === 0) {\n game.logger.warn(\n `AnimationParser.spriteSheet: '${key}'s width/height zero or width/height < given frameWidth/frameHeight`\n );\n return null;\n }\n // Let's create some frames then\n const data = new FrameData();\n let x = margin;\n let y = margin;\n for (let i = 0; i < total; i += 1) {\n data.addFrame(new Frame(i, x, y, frameWidth, frameHeight, ''));\n x += frameWidth + spacing;\n if (x + frameWidth > width) {\n x = margin;\n y += frameHeight + spacing;\n }\n }\n return data;\n};\n\n/**\n * TBD.\n * @param {import('./game.js').Game} game - TBD.\n * @param {object} json - TBD.\n * @returns {FrameData} TBD.\n */\nexport const JSONDataHash = (game, json) => {\n if (!json.frames) {\n game.logger.warn('JSONDataHash: Invalid Texture Atlas JSON given, missing frames object', json);\n return null;\n }\n // Let's create some frames then\n const data = new FrameData();\n // By this stage frames is a fully parsed array\n const frames = json.frames;\n let newFrame;\n let i = 0;\n const keys = Object.keys(frames);\n for (let k = 0; k < keys.length; k += 1) {\n const key = keys[k];\n newFrame = data.addFrame(\n new Frame(i, frames[key].frame.x, frames[key].frame.y, frames[key].frame.w, frames[key].frame.h, key)\n );\n if (frames[key].trimmed) {\n newFrame.setTrim(\n frames[key].trimmed,\n frames[key].sourceSize.w,\n frames[key].sourceSize.h,\n frames[key].spriteSourceSize.x,\n frames[key].spriteSourceSize.y,\n frames[key].spriteSourceSize.w,\n frames[key].spriteSourceSize.h\n );\n }\n i += 1;\n }\n return data;\n};\n","// @ts-nocheck\nimport { Texture } from '../display/webgl/texture.js';\nimport { Rectangle } from '../geom/rectangle.js';\n\n/**\n * Finalizes bitmap font data by attaching textures to characters.\n * @param {import('../display/webgl/base_texture.js').BaseTexture} baseTexture - The base texture for the font.\n * @param {object} bitmapFontData - The bitmap font data to finalize.\n * @returns {object} The finalized bitmap font data.\n */\nexport const finalizeBitmapFont = (baseTexture, bitmapFontData) => {\n Object.keys(bitmapFontData.chars).forEach((charCode) => {\n const letter = bitmapFontData.chars[charCode];\n letter.texture = new Texture(baseTexture, new Rectangle(letter.x, letter.y, letter.width, letter.height));\n });\n return bitmapFontData;\n};\n\n/**\n * Parses XML bitmap font data.\n * @param {object} xml - The XML document containing the bitmap font data.\n * @param {import('../display/webgl/base_texture.js').BaseTexture} baseTexture - The base texture for the font.\n * @param {number} xSpacing - Horizontal spacing between characters.\n * @param {number} ySpacing - Vertical spacing between characters.\n * @returns {object} The parsed bitmap font data.\n */\nexport const xmlBitmapFont = (xml, baseTexture, xSpacing, ySpacing) => {\n const data = {};\n const info = xml.getElementsByTagName('info')[0];\n const common = xml.getElementsByTagName('common')[0];\n data.font = info.getAttribute('face');\n data.size = Number.parseInt(info.getAttribute('size'), 10);\n data.lineHeight = Number.parseInt(common.getAttribute('lineHeight'), 10) + ySpacing;\n data.chars = {};\n const letters = xml.getElementsByTagName('char');\n for (let i = 0; i < letters.length; i += 1) {\n const charCode = Number.parseInt(letters[i].getAttribute('id'), 10);\n data.chars[charCode] = {\n x: Number.parseInt(letters[i].getAttribute('x'), 10),\n y: Number.parseInt(letters[i].getAttribute('y'), 10),\n width: Number.parseInt(letters[i].getAttribute('width'), 10),\n height: Number.parseInt(letters[i].getAttribute('height'), 10),\n xOffset: Number.parseInt(letters[i].getAttribute('xoffset'), 10),\n yOffset: Number.parseInt(letters[i].getAttribute('yoffset'), 10),\n xAdvance: Number.parseInt(letters[i].getAttribute('xadvance'), 10) + xSpacing,\n kerning: {},\n };\n }\n const kernings = xml.getElementsByTagName('kerning');\n for (let i = 0; i < kernings.length; i += 1) {\n const first = Number.parseInt(kernings[i].getAttribute('first'), 10);\n const second = Number.parseInt(kernings[i].getAttribute('second'), 10);\n const amount = Number.parseInt(kernings[i].getAttribute('amount'), 10);\n data.chars[second].kerning[first] = amount;\n }\n return finalizeBitmapFont(baseTexture, data);\n};\n\n/**\n * Parses XML bitmap font data (alias for xmlBitmapFont).\n * @param {object} xml - The XML document containing the bitmap font data.\n * @param {import('../display/webgl/base_texture.js').BaseTexture} baseTexture - The base texture for the font.\n * @param {number} xSpacing - Horizontal spacing between characters.\n * @param {number} ySpacing - Vertical spacing between characters.\n * @returns {object} The parsed bitmap font data.\n */\nexport const bitmapFont = (xml, baseTexture, xSpacing, ySpacing) => {\n return xmlBitmapFont(xml, baseTexture, xSpacing, ySpacing);\n};\n\n/**\n * Parses JSON bitmap font data.\n * @param {object} json - The JSON object containing the bitmap font data.\n * @param {import('../display/webgl/base_texture.js').BaseTexture} baseTexture - The base texture for the font.\n * @param {number} xSpacing - Horizontal spacing between characters.\n * @param {number} ySpacing - Vertical spacing between characters.\n * @returns {object} The parsed bitmap font data.\n */\nexport const jsonBitmapFont = (json, baseTexture, xSpacing, ySpacing) => {\n const data = {\n font: json.font.info._face,\n size: Number.parseInt(json.font.info._size, 10),\n lineHeight: Number.parseInt(json.font.common._lineHeight, 10) + ySpacing,\n chars: {},\n };\n json.font.chars.char.forEach((letter) => {\n const charCode = Number.parseInt(letter._id, 10);\n data.chars[charCode] = {\n x: Number.parseInt(letter._x, 10),\n y: Number.parseInt(letter._y, 10),\n width: Number.parseInt(letter._width, 10),\n height: Number.parseInt(letter._height, 10),\n xOffset: Number.parseInt(letter._xoffset, 10),\n yOffset: Number.parseInt(letter._yoffset, 10),\n xAdvance: Number.parseInt(letter._xadvance, 10) + xSpacing,\n kerning: {},\n };\n });\n if (json.font.kernings && json.font.kernings.kerning) {\n json.font.kernings.kerning.forEach((kerning) => {\n data.chars[kerning._second].kerning[kerning._first] = Number.parseInt(kerning._amount, 10);\n });\n }\n return finalizeBitmapFont(baseTexture, data);\n};","// @ts-nocheck\nimport { BaseTexture } from '../display/webgl/base_texture.js';\nimport { Texture } from '../display/webgl/texture.js';\nimport { JSONDataHash } from './animation_parser.js';\nimport { Frame } from './frame.js';\nimport { FrameData } from './frame_data.js';\nimport { jsonBitmapFont, xmlBitmapFont } from './loader_parser.js';\nimport { Signal } from './signal.js';\n\nexport const CANVAS = 0;\nexport const IMAGE = 1;\nexport const TEXTURE = 2;\nexport const SOUND = 3;\nexport const TEXT = 4;\nexport const BITMAPDATA = 5;\nexport const BITMAPFONT = 6;\nexport const JSONDATA = 7;\nexport const XML = 8;\nexport const RENDER_TEXTURE = 9;\n\nexport class Cache {\n /**\n * Creates a new Cache instance.\n * @param {import('./game.js').Game} game - The game instance.\n */\n constructor(game) {\n this.game = game;\n this.autoResolveURL = false;\n this._cache = {\n canvas: {},\n image: {},\n texture: {},\n sound: {},\n text: {},\n json: {},\n xml: {},\n bitmapData: {},\n bitmapFont: {},\n renderTexture: {},\n };\n this._urlMap = {};\n this._urlResolver = new Image();\n this._urlTemp = null;\n this.onSoundUnlock = new Signal();\n this._cacheMap = [];\n this._cacheMap[CANVAS] = this._cache.canvas;\n this._cacheMap[IMAGE] = this._cache.image;\n this._cacheMap[TEXTURE] = this._cache.texture;\n this._cacheMap[SOUND] = this._cache.sound;\n this._cacheMap[TEXT] = this._cache.text;\n this._cacheMap[BITMAPDATA] = this._cache.bitmapData;\n this._cacheMap[BITMAPFONT] = this._cache.bitmapFont;\n this._cacheMap[JSONDATA] = this._cache.json;\n this._cacheMap[XML] = this._cache.xml;\n this._cacheMap[RENDER_TEXTURE] = this._cache.renderTexture;\n this.addDefaultImage();\n this.addMissingImage();\n }\n\n /**\n * Adds the default image to the cache.\n */\n addDefaultImage() {\n const img = new Image();\n img.src =\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg==';\n const obj = this.addImage('__default', null, img);\n obj.base.skipRender = true; // invisible texture\n window.PhaserRegistry.CACHE_DEFAULT_IMAGE = new Texture(obj.base);\n }\n\n /**\n * Adds the missing image to the cache.\n */\n addMissingImage() {\n const img = new Image();\n img.src =\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg==';\n const obj = this.addImage('__missing', null, img);\n window.PhaserRegistry.CACHE_MISSING_IMAGE = new Texture(obj.base);\n }\n\n /**\n * Adds an image to the cache.\n * @param {string} key - The unique key for this cache entry.\n * @param {string} url - The URL the image was loaded from.\n * @param {HTMLImageElement} data - The image data to cache.\n * @returns {object} The cached image object.\n */\n addImage(key, url, data) {\n if (this.checkImageKey(key)) {\n this.removeImage(key);\n }\n /* if (!data.complete) {\n this.game.logger.warn('Cache addImage %s is incomplete', key);\n } */\n const img = {\n key,\n url,\n data,\n base: new BaseTexture(data),\n frame: new Frame(0, 0, 0, data.width, data.height, key),\n frameData: new FrameData(),\n };\n img.frameData.addFrame(new Frame(0, 0, 0, data.width, data.height, url));\n this._cache.image[key] = img;\n this._resolveURL(url, img);\n return img;\n }\n\n /**\n * Adds a texture atlas to the cache.\n * @param {string} key - The unique key for this cache entry.\n * @param {string} url - The URL the atlas was loaded from.\n * @param {HTMLCanvasElement} data - The canvas data for the atlas.\n * @param {object} atlasData - The atlas data to cache.\n */\n addTextureAtlas(key, url, data, atlasData) {\n const obj = {\n key,\n url,\n data,\n base: new BaseTexture(data),\n };\n obj.frameData = JSONDataHash(this.game, atlasData, key);\n this._cache.image[key] = obj;\n this._resolveURL(url, obj);\n }\n\n /**\n * Adds sound data to the cache.\n * @param {string} key - The unique key for this cache entry.\n * @param {string} url - The URL the sound was loaded from.\n * @param {object} data - The sound data to cache.\n */\n addSound(key, url, data) {\n this._cache.sound[key] = {\n url,\n data,\n isDecoding: false,\n decoded: false,\n };\n this._resolveURL(url, this._cache.sound[key]);\n }\n\n /**\n * Adds text data to the cache.\n * @param {string} key - The unique key for this cache entry.\n * @param {string} url - The URL the text was loaded from.\n * @param {string} data - The text data to cache.\n */\n addText(key, url, data) {\n this._cache.text[key] = { url, data };\n this._resolveURL(url, this._cache.text[key]);\n }\n\n /**\n * Adds a bitmap font to the cache.\n * @param {string} key - The unique key for this cache entry.\n * @param {string} url - The URL the bitmap font was loaded from.\n * @param {HTMLCanvasElement} data - The canvas data for the font.\n * @param {object} atlasData - The bitmap font atlas data to cache.\n * @param {string} atlasType - The type of the atlas data ('json' or 'xml').\n * @param {number} xSpacing - Horizontal spacing between characters.\n * @param {number} ySpacing - Vertical spacing between characters.\n */\n addBitmapFont(key, url, data, atlasData, atlasType, xSpacing = 0, ySpacing = 0) {\n const obj = {\n url,\n data,\n font: null,\n base: new BaseTexture(data),\n };\n if (atlasType === 'json') {\n obj.font = jsonBitmapFont(atlasData, obj.base, xSpacing, ySpacing);\n } else {\n obj.font = xmlBitmapFont(atlasData, obj.base, xSpacing, ySpacing);\n }\n this._cache.bitmapFont[key] = obj;\n this._resolveURL(url, obj);\n }\n\n /**\n * Adds JSON data to the cache.\n * @param {string} key - The unique key for this cache entry.\n * @param {string} url - The URL the JSON was loaded from.\n * @param {object} data - The JSON data to cache.\n */\n addJSON(key, url, data) {\n this._cache.json[key] = { url, data };\n this._resolveURL(url, this._cache.json[key]);\n }\n\n /**\n * Adds XML data to the cache.\n * @param {string} key - The unique key for this cache entry.\n * @param {string} url - The URL the XML was loaded from.\n * @param {XMLDocument} data - The XML data to cache.\n */\n addXML(key, url, data) {\n this._cache.xml[key] = { url, data };\n this._resolveURL(url, this._cache.xml[key]);\n }\n\n // SOUND\n\n /**\n * Updates a sound property in the cache.\n * @param {string} key - The unique key for the cached sound.\n * @param {string} property - The property to update.\n * @param {any} value - The new value for the property.\n */\n updateSound(key, property, value) {\n const sound = this.getSound(key);\n if (sound) {\n sound[property] = value;\n }\n }\n\n /**\n * Marks a sound as decoded in the cache.\n * @param {string} key - The unique key for the cached sound.\n * @param {AudioBuffer} data - The decoded audio buffer.\n */\n decodedSound(key, data) {\n const sound = this.getSound(key);\n sound.data = data;\n sound.decoded = true;\n sound.isDecoding = false;\n }\n\n /**\n * Checks if a sound has been decoded in the cache.\n * @param {string} key - The unique key for the cached sound.\n * @returns {boolean} True if the sound is decoded, false otherwise.\n */\n isSoundDecoded(key) {\n const sound = this.getItem(key, SOUND, 'isSoundDecoded');\n if (sound) {\n return sound.decoded;\n }\n return null;\n }\n\n /**\n * Checks if a sound is ready to play (decoded and not locked).\n * @param {string} key - The unique key for the cached sound.\n * @returns {boolean} True if the sound is ready, false otherwise.\n */\n isSoundReady(key) {\n const sound = this.getItem(key, SOUND, 'isSoundDecoded');\n if (sound) {\n return sound.decoded && !this.game.sound.isLocked;\n }\n return false;\n }\n\n // CHECK\n\n /**\n * Checks if a cache entry exists.\n * @param {number} cache - The cache type (CANVAS, IMAGE, etc.).\n * @param {string} key - The unique key for the cache entry.\n * @returns {boolean} True if the entry exists, false otherwise.\n */\n checkKey(cache, key) {\n if (this._cacheMap[cache][key]) {\n return true;\n }\n return false;\n }\n\n /**\n * Checks if a URL has been resolved and cached.\n * @param {string} url - The URL to check.\n * @returns {boolean} True if the URL has been resolved and cached, false otherwise.\n */\n checkURL(url) {\n if (this._urlMap[this._resolveURL(url)]) {\n return true;\n }\n return false;\n }\n\n /**\n * Checks if a canvas cache entry exists.\n * @param {string} key - The unique key for the cache entry.\n * @returns {boolean} True if the entry exists, false otherwise.\n */\n checkCanvasKey(key) {\n return this.checkKey(CANVAS, key);\n }\n\n /**\n * Checks if an image cache entry exists.\n * @param {string} key - The unique key for the cache entry.\n * @returns {boolean} True if the entry exists, false otherwise.\n */\n checkImageKey(key) {\n return this.checkKey(IMAGE, key);\n }\n\n /**\n * Checks if a texture cache entry exists.\n * @param {string} key - The unique key for the cache entry.\n * @returns {boolean} True if the entry exists, false otherwise.\n */\n checkTextureKey(key) {\n return this.checkKey(TEXTURE, key);\n }\n\n /**\n * Checks if a sound cache entry exists.\n * @param {string} key - The unique key for the cache entry.\n * @returns {boolean} True if the entry exists, false otherwise.\n */\n checkSoundKey(key) {\n return this.checkKey(SOUND, key);\n }\n\n /**\n * Checks if a text cache entry exists.\n * @param {string} key - The unique key for the cache entry.\n * @returns {boolean} True if the entry exists, false otherwise.\n */\n checkTextKey(key) {\n return this.checkKey(TEXT, key);\n }\n\n /**\n * Checks if a bitmap data cache entry exists.\n * @param {string} key - The unique key for the cache entry.\n * @returns {boolean} True if the entry exists, false otherwise.\n */\n checkBitmapDataKey(key) {\n return this.checkKey(BITMAPDATA, key);\n }\n\n /**\n * Checks if a bitmap font cache entry exists.\n * @param {string} key - The unique key for the cache entry.\n * @returns {boolean} True if the entry exists, false otherwise.\n */\n checkBitmapFontKey(key) {\n return this.checkKey(BITMAPFONT, key);\n }\n\n /**\n * Checks if a JSON cache entry exists.\n * @param {string} key - The unique key for the cache entry.\n * @returns {boolean} True if the entry exists, false otherwise.\n */\n checkJSONKey(key) {\n return this.checkKey(JSONDATA, key);\n }\n\n /**\n * Checks if an XML cache entry exists.\n * @param {string} key - The unique key for the cache entry.\n * @returns {boolean} True if the entry exists, false otherwise.\n */\n checkXMLKey(key) {\n return this.checkKey(XML, key);\n }\n\n // GET\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @param {number} cache - TBD.\n * @param {string} method - TBD.\n * @param {string} property - TBD.\n * @returns {*} TBD.\n */\n getItem(key, cache, method, property = null) {\n if (this.checkKey(cache, key)) {\n if (!property) {\n return this._cacheMap[cache][key];\n }\n return this._cacheMap[cache][key][property];\n }\n return null;\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @returns {HTMLCanvasElement} TBD.\n */\n getCanvas(key) {\n return this.getItem(key, CANVAS, 'getCanvas', 'canvas');\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @param {boolean} full - TBD.\n * @returns {HTMLImageElement} TBD.\n */\n getImage(key = '__default', full = false) {\n let img = this.getItem(key, IMAGE, 'getImage');\n if (img === null) {\n img = this.getItem('__missing', IMAGE, 'getImage');\n }\n if (full) {\n return img;\n }\n return img.data;\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @returns {object} TBD.\n */\n getTextureFrame(key) {\n return this.getItem(key, TEXTURE, 'getTextureFrame', 'frame');\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @returns {object} TBD.\n */\n getSound(key) {\n return this.getItem(key, SOUND, 'getSound');\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @returns {object} TBD.\n */\n getSoundData(key) {\n return this.getItem(key, SOUND, 'getSoundData', 'data');\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @returns {object} TBD.\n */\n getText(key) {\n return this.getItem(key, TEXT, 'getText', 'data');\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @returns {object} TBD.\n */\n getBitmapData(key) {\n return this.getItem(key, BITMAPDATA, 'getBitmapData', 'data');\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @returns {object} TBD.\n */\n getBitmapFont(key) {\n return this.getItem(key, BITMAPFONT, 'getBitmapFont');\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @param {boolean} isClone - TBD.\n * @returns {object} TBD.\n */\n getJSON(key, isClone = false) {\n const data = this.getItem(key, JSONDATA, 'getJSON', 'data');\n return isClone ? JSON.parse(JSON.stringify(data)) : data;\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @returns {XMLDocument} TBD.\n */\n getXML(key) {\n return this.getItem(key, XML, 'getXML', 'data');\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @returns {import('../display/webgl/render_texture.js').RenderTexture} TBD.\n */\n getRenderTexture(key) {\n return this.getItem(key, RENDER_TEXTURE, 'getRenderTexture');\n }\n\n // FRAME\n\n /**\n * Gets the base texture of a cache entry.\n * @param {string} key - The unique key for the cache entry.\n * @param {number} cache - The cache type (CANVAS, IMAGE, etc.).\n * @returns {BaseTexture} The base texture.\n */\n getBaseTexture(key, cache = IMAGE) {\n return this.getItem(key, cache, 'getBaseTexture', 'base');\n }\n\n /**\n * Gets a frame from the cache.\n * @param {string} key - The unique key for the cache entry.\n * @param {number} cache - The cache type (CANVAS, IMAGE, etc.).\n * @returns {Frame} The frame.\n */\n getFrame(key, cache = IMAGE) {\n return this.getItem(key, cache, 'getFrame', 'frame');\n }\n\n /**\n * Gets the frame count of a cache entry.\n * @param {string} key - The unique key for the cache entry.\n * @param {number} cache - The cache type (CANVAS, IMAGE, etc.).\n * @returns {number} The number of frames.\n */\n getFrameCount(key, cache = IMAGE) {\n const data = this.getFrameData(key, cache);\n if (data) {\n return data.total;\n }\n return 0;\n }\n\n /**\n * Gets the frame data of a cache entry.\n * @param {string} key - The unique key for the cache entry.\n * @param {number} cache - The cache type (CANVAS, IMAGE, etc.).\n * @returns {FrameData} The frame data.\n */\n getFrameData(key, cache = IMAGE) {\n return this.getItem(key, cache, 'getFrameData', 'frameData');\n }\n\n /**\n * Checks if a cache entry has frame data.\n * @param {string} key - The unique key for the cache entry.\n * @param {number} cache - The cache type (CANVAS, IMAGE, etc.).\n * @returns {boolean} True if the entry has frame data, false otherwise.\n */\n hasFrameData(key, cache = IMAGE) {\n return this.getItem(key, cache, '', 'frameData') !== null;\n }\n\n /**\n * Updates the frame data of a cache entry.\n * @param {string} key - The unique key for the cache entry.\n * @param {FrameData} frameData - The new frame data.\n * @param {number} cache - The cache type (CANVAS, IMAGE, etc.).\n */\n updateFrameData(key, frameData, cache = IMAGE) {\n if (this._cacheMap[cache][key]) {\n this._cacheMap[cache][key].frameData = frameData;\n }\n }\n\n /**\n * Gets a frame by index from the cache.\n * @param {string} key - The unique key for the cache entry.\n * @param {number} index - The index of the frame to get.\n * @param {number} cache - The cache type (CANVAS, IMAGE, etc.).\n * @returns {Frame} The frame at the specified index.\n */\n getFrameByIndex(key, index, cache = IMAGE) {\n const data = this.getFrameData(key, cache);\n if (data) {\n return data.getFrame(index);\n }\n return null;\n }\n\n /**\n * Gets a frame by name from the cache.\n * @param {string} key - The unique key for the cache entry.\n * @param {string} name - The name of the frame to get.\n * @param {number} cache - The cache type (CANVAS, IMAGE, etc.).\n * @returns {Frame} The frame with the specified name.\n */\n getFrameByName(key, name, cache = IMAGE) {\n const data = this.getFrameData(key, cache);\n if (data) {\n return data.getFrameByName(name);\n }\n return null;\n }\n\n /**\n * Gets the resolved URL from cache.\n * @param {string} url - The original URL to resolve.\n * @returns {string} The resolved URL or null if not found.\n */\n getURL(url) {\n const resolvedURL = this._resolveURL(url);\n if (resolvedURL) {\n return this._urlMap[resolvedURL];\n }\n this.game.logger.warn('Cache invalid url', { resolvedURL });\n return null;\n }\n\n /**\n * Gets all keys from a cache type.\n * @param {object} cache - The cache type (CANVAS, IMAGE, etc.).\n * @returns {string[]} An array of cache keys.\n */\n getKeys(cache = IMAGE) {\n const result = [];\n if (this._cacheMap[cache]) {\n const keys = Object.keys(this._cacheMap[cache]);\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i];\n if (key !== '__default' && key !== '__missing') {\n result.push(key);\n }\n }\n }\n return result;\n }\n\n // REMOVE\n\n /**\n * Removes a canvas cache entry.\n * @param {string} key - The unique key for the cache entry to remove.\n */\n removeCanvas(key) {\n delete this._cache.canvas[key];\n }\n\n /**\n * Removes an image cache entry.\n * @param {string} key - The unique key for the cache entry to remove.\n * @param {boolean} destroyBaseTexture - Whether to destroy the base texture (default: true).\n */\n removeImage(key, destroyBaseTexture = true) {\n const img = this.getImage(key, true);\n if (destroyBaseTexture && img.base) {\n img.base.destroy();\n }\n delete this._cache.image[key];\n }\n\n /**\n * Removes a sound cache entry.\n * @param {string} key - The unique key for the cache entry to remove.\n */\n removeSound(key) {\n delete this._cache.sound[key];\n }\n\n /**\n * Removes a text cache entry.\n * @param {string} key - The unique key for the cache entry to remove.\n */\n removeText(key) {\n delete this._cache.text[key];\n }\n\n /**\n * Removes a bitmap data cache entry.\n * @param {string} key - The unique key for the cache entry to remove.\n */\n removeBitmapData(key) {\n delete this._cache.bitmapData[key];\n }\n\n /**\n * Removes a bitmap font cache entry.\n * @param {string} key - The unique key for the cache entry to remove.\n */\n removeBitmapFont(key) {\n delete this._cache.bitmapFont[key];\n }\n\n /**\n * Removes a JSON cache entry.\n * @param {string} key - The unique key for the cache entry to remove.\n */\n removeJSON(key) {\n delete this._cache.json[key];\n }\n\n /**\n * Removes an XML cache entry.\n * @param {string} key - The unique key for the cache entry to remove.\n */\n removeXML(key) {\n delete this._cache.xml[key];\n }\n\n /**\n * Removes a render texture cache entry.\n * @param {string} key - The unique key for the cache entry to remove.\n */\n removeRenderTexture(key) {\n delete this._cache.renderTexture[key];\n }\n\n /**\n * Removes a sprite sheet cache entry.\n * @param {string} key - The unique key for the cache entry to remove.\n */\n removeSpriteSheet(key) {\n delete this._cache.spriteSheet[key];\n }\n\n /**\n * Removes a texture atlas cache entry.\n * @param {string} key - The unique key for the cache entry to remove.\n */\n removeTextureAtlas(key) {\n delete this._cache.atlas[key];\n }\n\n /**\n * Clears all GL textures from the cache.\n */\n clearGLTextures() {\n const keys = Object.keys(this._cache.image);\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i];\n this._cache.image[key].base._glTextures = [];\n }\n }\n\n /**\n * Resolves a URL and stores it in the cache.\n * @param {string} url - The URL to resolve.\n * @param {object} data - The data to associate with the resolved URL.\n * @returns {string} The resolved URL or null if not enabled.\n */\n _resolveURL(url, data) {\n if (!this.autoResolveURL) {\n return null;\n }\n this._urlResolver.src = this.game.load.baseURL + url;\n this._urlTemp = this._urlResolver.src;\n // Ensure no request is actually made\n this._urlResolver.src = '';\n // Record the URL to the map\n if (data) {\n this._urlMap[this._urlTemp] = data;\n }\n return this._urlTemp;\n }\n\n /**\n * Destroys the cache and cleans up resources.\n */\n destroy() {\n for (let i = 0; i < this._cacheMap.length; i += 1) {\n const cache = this._cacheMap[i];\n const keys = cache ? Object.keys(cache) : [];\n for (let j = 0; j < keys.length; j += 1) {\n const key = keys[j];\n if (key !== '__default' && key !== '__missing') {\n if (cache[key].destroy) {\n cache[key].destroy();\n }\n delete cache[key];\n }\n }\n }\n this._urlMap = null;\n this._urlResolver = null;\n this._urlTemp = null;\n }\n}","// @ts-nocheck\nexport class Device {\n /**\n * Creates a new Device instance.\n * This class provides information about the current device and browser capabilities.\n */\n constructor() {\n /**\n * @type {boolean}\n */\n this.desktop = false;\n /**\n * @type {boolean}\n */\n this.iOS = false;\n /**\n * @type {boolean}\n */\n this.android = false;\n /**\n * @type {boolean}\n */\n this.chromeOS = false;\n /**\n * @type {boolean}\n */\n this.linux = false;\n /**\n * @type {boolean}\n */\n this.macOS = false;\n /**\n * @type {boolean}\n */\n this.windows = false;\n /**\n * @type {boolean}\n */\n this.windowsPhone = false;\n /**\n * @type {boolean}\n */\n this.canvas = false;\n /**\n * @type {boolean}\n */\n this.touch = false;\n /**\n * @type {boolean}\n */\n this.mspointer = false;\n this.wheelEvent = null;\n /**\n * @type {boolean}\n */\n this.chrome = false;\n /**\n * @type {boolean}\n */\n this.firefox = false;\n /**\n * @type {boolean}\n */\n this.edge = false;\n /**\n * @type {boolean}\n */\n this.safari = false;\n /**\n * @type {boolean}\n */\n this.fullscreen = false;\n /**\n * @type {string}\n */\n this.requestFullscreen = '';\n /**\n * @type {string}\n */\n this.cancelFullscreen = '';\n /**\n * @type {boolean}\n */\n this.fullscreenKeyboard = false;\n /**\n * @type {boolean}\n */\n this.noAudioFormat = false;\n /**\n * @type {{[key: string]: boolean}}\n */\n this.supportedAudioFormats = {};\n /**\n * @type {{[key: string]: boolean}}\n */\n this.supportedImageFormats = {};\n }\n}","import { Logger } from '@vpmedia/simplify';\nimport { Device } from './device.js';\n\nconst logger = new Logger('device');\n\n/**\n * Check if the device can play a specific audio format.\n * @param {Device} device - The device instance to check.\n * @param {string} type - The audio format type to check.\n * @returns {boolean} True if the device can play this audio format, false otherwise.\n */\nexport const canPlayAudio = (device, type) => {\n return device.supportedAudioFormats[type] === true;\n};\n\n/**\n * Detect the operating system of the device.\n * @param {Device} device - The device instance to update.\n */\nexport const checkOS = (device) => {\n const ua = navigator.userAgent;\n if (/Android/.test(ua)) {\n device.android = true;\n } else if (/CrOS/.test(ua)) {\n device.chromeOS = true;\n } else if (/iP[ao]d|iPhone/i.test(ua)) {\n device.iOS = true;\n } else if (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) {\n device.iOS = true;\n } else if (/Mac OS/.test(ua)) {\n device.macOS = true;\n } else if (/Linux/.test(ua)) {\n device.linux = true;\n } else if (/Windows/.test(ua)) {\n device.windows = true;\n }\n if (/Windows Phone/i.test(ua) || /IEMobile/i.test(ua)) {\n device.android = false;\n device.iOS = false;\n device.macOS = false;\n device.windows = true;\n device.windowsPhone = true;\n }\n if (device.windows || device.macOS || device.linux || device.chromeOS) {\n device.desktop = true;\n }\n // iOS / Windows Phone / Tablet reset\n if (device.android || device.iOS || device.windowsPhone || (/Windows NT/i.test(ua) && /Touch/i.test(ua))) {\n device.desktop = false;\n }\n};\n\n/**\n * Detect input capabilities of the device.\n * @param {Device} device - The device instance to update.\n */\nexport const checkInput = (device) => {\n if (\n 'ontouchstart' in document.documentElement ||\n (window.navigator.maxTouchPoints && window.navigator.maxTouchPoints >= 1)\n ) {\n device.touch = true;\n }\n // if (window.navigator.msPointerEnabled || window.navigator.pointerEnabled) {\n // device.mspointer = true;\n // }\n // See https://developer.mozilla.org/en-US/docs/Web/Events/wheel\n if ('onwheel' in window || 'WheelEvent' in window) {\n device.wheelEvent = 'wheel';\n }\n};\n\n/**\n * Check for fullscreen support capabilities.\n * @param {Device} device - The device instance to update.\n */\nexport const checkFullScreenSupport = (device) => {\n const fs = [\n 'requestFullscreen',\n 'requestFullScreen',\n 'webkitRequestFullscreen',\n 'webkitRequestFullScreen',\n 'msRequestFullscreen',\n 'msRequestFullScreen',\n 'mozRequestFullScreen',\n 'mozRequestFullscreen',\n ];\n const cfs = [\n 'cancelFullScreen',\n 'exitFullscreen',\n 'webkitCancelFullScreen',\n 'webkitExitFullscreen',\n 'msCancelFullScreen',\n 'msExitFullscreen',\n 'mozCancelFullScreen',\n 'mozExitFullscreen',\n ];\n const element = document.createElement('div');\n for (let i = 0; i < fs.length; i += 1) {\n if (element[fs[i]]) {\n device.fullscreen = true;\n device.requestFullscreen = fs[i];\n break;\n }\n }\n if (device.fullscreen) {\n for (let i = 0; i < cfs.length; i += 1) {\n if (document[cfs[i]]) {\n device.cancelFullscreen = cfs[i];\n break;\n }\n }\n // @ts-ignore\n if (window.Element && Element.ALLOW_KEYBOARD_INPUT) {\n device.fullscreenKeyboard = true;\n }\n }\n};\n\n/**\n * Detect the browser type.\n * @param {Device} device - The device instance to update.\n */\nexport const checkBrowser = (device) => {\n const ua = navigator.userAgent;\n if (/Edge\\/\\d+/.test(ua)) {\n device.edge = true;\n } else if (/Chrome\\/(\\d+)/.test(ua) && !device.windowsPhone) {\n device.chrome = true;\n } else if (/Firefox\\D+(\\d+)/.test(ua)) {\n device.firefox = true;\n } else if (/Safari\\/(\\d+)/.test(ua) && !device.windowsPhone) {\n device.safari = true;\n }\n};\n\n/**\n * Check if an audio element can play a specific codec.\n * @param {HTMLAudioElement} audioElement - The audio element to test.\n * @param {string} type - The codec type to check.\n * @returns {boolean} True if the codec is supported, false otherwise.\n */\nexport const canPlayType = (audioElement, type) => {\n try {\n const canPlayResult = audioElement.canPlayType(type);\n return canPlayResult === 'maybe' || canPlayResult === 'probably';\n } catch (error) {\n const typedError = error instanceof Error ? error : new Error(String(error));\n logger.exception(`canPlayType error with type: ${type}`, typedError);\n return false;\n }\n};\n\n/**\n * Check if a media source type is supported by the browser.\n * @param {string} type - The media source type to check.\n * @returns {boolean} True if the media source type is supported, false otherwise.\n */\nexport const isMediaSourceTypeSupported = (type) => {\n if ('MediaSource' in window) {\n try {\n return MediaSource.isTypeSupported(type);\n } catch (error) {\n const typedError = error instanceof Error ? error : new Error(String(error));\n logger.exception(`MediaSource.isTypeSupported error with type: ${type}`, typedError);\n return false;\n }\n }\n return false;\n};\n\n/**\n * Check for supported audio formats on the device.\n * @param {Device} device - The device instance to update with audio format support.\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types/Common_types\n * @see https://developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements\n * @see https://bit.ly/iphoneoscodecs\n */\nexport const checkAudio = (device) => {\n const audioElement = document.createElement('audio');\n const formats = [\n { type: 'ogg', codecs: ['audio/ogg; codecs=\"vorbis\"'] },\n { type: 'opus', codecs: ['audio/opus', 'audio/ogg; codecs=\"opus\"'] },\n { type: 'mp3', codecs: ['audio/mpeg', 'audio/mp3', 'audio/x-mp3', 'audio/mpeg3', 'audio/x-mpeg3'] },\n { type: 'wav', codecs: ['audio/wav', 'audio/x-wav'] },\n { type: 'm4a', codecs: ['audio/aac', 'audio/x-m4a'] },\n { type: 'webm', codecs: ['audio/webm'] },\n { type: 'mp4', codecs: ['audio/mp4'] },\n ];\n for (const format of formats) {\n const { type, codecs } = format;\n for (const codec of codecs) {\n if (!device.supportedAudioFormats[type]) {\n const isSupported = isMediaSourceTypeSupported(codec) || canPlayType(audioElement, codec);\n if (isSupported) {\n device.supportedAudioFormats[type] = isSupported;\n }\n }\n }\n }\n if (Object.keys(device.supportedAudioFormats).length === 0) {\n logger.warn('No audio format support detected');\n device.noAudioFormat = true;\n }\n};\n\n/**\n * Check for supported image formats on the device.\n * @param {Device} device - The device instance to update with image format support.\n */\nexport const checkImage = (device) => {\n try {\n const avif = new Image();\n avif.src =\n 'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=';\n avif.onload = function () {\n device.supportedImageFormats.avif = true;\n };\n } catch (error) {\n const typedError = error instanceof Error ? error : new Error(String(error));\n logger.exception('checkImage error with avif', typedError);\n }\n try {\n const webp = new Image();\n webp.src = 'data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=';\n webp.onload = function () {\n device.supportedImageFormats.webp = true;\n };\n } catch (error) {\n const typedError = error instanceof Error ? error : new Error(String(error));\n logger.exception('checkImage error with webp', typedError);\n }\n};\n\n/**\n * Initialize device capabilities detection.\n * @param {Device} device - The device instance to initialize.\n */\nexport const initialize = (device) => {\n logger.info('initialize');\n checkOS(device);\n checkBrowser(device);\n checkAudio(device);\n // checkImage(device);\n checkFullScreenSupport(device);\n checkInput(device);\n};\n\n/**\n * Create a new Device instance.\n * @returns {Device} A new Device instance.\n */\nexport const createDevice = () => {\n return new Device();\n};\n","export class ArraySet {\n position: number;\n list: any[];\n\n /**\n * TBD.\n * @param {object[]} list - TBD.\n */\n constructor(list: any[] = []) {\n this.position = 0;\n this.list = list;\n }\n\n /**\n * TBD.\n * @param {object} item - TBD.\n * @returns {object} TBD.\n */\n add(item) {\n if (!this.exists(item)) {\n this.list.push(item);\n }\n return item;\n }\n\n /**\n * TBD.\n * @param {object} item - TBD.\n * @returns {number} TBD.\n */\n getIndex(item) {\n return this.list.indexOf(item);\n }\n\n /**\n * TBD.\n * @param {string} property - TBD.\n * @param {object} value - TBD.\n * @returns {object} TBD.\n */\n getByKey(property, value) {\n let i = this.list.length;\n while (i) {\n i -= 1;\n if (this.list[i][property] === value) {\n return this.list[i];\n }\n }\n return null;\n }\n\n /**\n * TBD.\n * @param {object} item - TBD.\n * @returns {boolean} TBD.\n */\n exists(item) {\n return this.list.indexOf(item) > -1;\n }\n\n /**\n * TBD.\n */\n reset() {\n this.list.length = 0;\n }\n\n /**\n * TBD.\n * @param {object} item - TBD.\n * @returns {object} TBD.\n */\n remove(item) {\n const idx = this.list.indexOf(item);\n if (idx !== -1) {\n this.list.splice(idx, 1);\n return item;\n }\n return null;\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @param {object} value - TBD.\n */\n setAll(key, value) {\n let i = this.list.length;\n while (i) {\n i -= 1;\n if (this.list[i]) {\n this.list[i][key] = value;\n }\n }\n }\n\n /**\n * TBD.\n * @param {string} key - TBD.\n * @param {...any} args - TBD.\n */\n callAll(key, ...args) {\n let i = this.list.length;\n while (i) {\n i -= 1;\n if (this.list[i] && this.list[i][key]) {\n this.list[i][key].apply(this.list[i], args);\n }\n }\n }\n\n /**\n * TBD.\n * @param {boolean} destroy - TBD.\n */\n removeAll(destroy = false) {\n let i = this.list.length;\n while (i) {\n i -= 1;\n if (this.list[i]) {\n const item = this.remove(this.list[i]);\n if (destroy) {\n item.destroy();\n }\n }\n }\n this.position = 0;\n this.list = [];\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get total() {\n return this.list.length;\n }\n\n /**\n * TBD.\n * @returns {object} TBD.\n */\n get first() {\n this.position = 0;\n if (this.list.length > 0) {\n return this.list[0];\n }\n return null;\n }\n\n /**\n * TBD.\n * @returns {object} TBD.\n */\n get next() {\n if (this.position < this.list.length) {\n this.position += 1;\n return this.list[this.position];\n }\n return null;\n }\n}\n","// @ts-nocheck\n/* const NO_BUTTON = -1;\nconst LEFT_BUTTON = 0;\nconst MIDDLE_BUTTON = 1;\nconst RIGHT_BUTTON = 2;\nconst BACK_BUTTON = 3;\nconst FORWARD_BUTTON = 4;\nconst WHEEL_UP = 1;\nconst WHEEL_DOWN = -1; */\n\nclass WheelEventProxy {\n /**\n * TBD.\n * @param {number} scaleFactor - TBD.\n * @param {number} deltaMode - TBD.\n */\n constructor(scaleFactor, deltaMode) {\n this._scaleFactor = scaleFactor;\n this._deltaMode = deltaMode;\n this.originalEvent = null;\n this.type = 'wheel';\n this.deltaZ = { value: 0 };\n }\n\n /**\n * TBD.\n * @param {WheelEvent} event - TBD.\n * @returns {WheelEventProxy} TBD.\n */\n bindEvent(event) {\n // TODO\n console.warn('input_mouse.bindEvent() is not implemented');\n /*\n if (!window.PhaserRegistry.isMouseWheelEventBinded && event) {\n const makeBinder = (name) => {\n return () => {\n const v = this.originalEvent[name];\n return typeof v !== 'function' ? v : v.bind(this.originalEvent);\n };\n };\n window.PhaserRegistry.isMouseWheelEventBinded = true;\n }\n */\n this.originalEvent = event;\n return this;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get deltaMode() {\n return this._deltaMode;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get deltaY() {\n return this._scaleFactor * (this.originalEvent.wheelDelta || this.originalEvent.detail) || 0;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get deltaX() {\n return this._scaleFactor * this.originalEvent.wheelDeltaX || 0;\n }\n}\n\nexport class Mouse {\n /**\n * TBD.\n * @param {import('./game.js').Game} game - TBD.\n */\n constructor(game) {\n this.game = game;\n this.input = game.input;\n this.callbackContext = this.game;\n this.mouseDownCallback = null;\n this.mouseUpCallback = null;\n this.mouseOutCallback = null;\n this.mouseOverCallback = null;\n this.mouseWheelCallback = null;\n this.mouseMoveCallback = null;\n this.capture = false;\n this.button = -1;\n this.wheelDelta = 0;\n this.enabled = true;\n this.locked = false;\n this.stopOnGameOut = false;\n this.event = null;\n this._onMouseDown = null;\n this._onMouseMove = null;\n this._onMouseUp = null;\n this._onMouseOut = null;\n this._onMouseOver = null;\n this._onMouseWheel = null;\n this._wheelEvent = null;\n }\n\n /**\n * TBD.\n */\n start() {\n if (this.game.device.android && this.game.device.chrome === false) {\n // Android stock browser fires mouse events even if you preventDefault on the touchStart, so ...\n return;\n }\n if (this._onMouseDown !== null) {\n // Avoid setting multiple listeners\n return;\n }\n const scope = this;\n this._onMouseDown = (event) => scope.onMouseDown(event);\n this._onMouseMove = (event) => scope.onMouseMove(event);\n this._onMouseUp = (event) => scope.onMouseUp(event);\n this._onMouseUpGlobal = (event) => scope.onMouseUpGlobal(event);\n this._onMouseOutGlobal = (event) => scope.onMouseOutGlobal(event);\n this._onMouseOut = (event) => scope.onMouseOut(event);\n this._onMouseOver = (event) => scope.onMouseOver(event);\n this._onMouseWheel = (event) => scope.onMouseWheel(event);\n const canvas = this.game.canvas;\n canvas.addEventListener('mousedown', this._onMouseDown, true);\n canvas.addEventListener('mousemove', this._onMouseMove, true);\n canvas.addEventListener('mouseup', this._onMouseUp, true);\n window.addEventListener('mouseup', this._onMouseUpGlobal, true);\n window.addEventListener('mouseout', this._onMouseOutGlobal, true);\n canvas.addEventListener('mouseover', this._onMouseOver, true);\n canvas.addEventListener('mouseout', this._onMouseOut, true);\n const wheelEvent = this.game.device.wheelEvent;\n if (wheelEvent) {\n canvas.addEventListener(wheelEvent, this._onMouseWheel, true);\n }\n }\n\n /**\n * TBD.\n */\n stop() {\n const canvas = this.game.canvas;\n canvas.removeEventListener('mousedown', this._onMouseDown, true);\n canvas.removeEventListener('mousemove', this._onMouseMove, true);\n canvas.removeEventListener('mouseup', this._onMouseUp, true);\n canvas.removeEventListener('mouseover', this._onMouseOver, true);\n canvas.removeEventListener('mouseout', this._onMouseOut, true);\n const wheelEvent = this.game.device.wheelEvent;\n if (wheelEvent) {\n canvas.removeEventListener(wheelEvent, this._onMouseWheel, true);\n }\n window.removeEventListener('mouseup', this._onMouseUpGlobal, true);\n window.removeEventListener('mouseout', this._onMouseOutGlobal, true);\n }\n\n /**\n * TBD.\n * @param {MouseEvent} event - TBD.\n */\n onMouseDown(event) {\n this.event = event;\n this.eventPreventDefault(event);\n if (this.mouseDownCallback) {\n this.mouseDownCallback.call(this.callbackContext, event);\n }\n if (!this.input.enabled || !this.enabled) {\n return;\n }\n event.identifier = 0;\n this.input.mousePointer.start(event);\n }\n\n /**\n * TBD.\n * @param {MouseEvent} event - TBD.\n */\n onMouseMove(event) {\n this.event = event;\n this.eventPreventDefault(event);\n if (this.mouseMoveCallback) {\n this.mouseMoveCallback.call(this.callbackContext, event);\n }\n if (!this.input.enabled || !this.enabled) {\n return;\n }\n event.identifier = 0;\n this.input.mousePointer.move(event);\n }\n\n /**\n * TBD.\n * @param {MouseEvent} event - TBD.\n */\n onMouseUp(event) {\n this.event = event;\n this.eventPreventDefault(event);\n if (this.mouseUpCallback) {\n this.mouseUpCallback.call(this.callbackContext, event);\n }\n if (!this.input.enabled || !this.enabled) {\n return;\n }\n event.identifier = 0;\n this.input.mousePointer.stop(event);\n }\n\n /**\n * TBD.\n * @param {MouseEvent} event - TBD.\n */\n onMouseUpGlobal(event) {\n if (!this.input.mousePointer.withinGame) {\n if (this.mouseUpCallback) {\n this.mouseUpCallback.call(this.callbackContext, event);\n }\n event.identifier = 0;\n this.input.mousePointer.stop(event);\n }\n }\n\n /**\n * TBD.\n * @param {MouseEvent} event - TBD.\n */\n onMouseOutGlobal(event) {\n this.event = event;\n this.eventPreventDefault(event);\n this.input.mousePointer.withinGame = false;\n if (!this.input.enabled || !this.enabled) {\n return;\n }\n // If we get a mouseout event from the window then basically\n // something serious has gone down, usually along the lines of\n // the browser opening a context-menu or similar.\n // On OS X Chrome especially this is bad news, as it blocks\n // us then getting a mouseup event, so we need to force that through.\n this.input.mousePointer.stop(event);\n }\n\n /**\n * TBD.\n * @param {MouseEvent} event - TBD.\n */\n onMouseOut(event) {\n this.event = event;\n this.eventPreventDefault(event);\n this.input.mousePointer.withinGame = false;\n if (this.mouseOutCallback) {\n this.mouseOutCallback.call(this.callbackContext, event);\n }\n if (!this.input.enabled || !this.enabled) {\n return;\n }\n if (this.stopOnGameOut) {\n event.identifier = 0;\n this.input.mousePointer.stop(event);\n }\n }\n\n /**\n * TBD.\n * @param {MouseEvent} event - TBD.\n */\n onMouseOver(event) {\n this.event = event;\n this.eventPreventDefault(event);\n this.input.mousePointer.withinGame = true;\n if (this.mouseOverCallback) {\n this.mouseOverCallback.call(this.callbackContext, event);\n }\n }\n\n /**\n * TBD.\n * @param {WheelEvent} event - TBD.\n */\n onMouseWheel(event) {\n if (this._wheelEvent) {\n event = this._wheelEvent.bindEvent(event);\n }\n this.event = event;\n this.eventPreventDefault(event);\n // reverse detail for firefox\n this.wheelDelta = Math.max(-1, Math.min(1, -event.deltaY));\n if (this.mouseWheelCallback) {\n this.mouseWheelCallback.call(this.callbackContext, event);\n }\n }\n\n /**\n * TBD.\n * @param {MouseEvent} event - TBD.\n */\n eventPreventDefault(event) {\n if (this.capture) {\n if (typeof event.cancelable !== 'boolean' || event.cancelable) {\n event.preventDefault();\n }\n }\n }\n}\n","// @ts-nocheck\nexport class MSPointer {\n /**\n * TBD.\n * @param {import('./game.js').Game} game - TBD.\n */\n constructor(game) {\n this.game = game;\n this.input = game.input;\n this.callbackContext = this.game;\n this.pointerDownCallback = null;\n this.pointerMoveCallback = null;\n this.pointerUpCallback = null;\n this.capture = true;\n this.button = -1;\n this.event = null;\n this.enabled = true;\n this._onMSPointerDown = null;\n this._onMSPointerMove = null;\n this._onMSPointerUp = null;\n this._onMSPointerUpGlobal = null;\n this._onMSPointerOut = null;\n this._onMSPointerOver = null;\n }\n\n /**\n * TBD.\n */\n start() {\n if (!this.game.device.mspointer || this._onMSPointerDown !== null) {\n return;\n }\n const scope = this;\n this._onMSPointerDown = (event) => scope.onPointerDown(event);\n this._onMSPointerMove = (event) => scope.onPointerMove(event);\n this._onMSPointerUp = (event) => scope.onPointerUp(event);\n this._onMSPointerUpGlobal = (event) => scope.onPointerUpGlobal(event);\n this._onMSPointerOut = (event) => scope.onPointerOut(event);\n this._onMSPointerOver = (event) => scope.onPointerOver(event);\n const canvas = this.game.canvas;\n canvas.addEventListener('MSPointerDown', this._onMSPointerDown, false);\n canvas.addEventListener('MSPointerMove', this._onMSPointerMove, false);\n canvas.addEventListener('MSPointerUp', this._onMSPointerUp, false);\n // IE11+ uses non-prefix events\n canvas.addEventListener('pointerdown', this._onMSPointerDown, false);\n canvas.addEventListener('pointermove', this._onMSPointerMove, false);\n canvas.addEventListener('pointerup', this._onMSPointerUp, false);\n canvas.style['-ms-content-zooming'] = 'none';\n canvas.style['-ms-touch-action'] = 'none';\n window.addEventListener('MSPointerUp', this._onMSPointerUpGlobal, true);\n canvas.addEventListener('MSPointerOver', this._onMSPointerOver, true);\n canvas.addEventListener('MSPointerOut', this._onMSPointerOut, true);\n // IE11+ uses non-prefix events\n window.addEventListener('pointerup', this._onMSPointerUpGlobal, true);\n canvas.addEventListener('pointerover', this._onMSPointerOver, true);\n canvas.addEventListener('pointerout', this._onMSPointerOut, true);\n }\n\n /**\n * TBD.\n */\n stop() {\n if (!this.game.device.mspointer) {\n return;\n }\n const canvas = this.game.canvas;\n canvas.removeEventListener('MSPointerDown', this._onMSPointerDown, false);\n canvas.removeEventListener('MSPointerMove', this._onMSPointerMove, false);\n canvas.removeEventListener('MSPointerUp', this._onMSPointerUp, false);\n // IE11+ uses non-prefix events\n canvas.removeEventListener('pointerdown', this._onMSPointerDown, false);\n canvas.removeEventListener('pointermove', this._onMSPointerMove, false);\n canvas.removeEventListener('pointerup', this._onMSPointerUp, false);\n window.removeEventListener('MSPointerUp', this._onMSPointerUpGlobal, true);\n canvas.removeEventListener('MSPointerOver', this._onMSPointerOver, true);\n canvas.removeEventListener('MSPointerOut', this._onMSPointerOut, true);\n // IE11+ uses non-prefix events\n window.removeEventListener('pointerup', this._onMSPointerUpGlobal, true);\n canvas.removeEventListener('pointerover', this._onMSPointerOver, true);\n canvas.removeEventListener('pointerout', this._onMSPointerOut, true);\n }\n\n /**\n * TBD.\n * @param {PointerEvent} event - TBD.\n */\n onPointerDown(event) {\n this.event = event;\n this.eventPreventDefault(event);\n if (this.pointerDownCallback) {\n this.pointerDownCallback.call(this.callbackContext, event);\n }\n if (!this.input.enabled || !this.enabled) {\n return;\n }\n event.identifier = event.pointerId;\n if (event.pointerType === 'mouse' || event.pointerType === 0x00000004) {\n this.input.mousePointer.start(event);\n } else {\n this.input.startPointer(event);\n }\n }\n\n /**\n * TBD.\n * @param {PointerEvent} event - TBD.\n */\n onPointerMove(event) {\n this.event = event;\n this.eventPreventDefault(event);\n if (this.pointerMoveCallback) {\n this.pointerMoveCallback.call(this.callbackContext, event);\n }\n if (!this.input.enabled || !this.enabled) {\n return;\n }\n event.identifier = event.pointerId;\n if (event.pointerType === 'mouse' || event.pointerType === 0x00000004) {\n this.input.mousePointer.move(event);\n } else {\n this.input.updatePointer(event);\n }\n }\n\n /**\n * TBD.\n * @param {PointerEvent} event - TBD.\n */\n onPointerUp(event) {\n this.event = event;\n this.eventPreventDefault(event);\n if (this.pointerUpCallback) {\n this.pointerUpCallback.call(this.callbackContext, event);\n }\n if (!this.input.enabled || !this.enabled) {\n return;\n }\n event.identifier = event.pointerId;\n if (event.pointerType === 'mouse' || event.pointerType === 0x00000004) {\n this.input.mousePointer.stop(event);\n } else {\n this.input.stopPointer(event);\n }\n }\n\n /**\n * TBD.\n * @param {PointerEvent} event - TBD.\n */\n onPointerUpGlobal(event) {\n if ((event.pointerType === 'mouse' || event.pointerType === 0x00000004) && !this.input.mousePointer.withinGame) {\n this.onPointerUp(event);\n } else {\n const pointer = this.input.getPointerFromIdentifier(event.identifier);\n if (pointer && pointer.withinGame) {\n this.onPointerUp(event);\n }\n }\n }\n\n /**\n * TBD.\n * @param {PointerEvent} event - TBD.\n */\n onPointerOut(event) {\n this.event = event;\n this.eventPreventDefault(event);\n let pointer;\n if (event.pointerType === 'mouse' || event.pointerType === 0x00000004) {\n this.input.mousePointer.withinGame = false;\n } else {\n pointer = this.input.getPointerFromIdentifier(event.identifier);\n if (pointer) {\n pointer.withinGame = false;\n }\n }\n if (this.input.mouse.mouseOutCallback) {\n this.input.mouse.mouseOutCallback.call(this.input.mouse.callbackContext, event);\n }\n if (!this.input.enabled || !this.enabled) {\n return;\n }\n if (this.input.mouse.stopOnGameOut) {\n event.identifier = 0;\n if (pointer) {\n pointer.stop(event);\n } else {\n this.input.mousePointer.stop(event);\n }\n }\n }\n\n /**\n * TBD.\n * @param {PointerEvent} event - TBD.\n */\n onPointerOver(event) {\n this.event = event;\n this.eventPreventDefault(event);\n if (event.pointerType === 'mouse' || event.pointerType === 0x00000004) {\n this.input.mousePointer.withinGame = true;\n } else {\n const pointer = this.input.getPointerFromIdentifier(event.identifier);\n if (pointer) {\n pointer.withinGame = true;\n }\n }\n if (this.input.mouse.mouseOverCallback) {\n this.input.mouse.mouseOverCallback.call(this.input.mouse.callbackContext, event);\n }\n }\n\n /**\n * TBD.\n * @param {Event} event - TBD.\n */\n eventPreventDefault(event) {\n if (this.capture) {\n if (typeof event.cancelable !== 'boolean' || event.cancelable) {\n event.preventDefault();\n }\n }\n }\n}\n","// @ts-nocheck\nimport { Circle } from '../geom/circle.js';\nimport { Point } from '../geom/point.js';\nimport {\n MOUSE_OVERRIDES_TOUCH,\n MOUSE_TOUCH_COMBINE,\n POINTER,\n POINTER_CONTACT,\n POINTER_CURSOR,\n TOUCH_OVERRIDES_MOUSE,\n} from './const.js';\n\nexport class Pointer {\n /**\n * TBD.\n * @param {import('./game.js').Game} game - TBD.\n * @param {number} id - TBD.\n * @param {number} pointerMode - TBD.\n */\n constructor(game, id, pointerMode) {\n this.game = game;\n this.id = id;\n /** @type {number} */\n this.type = POINTER;\n this.exists = true;\n /** @type {number} */\n this.identifier = 0;\n this.pointerId = null;\n this.pointerMode = pointerMode || POINTER_CURSOR | POINTER_CONTACT;\n this.target = null;\n this.button = null;\n this._holdSent = false;\n this._history = [];\n /** @type {number} */\n this._nextDrop = 0;\n this._stateReset = false;\n this.withinGame = false;\n this.clientX = -1;\n /** @type {number} */\n this.clientY = -1;\n /** @type {number} */\n this.pageX = -1;\n /** @type {number} */\n this.pageY = -1;\n /** @type {number} */\n this.screenX = -1;\n /** @type {number} */\n this.screenY = -1;\n /** @type {number} */\n this.rawMovementX = 0;\n /** @type {number} */\n this.rawMovementY = 0;\n /** @type {number} */\n this.movementX = 0;\n /** @type {number} */\n this.movementY = 0;\n /** @type {number} */\n this.x = -1;\n /** @type {number} */\n this.y = -1;\n this.isMouse = id === 0;\n this.isDown = false;\n this.isUp = true;\n /** @type {number} */\n this.timeDown = 0;\n /** @type {number} */\n this.timeUp = 0;\n /** @type {number} */\n this.previousTapTime = 0;\n /** @type {number} */\n this.totalTouches = 0;\n this.msSinceLastClick = Number.MAX_VALUE;\n this.targetObject = null;\n this.interactiveCandidates = [];\n this.active = false;\n this.dirty = false;\n this.position = new Point();\n this.positionDown = new Point();\n this.positionUp = new Point();\n this.circle = new Circle(0, 0, 44);\n this._clickTrampolines = null;\n this._trampolineTargetObject = null;\n }\n\n /**\n * TBD.\n */\n resetButtons() {\n this.isDown = false;\n this.isUp = true;\n }\n\n /**\n * TBD.\n * @param {MouseEvent|PointerEvent} event - TBD.\n */\n updateButtons(event) {\n if (event.type.toLowerCase().substr(-4) === 'down') {\n this.isUp = false;\n this.isDown = true;\n } else {\n this.isUp = true;\n this.isDown = false;\n }\n }\n\n /**\n * TBD.\n * @param {PointerEvent} event - TBD.\n * @returns {Pointer} TBD.\n */\n start(event) {\n const input = this.game.input;\n if (event.pointerId) {\n this.pointerId = event.pointerId;\n }\n this.identifier = event.identifier;\n this.target = event.target;\n if (this.isMouse) {\n this.updateButtons(event);\n } else {\n this.isDown = true;\n this.isUp = false;\n }\n this.active = true;\n this.withinGame = true;\n this.dirty = false;\n this._history = [];\n this._clickTrampolines = null;\n this._trampolineTargetObject = null;\n // Work out how long it has been since the last click\n this.msSinceLastClick = this.game.time.time - this.timeDown;\n this.timeDown = this.game.time.time;\n this._holdSent = false;\n // This sets the x/y and other local values\n this.move(event, true);\n // x and y are the old values here?\n this.positionDown.setTo(this.x, this.y);\n if (\n input.multiInputOverride === MOUSE_OVERRIDES_TOUCH ||\n input.multiInputOverride === MOUSE_TOUCH_COMBINE ||\n (input.multiInputOverride === TOUCH_OVERRIDES_MOUSE && input.totalActivePointers === 0)\n ) {\n input.x = this.x;\n input.y = this.y;\n input.position.setTo(this.x, this.y);\n input.onDown.dispatch(this, event);\n input.resetSpeed(this.x, this.y);\n }\n this._stateReset = false;\n this.totalTouches += 1;\n if (this.targetObject !== null) {\n this.targetObject._touchedHandler(this);\n }\n return this;\n }\n\n /**\n * TBD.\n */\n update() {\n const input = this.game.input;\n if (this.active) {\n // Force a check?\n if (this.dirty) {\n if (input.interactiveItems.total > 0) {\n this.processInteractiveObjects(false);\n }\n this.dirty = false;\n }\n if (this._holdSent === false && this.duration >= input.holdRate) {\n if (\n input.multiInputOverride === MOUSE_OVERRIDES_TOUCH ||\n input.multiInputOverride === MOUSE_TOUCH_COMBINE ||\n (input.multiInputOverride === TOUCH_OVERRIDES_MOUSE && input.totalActivePointers === 0)\n ) {\n input.onHold.dispatch(this);\n }\n this._holdSent = true;\n }\n // Update the droppings history\n if (input.recordPointerHistory && this.game.time.time >= this._nextDrop) {\n this._nextDrop = this.game.time.time + input.recordRate;\n this._history.push({\n x: this.position.x,\n y: this.position.y,\n });\n if (this._history.length > input.recordLimit) {\n this._history.shift();\n }\n }\n }\n }\n\n /**\n * TBD.\n * @param {MouseEvent|PointerEvent} event - TBD.\n * @param {boolean} fromClick - TBD.\n * @returns {Pointer} TBD.\n */\n move(event, fromClick = false) {\n const input = this.game.input;\n if (input.pollLocked) {\n return null;\n }\n if (fromClick && this.isMouse) {\n this.updateButtons(event);\n }\n this.clientX = event.clientX;\n this.clientY = event.clientY;\n this.pageX = event.pageX;\n this.pageY = event.pageY;\n this.screenX = event.screenX;\n this.screenY = event.screenY;\n if (this.isMouse && input.mouse.locked && !fromClick) {\n this.rawMovementX = event.movementX || event.mozMovementX || event.webkitMovementX || 0;\n this.rawMovementY = event.movementY || event.mozMovementY || event.webkitMovementY || 0;\n this.movementX += this.rawMovementX;\n this.movementY += this.rawMovementY;\n }\n this.x = (this.pageX - this.game.scale.offset.x) * input.scale.x;\n this.y = (this.pageY - this.game.scale.offset.y) * input.scale.y;\n this.position.setTo(this.x, this.y);\n this.circle.x = this.x;\n this.circle.y = this.y;\n if (\n input.multiInputOverride === MOUSE_OVERRIDES_TOUCH ||\n input.multiInputOverride === MOUSE_TOUCH_COMBINE ||\n (input.multiInputOverride === TOUCH_OVERRIDES_MOUSE && input.totalActivePointers === 0)\n ) {\n input.activePointer = this;\n input.x = this.x;\n input.y = this.y;\n input.position.setTo(input.x, input.y);\n input.circle.x = input.x;\n input.circle.y = input.y;\n }\n this.withinGame = this.game.scale.bounds.contains(this.pageX, this.pageY);\n // If the game is paused we don't process any target objects or callbacks\n if (this.game.paused) {\n return this;\n }\n let i = input.moveCallbacks.length;\n while (i) {\n i -= 1;\n input.moveCallbacks[i].callback.call(input.moveCallbacks[i].context, this, this.x, this.y, fromClick);\n }\n // Easy out if we're dragging something and it still exists\n if (this.targetObject !== null && this.targetObject.isDragged === true) {\n if (this.targetObject.update(this) === false) {\n this.targetObject = null;\n }\n } else if (input.interactiveItems.total > 0) {\n this.processInteractiveObjects(fromClick);\n }\n return this;\n }\n\n /**\n * TBD.\n * @param {boolean} fromClick - TBD.\n * @returns {boolean} TBD.\n */\n processInteractiveObjects(fromClick = false) {\n // Work out which object is on the top\n let highestRenderOrderID = 0;\n let highestInputPriorityID = -1;\n let candidateTarget = null;\n // First pass gets all objects that the pointer is over that DON'T use pixelPerfect checks and get the highest ID\n // We know they'll be valid for input detection but not which is the top just yet\n let currentNode = this.game.input.interactiveItems.first;\n this.interactiveCandidates = [];\n while (currentNode) {\n // Reset checked status\n currentNode.checked = false;\n if (currentNode.validForInput(highestInputPriorityID, highestRenderOrderID, false)) {\n // Flag it as checked so we don't re-scan it on the next phase\n currentNode.checked = true;\n if (\n (fromClick && currentNode.checkPointerDown(this, true)) ||\n (!fromClick && currentNode.checkPointerOver(this, true))\n ) {\n highestRenderOrderID = currentNode.sprite.renderOrderID;\n highestInputPriorityID = currentNode.priorityID;\n candidateTarget = currentNode;\n this.interactiveCandidates.push(currentNode);\n }\n }\n currentNode = this.game.input.interactiveItems.next;\n }\n // Then in the second sweep we process ONLY the pixel perfect ones that are checked and who have a higher ID\n // because if their ID is lower anyway then we can just automatically discount them\n // (A node that was previously checked did not request a pixel-perfect check.)\n currentNode = this.game.input.interactiveItems.first;\n while (currentNode) {\n if (!currentNode.checked && currentNode.validForInput(highestInputPriorityID, highestRenderOrderID, true)) {\n if (\n (fromClick && currentNode.checkPointerDown(this, false)) ||\n (!fromClick && currentNode.checkPointerOver(this, false))\n ) {\n highestRenderOrderID = currentNode.sprite.renderOrderID;\n highestInputPriorityID = currentNode.priorityID;\n candidateTarget = currentNode;\n this.interactiveCandidates.push(currentNode);\n }\n }\n currentNode = this.game.input.interactiveItems.next;\n }\n if (this.game.input.customCandidateHandler) {\n candidateTarget = this.game.input.customCandidateHandler.call(\n this.game.input.customCandidateHandlerContext,\n this,\n this.interactiveCandidates,\n candidateTarget\n );\n }\n this.swapTarget(candidateTarget, false);\n return this.targetObject !== null;\n }\n\n /**\n * TBD.\n * @param {import('./input_handler.js').InputHandler} newTarget - TBD.\n * @param {boolean} silent - TBD.\n */\n swapTarget(newTarget, silent = false) {\n // Now we know the top-most item (if any) we can process it\n if (newTarget === null) {\n // The pointer isn't currently over anything, check if we've got a lingering previous target\n if (this.targetObject) {\n this.targetObject._pointerOutHandler(this, silent);\n this.targetObject = null;\n }\n } else if (this.targetObject === null) {\n // And now set the new one\n this.targetObject = newTarget;\n newTarget._pointerOverHandler(this, silent);\n } else if (this.targetObject === newTarget) {\n // We've got a target from the last update\n // Same target as before, so update it\n if (newTarget.update(this) === false) {\n this.targetObject = null;\n }\n } else {\n // The target has changed, so tell the old one we've left it\n this.targetObject._pointerOutHandler(this, silent);\n // And now set the new one\n this.targetObject = newTarget;\n this.targetObject._pointerOverHandler(this, silent);\n }\n }\n\n /**\n * TBD.\n * @param {MouseEvent|PointerEvent} event - TBD.\n */\n leave(event) {\n this.withinGame = false;\n this.move(event, false);\n }\n\n /**\n * TBD.\n * @param {MouseEvent|PointerEvent} event - TBD.\n * @returns {Pointer} TBD.\n */\n stop(event) {\n const input = this.game.input;\n if (this._stateReset && this.withinGame) {\n event.preventDefault();\n return null;\n }\n this.timeUp = this.game.time.time;\n if (\n input.multiInputOverride === MOUSE_OVERRIDES_TOUCH ||\n input.multiInputOverride === MOUSE_TOUCH_COMBINE ||\n (input.multiInputOverride === TOUCH_OVERRIDES_MOUSE && input.totalActivePointers === 0)\n ) {\n input.onUp.dispatch(this, event);\n // Was it a tap?\n if (this.duration >= 0 && this.duration <= input.tapRate) {\n // Was it a double-tap?\n if (this.timeUp - this.previousTapTime < input.doubleTapRate) {\n // Yes, let's dispatch the signal then with the 2nd parameter set to true\n input.onTap.dispatch(this, true);\n } else {\n // Wasn't a double-tap, so dispatch a single tap signal\n input.onTap.dispatch(this, false);\n }\n this.previousTapTime = this.timeUp;\n }\n }\n if (this.isMouse) {\n this.updateButtons(event);\n } else {\n this.isDown = false;\n this.isUp = true;\n }\n // Mouse is always active\n if (this.id > 0) {\n this.active = false;\n }\n this.withinGame = this.game.scale.bounds.contains(event.pageX, event.pageY);\n this.pointerId = null;\n this.identifier = null;\n this.positionUp.setTo(this.x, this.y);\n if (this.isMouse === false) {\n input.currentPointers -= 1;\n }\n input.interactiveItems.callAll('_releasedHandler', this);\n if (this._clickTrampolines) {\n this._trampolineTargetObject = this.targetObject;\n }\n this.targetObject = null;\n return this;\n }\n\n /**\n * TBD.\n * @param {number} duration - TBD.\n * @returns {boolean} TBD.\n */\n justPressed(duration) {\n duration = duration || this.game.input.justPressedRate;\n return this.isDown === true && this.timeDown + duration > this.game.time.time;\n }\n\n /**\n * TBD.\n * @param {number} duration - TBD.\n * @returns {boolean} TBD.\n */\n justReleased(duration) {\n duration = duration || this.game.input.justReleasedRate;\n return this.isUp && this.timeUp + duration > this.game.time.time;\n }\n\n /**\n * TBD.\n * @param {string} name - TBD.\n * @param {Function} callback - TBD.\n * @param {object} callbackContext - TBD.\n * @param {...any} callbackArgs - TBD.\n */\n addClickTrampoline(name, callback, callbackContext, callbackArgs) {\n if (!this.isDown) {\n return;\n }\n this._clickTrampolines = this._clickTrampolines || [];\n const trampolines = this._clickTrampolines;\n for (let i = 0; i < trampolines.length; i += 1) {\n if (trampolines[i].name === name) {\n trampolines.splice(i, 1);\n break;\n }\n }\n trampolines.push({\n name,\n targetObject: this.targetObject,\n callback,\n callbackContext,\n callbackArgs,\n });\n }\n\n /**\n * TBD.\n */\n processClickTrampolines() {\n const trampolines = this._clickTrampolines;\n if (!trampolines) {\n return;\n }\n for (let i = 0; i < trampolines.length; i += 1) {\n const trampoline = trampolines[i];\n if (trampoline.targetObject === this._trampolineTargetObject) {\n trampoline.callback.apply(trampoline.callbackContext, trampoline.callbackArgs);\n }\n }\n this._clickTrampolines = null;\n this._trampolineTargetObject = null;\n }\n\n /**\n * TBD.\n */\n reset() {\n if (this.isMouse === false) {\n this.active = false;\n }\n this.pointerId = null;\n this.identifier = null;\n this.dirty = false;\n this.totalTouches = 0;\n this._holdSent = false;\n this._history.length = 0;\n this._stateReset = true;\n this.resetButtons();\n if (this.targetObject) {\n this.targetObject._releasedHandler(this);\n }\n this.targetObject = null;\n }\n\n /**\n * TBD.\n */\n resetMovement() {\n this.movementX = 0;\n this.movementY = 0;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get duration() {\n if (this.isUp) {\n return -1;\n }\n return this.game.time.time - this.timeDown;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get worldX() {\n return this.x;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get worldY() {\n return this.y;\n }\n}\n","// @ts-nocheck\nexport class Touch {\n /**\n * TBD.\n * @param {import('./game.js').Game} game - TBD.\n */\n constructor(game) {\n this.game = game;\n this.enabled = true;\n this.callbackContext = this.game;\n this.touchStartCallback = null;\n this.touchMoveCallback = null;\n this.touchEndCallback = null;\n this.touchEnterCallback = null;\n this.touchLeaveCallback = null;\n this.touchCancelCallback = null;\n this.preventDefault = true;\n this.event = null;\n this._onTouchStart = null;\n this._onTouchMove = null;\n this._onTouchEnd = null;\n this._onTouchEnter = null;\n this._onTouchLeave = null;\n this._onTouchCancel = null;\n this._onTouchMove = null;\n }\n\n /**\n * TBD.\n */\n start() {\n if (!this.game.device.touch || this._onTouchStart !== null) {\n return;\n }\n const scope = this;\n this._onTouchStart = (event) => scope.onTouchStart(event);\n this._onTouchMove = (event) => scope.onTouchMove(event);\n this._onTouchEnd = (event) => scope.onTouchEnd(event);\n this._onTouchEnter = (event) => scope.onTouchEnter(event);\n this._onTouchLeave = (event) => scope.onTouchLeave(event);\n this._onTouchCancel = (event) => scope.onTouchCancel(event);\n this.game.canvas.addEventListener('touchstart', this._onTouchStart, false);\n this.game.canvas.addEventListener('touchmove', this._onTouchMove, false);\n this.game.canvas.addEventListener('touchend', this._onTouchEnd, false);\n this.game.canvas.addEventListener('touchcancel', this._onTouchCancel, false);\n this.game.canvas.addEventListener('touchenter', this._onTouchEnter, false);\n this.game.canvas.addEventListener('touchleave', this._onTouchLeave, false);\n }\n\n /**\n * TBD.\n */\n stop() {\n if (!this.game.device.touch) {\n return;\n }\n this.game.canvas.removeEventListener('touchstart', this._onTouchStart);\n this.game.canvas.removeEventListener('touchmove', this._onTouchMove);\n this.game.canvas.removeEventListener('touchend', this._onTouchEnd);\n this.game.canvas.removeEventListener('touchenter', this._onTouchEnter);\n this.game.canvas.removeEventListener('touchleave', this._onTouchLeave);\n this.game.canvas.removeEventListener('touchcancel', this._onTouchCancel);\n }\n\n /**\n * TBD.\n */\n consumeDocumentTouches() {\n this._documentTouchMove = (event) => {\n event.preventDefault();\n };\n document.addEventListener('touchmove', this._documentTouchMove, false);\n }\n\n /**\n * TBD.\n * @param {TouchEvent} event - TBD.\n */\n onTouchStart(event) {\n this.event = event;\n if (!this.game.input.enabled || !this.enabled) {\n return;\n }\n if (this.touchStartCallback) {\n this.touchStartCallback.call(this.callbackContext, event);\n }\n this.eventPreventDefault(event);\n // event.targetTouches = list of all touches on the TARGET ELEMENT (i.e. game dom element)\n // event.touches = list of all touches on the ENTIRE DOCUMENT, not just the target element\n // event.changedTouches = the touches that CHANGED in this event, not the total number of them\n for (let i = 0; i < event.changedTouches.length; i += 1) {\n this.game.input.startPointer(event.changedTouches[i]);\n }\n }\n\n /**\n * TBD.\n * @param {TouchEvent} event - TBD.\n */\n onTouchCancel(event) {\n this.event = event;\n if (this.touchCancelCallback) {\n this.touchCancelCallback.call(this.callbackContext, event);\n }\n if (!this.game.input.enabled || !this.enabled) {\n return;\n }\n this.eventPreventDefault(event);\n // Touch cancel - touches that were disrupted (perhaps by moving into a plugin or browser chrome)\n // http://www.w3.org/TR/touch-events/#dfn-touchcancel\n for (let i = 0; i < event.changedTouches.length; i += 1) {\n this.game.input.stopPointer(event.changedTouches[i]);\n }\n }\n\n /**\n * TBD.\n * @param {TouchEvent} event - TBD.\n */\n onTouchEnter(event) {\n this.event = event;\n if (this.touchEnterCallback) {\n this.touchEnterCallback.call(this.callbackContext, event);\n }\n if (!this.game.input.enabled || !this.enabled) {\n return;\n }\n this.eventPreventDefault(event);\n }\n\n /**\n * TBD.\n * @param {TouchEvent} event - TBD.\n */\n onTouchLeave(event) {\n this.event = event;\n if (this.touchLeaveCallback) {\n this.touchLeaveCallback.call(this.callbackContext, event);\n }\n this.eventPreventDefault(event);\n }\n\n /**\n * TBD.\n * @param {TouchEvent} event - TBD.\n */\n onTouchMove(event) {\n this.event = event;\n if (this.touchMoveCallback) {\n this.touchMoveCallback.call(this.callbackContext, event);\n }\n this.eventPreventDefault(event);\n for (let i = 0; i < event.changedTouches.length; i += 1) {\n this.game.input.updatePointer(event.changedTouches[i]);\n }\n }\n\n /**\n * TBD.\n * @param {TouchEvent} event - TBD.\n */\n onTouchEnd(event) {\n this.event = event;\n if (this.touchEndCallback) {\n this.touchEndCallback.call(this.callbackContext, event);\n }\n this.eventPreventDefault(event);\n // For touch end its a list of the touch points that have been removed from the surface\n // https://developer.mozilla.org/en-US/docs/DOM/TouchList\n // event.changedTouches = the touches that CHANGED in this event, not the total number of them\n for (let i = 0; i < event.changedTouches.length; i += 1) {\n this.game.input.stopPointer(event.changedTouches[i]);\n }\n }\n\n /**\n * TBD.\n * @param {TouchEvent} event - TBD.\n */\n eventPreventDefault(event) {\n if (this.preventDefault) {\n if (typeof event.cancelable !== 'boolean' || event.cancelable) {\n event.preventDefault();\n }\n }\n }\n}\n","// @ts-nocheck\nimport { create, remove } from '../display/canvas/pool.js';\nimport { Graphics } from '../display/graphics.js';\nimport { Image } from '../display/image.js';\nimport { Circle } from '../geom/circle.js';\nimport { Point } from '../geom/point.js';\nimport { ArraySet } from './array_set.js';\nimport { MOUSE_TOUCH_COMBINE, POINTER_CONTACT, POINTER_CURSOR } from './const.js';\nimport { Mouse } from './input_mouse.js';\nimport { MSPointer } from './input_mspointer.js';\nimport { Pointer } from './input_pointer.js';\nimport { Touch } from './input_touch.js';\nimport { Signal } from './signal.js';\n\nconst MAX_POINTERS = 10;\n\nexport class Input {\n /**\n * TBD.\n * @param {import('./game.js').Game} game - TBD.\n */\n constructor(game) {\n this.game = game;\n this.hitCanvas = null;\n this.hitContext = null;\n this.moveCallbacks = [];\n this.lockCallbacks = [];\n this.customCandidateHandler = null;\n this.customCandidateHandlerContext = null;\n this.pollRate = 0;\n this.enabled = true;\n this.multiInputOverride = MOUSE_TOUCH_COMBINE;\n this.position = null;\n this.speed = null;\n this.circle = null;\n this.scale = null;\n this.maxPointers = 1;\n this.tapRate = 200;\n this.doubleTapRate = 300;\n this.holdRate = 2000;\n this.justPressedRate = 200;\n this.justReleasedRate = 200;\n this.recordPointerHistory = false;\n this.recordRate = 100;\n this.recordLimit = 100;\n this.pointer1 = null;\n this.pointer2 = null;\n this.pointer3 = null;\n this.pointer4 = null;\n this.pointer5 = null;\n this.pointer6 = null;\n this.pointer7 = null;\n this.pointer8 = null;\n this.pointer9 = null;\n this.pointer10 = null;\n this.pointers = [];\n this.activePointer = null;\n this.mousePointer = null;\n this.mouse = null;\n this.touch = null;\n this.mspointer = null;\n this.resetLocked = false;\n this.onDown = null;\n this.onUp = null;\n this.onTap = null;\n this.onHold = null;\n this.minPriorityID = 0;\n this.interactiveItems = new ArraySet();\n this._localPoint = new Point();\n this._pollCounter = 0;\n this._oldPosition = null;\n this._x = 0;\n this._y = 0;\n }\n\n /**\n * TBD.\n */\n boot() {\n this.mousePointer = new Pointer(this.game, 0, POINTER_CURSOR);\n this.addPointer();\n this.addPointer();\n this.mouse = new Mouse(this.game);\n this.touch = new Touch(this.game);\n this.mspointer = new MSPointer(this.game);\n this.onDown = new Signal();\n this.onUp = new Signal();\n this.onTap = new Signal();\n this.onHold = new Signal();\n this.scale = new Point(1, 1);\n this.speed = new Point();\n this.position = new Point();\n this._oldPosition = new Point();\n this.circle = new Circle(0, 0, 44);\n this.activePointer = this.mousePointer;\n this.hitCanvas = create(this, 1, 1);\n this.hitContext = this.hitCanvas.getContext('2d', { willReadFrequently: false });\n this.mouse.start();\n if (this.game.device.mspointer) {\n this.mspointer.start();\n } else if (this.game.device.touch) {\n this.touch.start();\n }\n this.mousePointer.active = true;\n const scope = this;\n this._onClickTrampoline = (event) => scope.onClickTrampoline(event);\n this.game.canvas.addEventListener('click', this._onClickTrampoline, false);\n }\n\n /**\n * TBD.\n */\n destroy() {\n this.mouse.stop();\n if (this.game.device.mspointer) {\n this.mspointer.stop();\n } else if (this.game.device.touch) {\n this.touch.stop();\n }\n this.moveCallbacks = [];\n remove(this);\n this.game.canvas.removeEventListener('click', this._onClickTrampoline);\n }\n\n /**\n * TBD.\n * @param {Function} callback - TBD.\n * @param {object} context - TBD.\n */\n setInteractiveCandidateHandler(callback, context) {\n this.customCandidateHandler = callback;\n this.customCandidateHandlerContext = context;\n }\n\n /**\n * TBD.\n * @param {Function} callback - TBD.\n * @param {object} context - TBD.\n */\n addMoveCallback(callback, context) {\n this.moveCallbacks.push({ callback, context });\n }\n\n /**\n * TBD.\n * @param {Function} callback - TBD.\n * @param {object} context - TBD.\n */\n deleteMoveCallback(callback, context) {\n let i = this.moveCallbacks.length;\n while (i) {\n i -= 1;\n if (this.moveCallbacks[i].callback === callback && this.moveCallbacks[i].context === context) {\n this.moveCallbacks.splice(i, 1);\n return;\n }\n }\n }\n\n /**\n * TBD.\n * @returns {Pointer} TBD.\n */\n addPointer() {\n if (this.pointers.length >= MAX_POINTERS) {\n this.game.logger.warn(`Input.addPointer: Maximum limit of ${MAX_POINTERS} pointers reached.`);\n return null;\n }\n const id = this.pointers.length + 1;\n const pointer = new Pointer(this.game, id, POINTER_CONTACT);\n this.pointers.push(pointer);\n this[`pointer${id}`] = pointer;\n return pointer;\n }\n\n /**\n * TBD.\n */\n update() {\n if (this.pollRate > 0 && this._pollCounter < this.pollRate) {\n this._pollCounter += 1;\n return;\n }\n this.speed.x = this.position.x - this._oldPosition.x;\n this.speed.y = this.position.y - this._oldPosition.y;\n this._oldPosition.copyFrom(this.position);\n this.mousePointer.update();\n for (let i = 0; i < this.pointers.length; i += 1) {\n this.pointers[i].update();\n }\n this._pollCounter = 0;\n }\n\n /**\n * TBD.\n * @param {boolean} hard - TBD.\n */\n reset(hard = false) {\n if (!this.game.isBooted || this.resetLocked) {\n return;\n }\n this.mousePointer.reset();\n for (let i = 0; i < this.pointers.length; i += 1) {\n this.pointers[i].reset();\n }\n if (this.game.canvas.style.cursor !== 'none') {\n this.game.canvas.style.cursor = 'inherit';\n }\n if (hard) {\n this.onDown.dispose();\n this.onUp.dispose();\n this.onTap.dispose();\n this.onHold.dispose();\n this.onDown = new Signal();\n this.onUp = new Signal();\n this.onTap = new Signal();\n this.onHold = new Signal();\n this.moveCallbacks = [];\n }\n this._pollCounter = 0;\n }\n\n /**\n * TBD.\n * @param {number} x - TBD.\n * @param {number} y - TBD.\n */\n resetSpeed(x, y) {\n this._oldPosition.setTo(x, y);\n this.speed.setTo(0, 0);\n }\n\n /**\n * TBD.\n * @param {MouseEvent|TouchEvent|PointerEvent} event - TBD.\n * @returns {Pointer} TBD.\n */\n startPointer(event) {\n if (this.maxPointers >= 0 && this.countActivePointers(this.maxPointers) >= this.maxPointers) {\n return null;\n }\n if (!this.pointer1.active) {\n return this.pointer1.start(event);\n }\n if (!this.pointer2.active) {\n return this.pointer2.start(event);\n }\n for (let i = 2; i < this.pointers.length; i += 1) {\n const pointer = this.pointers[i];\n if (!pointer.active) {\n return pointer.start(event);\n }\n }\n return null;\n }\n\n /**\n * TBD.\n * @param {MouseEvent|TouchEvent|PointerEvent} event - TBD.\n * @returns {Pointer} TBD.\n */\n updatePointer(event) {\n if (this.pointer1.active && this.pointer1.identifier === event.identifier) {\n return this.pointer1.move(event);\n }\n if (this.pointer2.active && this.pointer2.identifier === event.identifier) {\n return this.pointer2.move(event);\n }\n for (let i = 2; i < this.pointers.length; i += 1) {\n const pointer = this.pointers[i];\n if (pointer.active && pointer.identifier === event.identifier) {\n return pointer.move(event);\n }\n }\n return null;\n }\n\n /**\n * TBD.\n * @param {MouseEvent|TouchEvent|PointerEvent} event - TBD.\n * @returns {Pointer} TBD.\n */\n stopPointer(event) {\n if (this.pointer1.active && this.pointer1.identifier === event.identifier) {\n return this.pointer1.stop(event);\n }\n if (this.pointer2.active && this.pointer2.identifier === event.identifier) {\n return this.pointer2.stop(event);\n }\n for (let i = 2; i < this.pointers.length; i += 1) {\n const pointer = this.pointers[i];\n if (pointer.active && pointer.identifier === event.identifier) {\n return pointer.stop(event);\n }\n }\n return null;\n }\n\n /**\n * TBD.\n * @param {number} limit - TBD.\n * @returns {number} TBD.\n */\n countActivePointers(limit = this.pointers.length) {\n let count = limit;\n for (let i = 0; i < this.pointers.length && count > 0; i += 1) {\n const pointer = this.pointers[i];\n if (pointer.active) {\n count -= 1;\n }\n }\n return limit - count;\n }\n\n /**\n * TBD.\n * @param {boolean} isActive - TBD.\n * @returns {Pointer} TBD.\n */\n getPointer(isActive = false) {\n for (let i = 0; i < this.pointers.length; i += 1) {\n const pointer = this.pointers[i];\n if (pointer.active === isActive) {\n return pointer;\n }\n }\n return null;\n }\n\n /**\n * TBD.\n * @param {number} identifier - TBD.\n * @returns {Pointer} TBD.\n */\n getPointerFromIdentifier(identifier) {\n for (let i = 0; i < this.pointers.length; i += 1) {\n const pointer = this.pointers[i];\n if (pointer.identifier === identifier) {\n return pointer;\n }\n }\n\n return null;\n }\n\n /**\n * TBD.\n * @param {number} pointerId - TBD.\n * @returns {Pointer} TBD.\n */\n getPointerFromId(pointerId) {\n for (let i = 0; i < this.pointers.length; i += 1) {\n const pointer = this.pointers[i];\n if (pointer.pointerId === pointerId) {\n return pointer;\n }\n }\n\n return null;\n }\n\n /**\n * TBD.\n * @param {import('../display/display_object.js').DisplayObject} displayObject - TBD.\n * @param {Pointer} pointer - TBD.\n * @param {Point} output - TBD.\n * @returns {Point} TBD.\n */\n getLocalPosition(displayObject, pointer, output = null) {\n const result = output || new Point();\n const wt = displayObject.worldTransform;\n const id = 1 / (wt.a * wt.d + wt.c * -wt.b);\n return result.setTo(\n wt.d * id * pointer.x + -wt.c * id * pointer.y + (wt.ty * wt.c - wt.tx * wt.d) * id,\n wt.a * id * pointer.y + -wt.b * id * pointer.x + (-wt.ty * wt.a + wt.tx * wt.b) * id\n );\n }\n\n /**\n * TBD.\n * @param {import('../display/display_object.js').DisplayObject} displayObject - TBD.\n * @param {Pointer} pointer - TBD.\n * @param {Point} localPoint - TBD.\n * @returns {boolean} TBD.\n */\n hitTest(displayObject, pointer, localPoint) {\n if (!displayObject.worldVisible) {\n return false;\n }\n this.getLocalPosition(displayObject, pointer, this._localPoint);\n localPoint.copyFrom(this._localPoint);\n if (displayObject.hitArea && displayObject.hitArea.contains) {\n return displayObject.hitArea.contains(this._localPoint.x, this._localPoint.y);\n } else if (displayObject instanceof Image) {\n const width = displayObject.texture.frame.width;\n const height = displayObject.texture.frame.height;\n const x1 = -width * displayObject.anchor.x;\n if (this._localPoint.x >= x1 && this._localPoint.x < x1 + width) {\n const y1 = -height * displayObject.anchor.y;\n if (this._localPoint.y >= y1 && this._localPoint.y < y1 + height) {\n return true;\n }\n }\n } else if (displayObject instanceof Graphics) {\n for (let i = 0; i < displayObject.graphicsData.length; i += 1) {\n const data = displayObject.graphicsData[i];\n if (data.fill && data.shape && data.shape.contains(this._localPoint.x, this._localPoint.y)) {\n // Only deal with fills..\n return true;\n }\n }\n }\n // Didn't hit the parent, does it have any children?\n for (let i = 0; i < displayObject.children.length; i += 1) {\n if (this.hitTest(displayObject.children[i], pointer, localPoint)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * TBD.\n */\n onClickTrampoline() {\n this.activePointer.processClickTrampolines();\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get x() {\n return this._x;\n }\n\n /**\n * TBD.\n */\n set x(value) {\n this._x = Math.floor(value);\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get y() {\n return this._y;\n }\n\n /**\n * TBD.\n */\n set y(value) {\n this._y = Math.floor(value);\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n get pollLocked() {\n return this.pollRate > 0 && this._pollCounter < this.pollRate;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get totalInactivePointers() {\n return this.pointers.length - this.countActivePointers();\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get totalActivePointers() {\n return this.countActivePointers();\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get worldX() {\n return this.x;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get worldY() {\n return this.y;\n }\n}\n","// @ts-nocheck\nimport { Rectangle } from '../geom/rectangle.js';\nimport { canPlayAudio } from './device_util.js';\nimport { ENGINE_ERROR_INVALID_BITMAP_FONT_ATLAS } from './error_code.js';\nimport { Signal } from './signal.js';\n\nconst TEXTURE_ATLAS_JSON_HASH = 1;\n\nexport class Loader {\n /**\n * Creates a new Loader instance.\n * @param {import('./game.js').Game} game - Reference to the Phaser Game instance.\n */\n constructor(game) {\n this.game = game;\n this.cache = game.cache;\n this.isLoading = false;\n this.isUseLog = false;\n this.isUseRetry = true;\n this.maxRetry = 3;\n this.hasLoaded = false;\n this.preloadSprite = null;\n this.crossOrigin = false;\n this.baseURL = '';\n this.path = '';\n this.headers = {\n requestedWith: false,\n json: 'application/json',\n xml: 'application/xml',\n };\n this.onLoadStart = new Signal();\n this.onLoadComplete = new Signal();\n this.onPackComplete = new Signal();\n this.onFileStart = new Signal();\n this.onFileComplete = new Signal();\n this.onFileError = new Signal();\n this.maxParallelDownloads = this.game.config.maxParallelDownloads || 16;\n this._withSyncPointDepth = 0;\n this._fileList = [];\n this._flightQueue = [];\n this._processingHead = 0;\n this._fileLoadStarted = false;\n this._totalPackCount = 0;\n this._totalFileCount = 0;\n this._loadedPackCount = 0;\n this._loadedFileCount = 0;\n }\n\n /**\n * Sets the preload sprite for displaying loading progress.\n * @param {import('../display/image.js').Image} sprite - The image to use as the preload sprite.\n * @param {number} direction - The direction of the progress (0 = horizontal, 1 = vertical).\n */\n setPreloadSprite(sprite, direction = 0) {\n this.preloadSprite = {\n sprite,\n direction,\n width: sprite.width,\n height: sprite.height,\n rect: null,\n };\n if (direction === 0) {\n // Horizontal rect\n this.preloadSprite.rect = new Rectangle(0, 0, 1, sprite.height);\n } else {\n // Vertical rect\n this.preloadSprite.rect = new Rectangle(0, 0, sprite.width, 1);\n }\n sprite.crop(this.preloadSprite.rect);\n sprite.visible = true;\n }\n\n /**\n * Resizes the preload sprite when the window is resized.\n */\n resize() {\n if (this.preloadSprite && this.preloadSprite.height !== this.preloadSprite.sprite.height) {\n this.preloadSprite.rect.height = this.preloadSprite.sprite.height;\n }\n }\n\n /**\n * Checks if a file with the given type and key already exists in the file list.\n * @param {string} type - The type of file to check for.\n * @param {string} key - The key of the file to check for.\n * @returns {boolean} True if the file exists, false otherwise.\n */\n checkKeyExists(type, key) {\n return this.getAssetIndex(type, key) > -1;\n }\n\n /**\n * Gets the index of a file in the file list by type and key.\n * @param {string} type - The type of file to find.\n * @param {string} key - The key of the file to find.\n * @returns {number} The index of the file in the list, or -1 if not found.\n */\n getAssetIndex(type, key) {\n let bestFound = -1;\n for (let i = 0; i < this._fileList.length; i += 1) {\n const file = this._fileList[i];\n if (file.type === type && file.key === key) {\n bestFound = i;\n // An already loaded/loading file may be superceded.\n if (!file.loaded && !file.loading) {\n break;\n }\n }\n }\n\n return bestFound;\n }\n\n /**\n * Gets a file from the file list by type and key.\n * @param {string} type - The type of file to get.\n * @param {string} key - The key of the file to get.\n * @returns {{index: number, file: object} | null} The file and its index, or null if not found.\n */\n getAsset(type, key) {\n const fileIndex = this.getAssetIndex(type, key);\n if (fileIndex > -1) {\n return { index: fileIndex, file: this._fileList[fileIndex] };\n }\n return null;\n }\n\n /**\n * Resets the loader state, optionally clearing event listeners.\n * @param {boolean} hard - Whether to perform a hard reset (clears preload sprite).\n * @param {boolean} clearEvents - Whether to clear event listeners.\n */\n reset(hard = false, clearEvents = false) {\n if (hard) {\n this.preloadSprite = null;\n }\n this.isLoading = false;\n this._processingHead = 0;\n this._fileList.length = 0;\n this._flightQueue.length = 0;\n this._fileLoadStarted = false;\n this._totalFileCount = 0;\n this._totalPackCount = 0;\n this._loadedPackCount = 0;\n this._loadedFileCount = 0;\n if (clearEvents) {\n this.onLoadStart.removeAll();\n this.onLoadComplete.removeAll();\n this.onPackComplete.removeAll();\n this.onFileStart.removeAll();\n this.onFileComplete.removeAll();\n this.onFileError.removeAll();\n }\n }\n\n /**\n * Adds a file to the file list for loading.\n * @param {string} type - The type of file to add.\n * @param {string} key - The key to identify the file.\n * @param {string} url - The URL of the file to load.\n * @param {object} properties - Additional properties for the file.\n * @param {boolean} overwrite - Whether to overwrite an existing file with the same key.\n * @param {string} extension - The file extension to use if URL is not provided.\n * @returns {Loader} This Loader instance for chaining.\n */\n addToFileList(type, key = '', url = null, properties = null, overwrite = false, extension = null) {\n if (key === undefined || key === '') {\n this.game.logger.warn(`Loader: Invalid or no key given of type ${type}`);\n return this;\n }\n if (url === undefined || url === null) {\n if (extension) {\n url = key + extension;\n } else {\n this.game.logger.warn(`Loader: No URL given for file type: ${type} key: ${key}`);\n return this;\n }\n }\n const file = {\n type,\n key,\n path: this.path,\n url,\n syncPoint: this._withSyncPointDepth > 0,\n data: null,\n loading: false,\n loaded: false,\n error: false,\n };\n if (properties) {\n const keys = Object.keys(properties);\n for (let i = 0; i < keys.length; i += 1) {\n const prop = keys[i];\n file[prop] = properties[prop];\n }\n }\n const fileIndex = this.getAssetIndex(type, key);\n if (overwrite && fileIndex > -1) {\n const currentFile = this._fileList[fileIndex];\n if (!currentFile.loading && !currentFile.loaded) {\n this._fileList[fileIndex] = file;\n } else {\n this._fileList.push(file);\n this._totalFileCount += 1;\n }\n } else if (fileIndex === -1) {\n this._fileList.push(file);\n this._totalFileCount += 1;\n }\n return this;\n }\n\n /**\n * Replaces a file in the file list with new properties.\n * @param {string} type - The type of file to replace.\n * @param {string} key - The key of the file to replace.\n * @param {string} url - The new URL for the file.\n * @param {object} properties - The new properties for the file.\n * @returns {Loader} This Loader instance for chaining.\n */\n replaceInFileList(type, key, url, properties) {\n return this.addToFileList(type, key, url, properties, true);\n }\n\n /**\n * Adds a pack file to the file list.\n * @param {string} key - The key to identify the pack file.\n * @param {string} url - The URL of the pack file to load.\n * @param {object} data - The parsed pack data.\n * @param {object} callbackContext - The context in which to call the callback.\n * @returns {Loader} This Loader instance for chaining.\n */\n pack(key, url, data, callbackContext) {\n const pack = {\n type: 'packfile',\n key: key,\n url: url,\n path: this.path,\n syncPoint: true,\n data: null,\n loading: false,\n loaded: false,\n error: false,\n callbackContext: callbackContext,\n };\n if (data) {\n if (typeof data === 'string') {\n data = JSON.parse(data);\n }\n pack.data = data || {};\n pack.loaded = true;\n }\n for (let i = 0; i < this._fileList.length + 1; i += 1) {\n const file = this._fileList[i];\n if (!file || (!file.loaded && !file.loading && file.type !== 'packfile')) {\n this._fileList.splice(i, 0, pack);\n this._totalPackCount += 1;\n break;\n }\n }\n return this;\n }\n\n /**\n * Adds an image file to the file list.\n * @param {string} key - The key to identify the image file.\n * @param {string} url - The URL of the image file to load.\n * @param {boolean} overwrite - Whether to overwrite an existing file with the same key.\n * @returns {Loader} This Loader instance for chaining.\n */\n image(key, url, overwrite = false) {\n return this.addToFileList('image', key, url, undefined, overwrite, '.png');\n }\n\n /**\n * Adds multiple image files to the file list.\n * @param {string[]} keys - The keys to identify the image files.\n * @param {string[]} urls - The URLs of the image files to load.\n * @returns {Loader} This Loader instance for chaining.\n */\n images(keys, urls) {\n if (Array.isArray(urls)) {\n for (let i = 0; i < keys.length; i += 1) {\n this.image(keys[i], urls[i]);\n }\n } else {\n for (let i = 0; i < keys.length; i += 1) {\n this.image(keys[i]);\n }\n }\n return this;\n }\n\n /**\n * Adds a text file to the file list.\n * @param {string} key - The key to identify the text file.\n * @param {string} url - The URL of the text file to load.\n * @param {boolean} overwrite - Whether to overwrite an existing file with the same key.\n * @returns {Loader} This Loader instance for chaining.\n */\n text(key, url, overwrite = false) {\n return this.addToFileList('text', key, url, undefined, overwrite, '.txt');\n }\n\n /**\n * Adds a JSON file to the file list.\n * @param {string} key - The key to identify the JSON file.\n * @param {string} url - The URL of the JSON file to load.\n * @param {boolean} overwrite - Whether to overwrite an existing file with the same key.\n * @returns {Loader} This Loader instance for chaining.\n */\n json(key, url, overwrite = false) {\n return this.addToFileList('json', key, url, undefined, overwrite, '.json');\n }\n\n /**\n * Adds an XML file to the file list.\n * @param {string} key - The key to identify the XML file.\n * @param {string} url - The URL of the XML file to load.\n * @param {boolean} overwrite - Whether to overwrite an existing file with the same key.\n * @returns {Loader} This Loader instance for chaining.\n */\n xml(key, url, overwrite = false) {\n return this.addToFileList('xml', key, url, undefined, overwrite, '.xml');\n }\n\n /**\n * Adds a spritesheet file to the file list.\n * @param {string} key - The key to identify the spritesheet file.\n * @param {string} url - The URL of the spritesheet file to load.\n * @param {number} frameWidth - The width of each frame in the spritesheet.\n * @param {number} frameHeight - The height of each frame in the spritesheet.\n * @param {number} frameMax - The maximum number of frames to load (-1 for all).\n * @param {number} margin - The margin around each frame in pixels.\n * @param {number} spacing - The spacing between frames in pixels.\n * @returns {Loader} This Loader instance for chaining.\n */\n spritesheet(key, url, frameWidth, frameHeight, frameMax = -1, margin = 0, spacing = 0) {\n return this.addToFileList(\n 'spritesheet',\n key,\n url,\n { frameWidth, frameHeight, frameMax, margin, spacing },\n false,\n '.png'\n );\n }\n\n /**\n * Adds an audio file to the file list.\n * @param {string} key - The key to identify the audio file.\n * @param {string[]} urls - The URLs of the audio files to load.\n * @param {boolean} autoDecode - Whether to automatically decode the audio file.\n * @returns {Loader} This Loader instance for chaining.\n */\n audio(key, urls, autoDecode = true) {\n if (this.game.sound.noAudio || this.game.device.noAudioFormat) {\n return this;\n }\n if (typeof urls === 'string') {\n urls = [urls];\n }\n return this.addToFileList('audio', key, urls, { buffer: null, autoDecode });\n }\n\n /**\n * Adds an audio sprite file to the file list.\n * @param {string} key - The key to identify the audio sprite file.\n * @param {string} urls - The URLs of the audio files to load.\n * @param {string} jsonURL - The URL of the JSON file containing audio sprite data.\n * @param {object} jsonData - The parsed JSON data containing audio sprite data.\n * @param {boolean} autoDecode - Whether to automatically decode the audio file.\n * @returns {Loader} This Loader instance for chaining.\n */\n audioSprite(key, urls, jsonURL, jsonData, autoDecode = true) {\n if (this.game.sound.noAudio || this.game.device.noAudioFormat) {\n return this;\n }\n this.audio(key, urls, autoDecode);\n if (jsonURL) {\n this.json(`${key}-audioatlas`, jsonURL);\n } else if (jsonData) {\n if (typeof jsonData === 'string') {\n jsonData = JSON.parse(jsonData);\n }\n this.cache.addJSON(`${key}-audioatlas`, '', jsonData);\n }\n return this;\n }\n\n /**\n * Adds a bitmap font file to the file list.\n * @param {string} key - The key to identify the bitmap font file.\n * @param {string} textureURL - The URL of the font texture image.\n * @param {string} atlasURL - The URL of the XML or JSON file containing font data.\n * @param {object} atlasData - The parsed data containing font information.\n * @param {number} xSpacing - The horizontal spacing between characters in pixels.\n * @param {number} ySpacing - The vertical spacing between characters in pixels.\n * @returns {Loader} This Loader instance for chaining.\n * @throws {Error} If the bitmap font atlas data is invalid.\n */\n bitmapFont(key, textureURL = null, atlasURL = null, atlasData = null, xSpacing = 0, ySpacing = 0) {\n if (textureURL === undefined || textureURL === null) {\n textureURL = `${key}.png`;\n }\n if (atlasURL === null && atlasData === null) {\n atlasURL = `${key}.xml`;\n }\n // A URL to a json/xml atlas has been given\n if (atlasURL) {\n this.addToFileList('bitmapfont', key, textureURL, { atlasURL, xSpacing, ySpacing });\n } else if (typeof atlasData === 'string') {\n // A stringified xml/json atlas has been given\n let json = null;\n let xml = null;\n try {\n json = JSON.parse(atlasData);\n } catch (error) {\n xml = this.parseXml(atlasData);\n }\n if (!xml && !json) {\n throw new Error(ENGINE_ERROR_INVALID_BITMAP_FONT_ATLAS);\n }\n this.addToFileList('bitmapfont', key, textureURL, {\n atlasURL: null,\n atlasData: json || xml,\n atlasType: json ? 'json' : 'xml',\n xSpacing,\n ySpacing,\n });\n }\n return this;\n }\n\n /**\n * Adds a texture atlas file to the file list.\n * @param {string} key - The key to identify the texture atlas file.\n * @param {string} textureURL - The URL of the texture image file.\n * @param {string} atlasURL - The URL of the JSON or XML file containing atlas data.\n * @param {object} atlasData - The parsed data containing atlas information.\n * @param {number} format - The format of the atlas file (JSON or XML).\n * @returns {Loader} This Loader instance for chaining.\n */\n atlas(key, textureURL, atlasURL = null, atlasData = null, format = TEXTURE_ATLAS_JSON_HASH) {\n if (textureURL === undefined || textureURL === null) {\n textureURL = `${key}.png`;\n }\n if (!atlasURL && !atlasData) {\n atlasURL = `${key}.json`;\n }\n // A URL to a json/xml file has been given\n if (atlasURL) {\n this.addToFileList('textureatlas', key, textureURL, { atlasURL, format });\n } else {\n this.addToFileList('textureatlas', key, textureURL, { atlasURL: null, atlasData, format });\n }\n return this;\n }\n\n /**\n * Creates a sync point for loading files, ensuring all files in the block are loaded before continuing.\n * @param {Function} callback - The callback function to execute within the sync point.\n * @param {object} callbackContext - The context in which to call the callback.\n * @returns {Loader} This Loader instance for chaining.\n */\n withSyncPoint(callback, callbackContext) {\n this._withSyncPointDepth += 1;\n try {\n callback.call(callbackContext || this, this);\n } finally {\n this._withSyncPointDepth -= 1;\n }\n return this;\n }\n\n /**\n * Adds a sync point to a specific file, preventing other files from loading until this one is processed.\n * @param {string} type - The type of file to add a sync point to.\n * @param {string} key - The key of the file to add a sync point to.\n * @returns {Loader} This Loader instance for chaining.\n */\n addSyncPoint(type, key) {\n const asset = this.getAsset(type, key);\n if (asset) {\n asset.file.syncPoint = true;\n }\n return this;\n }\n\n /**\n * Removes a file from the file list if it's not currently loading or loaded.\n * @param {string} type - The type of file to remove.\n * @param {string} key - The key of the file to remove.\n */\n removeFile(type, key) {\n const asset = this.getAsset(type, key);\n if (asset) {\n if (!asset.loaded && !asset.loading) {\n this._fileList.splice(asset.index, 1);\n }\n }\n }\n\n /**\n * Removes all files from the file list.\n */\n removeAll() {\n this._fileList.length = 0;\n this._flightQueue.length = 0;\n }\n\n /**\n * Starts the loading process for all queued files.\n */\n start() {\n if (this.isLoading) {\n return;\n }\n this.hasLoaded = false;\n this.isLoading = true;\n this.updateProgress();\n this.processLoadQueue();\n }\n\n /**\n * Processes the loading queue, loading files as appropriate.\n */\n processLoadQueue() {\n if (!this.isLoading) {\n this.game.logger.warn('Active loading canceled / reset');\n this.finishedLoading(true);\n return;\n }\n // Empty the flight queue as applicable\n for (let i = 0; i < this._flightQueue.length; i += 1) {\n const file = this._flightQueue[i];\n if (file.loaded || file.error) {\n this._flightQueue.splice(i, 1);\n i -= 1;\n file.loading = false;\n file.requestUrl = null;\n file.requestObject = null;\n if (file.error) {\n this.onFileError.dispatch(file.key, file);\n }\n if (file.type !== 'packfile') {\n this._loadedFileCount += 1;\n this.onFileComplete.dispatch(\n this.progress,\n file.key,\n !file.error,\n this._loadedFileCount,\n this._totalFileCount\n );\n } else if (file.type === 'packfile' && file.error) {\n // Non-error pack files are handled when processing the file queue\n this._loadedPackCount += 1;\n this.onPackComplete.dispatch(file.key, !file.error, this._loadedPackCount, this._totalPackCount);\n }\n }\n }\n // When true further non-pack file downloads are suppressed\n let syncblock = false;\n const inflightLimit = this.maxParallelDownloads;\n for (let i = this._processingHead; i < this._fileList.length; i += 1) {\n const file = this._fileList[i];\n // Pack is fetched (ie. has data) and is currently at the start of the process queue.\n if (file.type === 'packfile' && !file.error && file.loaded && i === this._processingHead) {\n // Processing the pack / adds more files\n this.processPack(file);\n this._loadedPackCount += 1;\n this.onPackComplete.dispatch(file.key, !file.error, this._loadedPackCount, this._totalPackCount);\n }\n if (file.loaded || file.error) {\n // Item at the start of file list finished, can skip it in future\n if (i === this._processingHead) {\n this._processingHead = i + 1;\n }\n } else if (!file.loading && this._flightQueue.length < inflightLimit) {\n // -> not loaded/failed, not loading\n if (file.type === 'packfile' && !file.data) {\n // Fetches the pack data: the pack is processed above as it reaches queue-start.\n // (Packs do not trigger onLoadStart or onFileStart.)\n this._flightQueue.push(file);\n file.loading = true;\n this.loadFile(file);\n } else if (!syncblock) {\n if (!this._fileLoadStarted) {\n this._fileLoadStarted = true;\n this.onLoadStart.dispatch();\n }\n this._flightQueue.push(file);\n file.loading = true;\n this.onFileStart.dispatch(this.progress, file.key, file.url);\n this.loadFile(file);\n }\n }\n if (!file.loaded && file.syncPoint) {\n syncblock = true;\n }\n // Stop looking if queue full - or if syncblocked and there are no more packs.\n // (As only packs can be loaded around a syncblock)\n if (this._flightQueue.length >= inflightLimit || (syncblock && this._loadedPackCount === this._totalPackCount)) {\n break;\n }\n }\n this.updateProgress();\n // True when all items in the queue have been advanced over\n // (There should be no inflight items as they are complete - loaded/error.)\n if (this._processingHead >= this._fileList.length) {\n this.finishedLoading();\n } else if (!this._flightQueue.length) {\n // Flight queue is empty but file list is not done being processed.\n // This indicates a critical internal error with no known recovery.\n this.game.logger.warn('Aborting: processing queue empty, loading may have stalled');\n const scope = this;\n setTimeout(() => {\n scope.finishedLoading(true);\n }, 2000);\n }\n }\n\n /**\n * Finishes the loading process, optionally reporting an abnormal termination.\n * @param {boolean} abnormal - Whether the loading was terminated abnormally.\n */\n finishedLoading(abnormal = false) {\n if (this.hasLoaded) {\n return;\n }\n this.hasLoaded = true;\n this.isLoading = false;\n // If there were no files make sure to trigger the event anyway, for consistency\n if (!abnormal && !this._fileLoadStarted) {\n this._fileLoadStarted = true;\n this.onLoadStart.dispatch();\n }\n // https://github.com/photonstorm/phaser-ce/pull/54/\n this.reset();\n this.onLoadComplete.dispatch();\n this.game.state.loadComplete();\n // https://github.com/photonstorm/phaser-ce/pull/54/\n // this.reset();\n }\n\n /**\n * Marks a file as complete or failed, updating the loading state.\n * @param {object} file - The file to complete or mark as failed.\n * @param {string} errorMessage - An error message if the file failed to load.\n */\n asyncComplete(file, errorMessage = '') {\n file.loaded = true;\n file.error = !!errorMessage;\n if (file.error) {\n file.errorMessage = errorMessage;\n this.game.logger.warn('Error loading file', file);\n }\n this.log('asyncComplete', file);\n this.processLoadQueue();\n }\n\n /**\n * Processes a pack file, adding its contained files to the loader.\n * @param {object} pack - The pack file object to process.\n */\n processPack(pack) {\n const packData = pack.data[pack.key];\n if (!packData) {\n this.game.logger.warn('Missing loader pack key', { key: pack.key });\n return;\n }\n const packDataCompat = Array.isArray(packData) ? packData : packData.files;\n for (let i = 0; i < packDataCompat.length; i += 1) {\n const file = packDataCompat[i];\n switch (file.type) {\n case 'image':\n this.image(file.key, file.url, file.overwrite);\n break;\n case 'text':\n this.text(file.key, file.url, file.overwrite);\n break;\n case 'json':\n this.json(file.key, file.url, file.overwrite);\n break;\n case 'xml':\n this.xml(file.key, file.url, file.overwrite);\n break;\n case 'spritesheet':\n this.spritesheet(\n file.key,\n file.url,\n file.frameWidth,\n file.frameHeight,\n file.frameMax,\n file.margin,\n file.spacing\n );\n break;\n case 'audio':\n this.audio(file.key, file.urls ? file.urls : file.url);\n break;\n case 'audiosprite':\n this.audioSprite(file.key, file.urls ? file.urls : file.url, file.jsonURL, file.jsonData);\n break;\n case 'audioSprite':\n this.audioSprite(file.key, file.audioURL, file.jsonURL, file.jsonData);\n break;\n case 'bitmapFont':\n this.bitmapFont(\n file.key,\n file.textureURL,\n file.fontDataURL ? file.fontDataURL : file.atlasURL,\n file.atlasData,\n file.xSpacing,\n file.ySpacing\n );\n break;\n case 'atlas':\n this.atlas(file.key, file.textureURL, file.atlasURL, file.atlasData, TEXTURE_ATLAS_JSON_HASH);\n break;\n }\n }\n }\n\n /**\n * Transforms a URL by adding the base URL and path prefix if needed.\n * @param {string} url - The original URL to transform.\n * @param {object} file - The file object containing path information.\n * @returns {string} The transformed URL.\n */\n transformUrl(url, file) {\n if (!url) {\n return false;\n }\n if (url.match(/^(?:blob:|data:|http:\\/\\/|https:\\/\\/|\\/\\/)/)) {\n return url;\n }\n return this.baseURL + file.path + url;\n }\n\n /**\n * Loads a file using XMLHttpRequest, handling image files specially.\n * @param {object} file - The file object to load.\n */\n loadFile(file) {\n switch (file.type) {\n case 'packfile':\n this.xhrLoad(file, this.transformUrl(file.url, file), 'text', this.fileComplete);\n break;\n case 'image':\n case 'spritesheet':\n case 'textureatlas':\n case 'bitmapfont':\n this.loadImageTag(file);\n break;\n case 'audio':\n file.url = this.getAudioURL(file.url);\n if (file.url) {\n this.xhrLoad(file, this.transformUrl(file.url, file), 'arraybuffer', this.fileComplete);\n } else if (this.game.sound.noAudio) {\n this.fileError(file, null, 'Device does not have audio playback support');\n } else if (this.game.device.noAudioFormat) {\n this.fileError(file, null, 'Device does not have audio format support');\n } else {\n this.fileError(file, null, 'No supported audio URL specified');\n }\n break;\n case 'json':\n this.xhrLoad(file, this.transformUrl(file.url, file), 'text', this.jsonLoadComplete);\n break;\n case 'xml':\n this.xhrLoad(file, this.transformUrl(file.url, file), 'text', this.xmlLoadComplete);\n break;\n case 'text':\n this.xhrLoad(file, this.transformUrl(file.url, file), 'text', this.fileComplete);\n break;\n default:\n // pass\n break;\n }\n }\n\n /**\n * Loads an image file using the Image DOM element.\n * @param {object} file - The file object to load.\n */\n loadImageTag(file) {\n this.log('loadImageTag', file);\n const scope = this;\n file.data = new Image();\n file.data.name = file.key;\n if (this.crossOrigin) {\n file.data.crossOrigin = this.crossOrigin;\n }\n file.data.onload = () => {\n if (file.data.onload) {\n file.data.onload = null;\n file.data.onerror = null;\n scope.fileComplete(file);\n }\n };\n file.data.onerror = () => {\n if (scope.isUseRetry && (!file.numRetry || file.numRetry < scope.maxRetry)) {\n setTimeout(() => {\n file.numRetry = !file.numRetry ? 1 : (file.numRetry += 1);\n scope.loadImageTag(file);\n }, 1000);\n } else if (file.data.onload) {\n file.data.onload = null;\n file.data.onerror = null;\n scope.fileError(file);\n }\n };\n file.data.src = this.transformUrl(file.url, file);\n }\n\n /**\n * Loads a file using XMLHttpRequest with the specified parameters.\n * @param {object} file - The file object to load.\n * @param {string} url - The URL of the file to load.\n * @param {string} type - The expected response type (e.g., 'text', 'arraybuffer').\n * @param {Function} onload - The function to call when the file loads successfully.\n * @param {Function} onerror - The function to call if the file fails to load.\n */\n xhrLoad(file, url, type, onload, onerror = null) {\n this.log('xhrLoad', file);\n const scope = this;\n const xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = type;\n if (this.headers.requestedWith !== false) {\n xhr.setRequestHeader('X-Requested-With', this.headers.requestedWith);\n }\n if (this.headers[file.type]) {\n xhr.setRequestHeader('Accept', this.headers[file.type]);\n }\n onerror = onerror || this.fileError;\n xhr.onload = () => {\n try {\n if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599) {\n // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.\n if (scope.isUseRetry && (!file.numRetry || file.numRetry < scope.maxRetry)) {\n setTimeout(() => {\n file.numRetry = !file.numRetry ? 1 : (file.numRetry += 1);\n scope.xhrLoad(file, url, type, onload, onerror);\n }, 1000);\n return null;\n } else {\n return onerror.call(scope, file, xhr);\n }\n }\n return onload.call(scope, file, xhr);\n } catch (error) {\n const typedError = error instanceof Error ? error : new Error(String(error));\n // If this was the last file in the queue and an error is thrown in the create method\n // then it's caught here, so be sure we don't carry on processing it\n if (!scope.hasLoaded) {\n scope.asyncComplete(file, error.message || 'Exception');\n } else {\n scope.game.logger.exception('Loader', typedError);\n }\n }\n return null;\n };\n xhr.onerror = () => {\n if (scope.isUseRetry && (!file.numRetry || file.numRetry < scope.maxRetry)) {\n setTimeout(() => {\n file.numRetry = !file.numRetry ? 1 : (file.numRetry += 1);\n scope.xhrLoad(file, url, type, onload, onerror);\n }, 1000);\n } else {\n try {\n return onerror.call(scope, file, xhr);\n } catch (error) {\n const typedError = error instanceof Error ? error : new Error(String(error));\n if (!scope.hasLoaded) {\n scope.asyncComplete(file, error.message || 'Exception');\n } else {\n scope.game.logger.exception('Loader', typedError);\n }\n }\n }\n return null;\n };\n file.requestObject = xhr;\n file.requestUrl = url;\n xhr.send();\n }\n\n /**\n * Placeholder for XDomainRequest loading (not implemented).\n */\n xhrLoadWithXDR() {\n // TODO\n this.game.logger.warn('loader.xhrLoadWithXDR() is not implemented');\n }\n\n /**\n * Gets the first supported audio URL from a list of URLs.\n * @param {object[]} urls - The array of URLs to check for supported audio formats.\n * @returns {string} The first URL with a supported audio format, or null if none found.\n */\n getAudioURL(urls) {\n if (this.game.sound.noAudio || this.game.device.noAudioFormat) {\n return null;\n }\n for (let i = 0; i < urls.length; i += 1) {\n let url = urls[i];\n let audioType = null;\n if (url.uri) {\n // {uri: .., type: ..} pair\n audioType = url.type;\n url = url.uri;\n if (canPlayAudio(this.game.device, audioType)) {\n return url;\n }\n } else {\n // Assume direct-data URI can be played if not in a paired form; select immediately\n if (url.indexOf('blob:') === 0 || url.indexOf('data:') === 0) {\n return url;\n }\n if (url.indexOf('?') >= 0) {\n // Remove query from URL\n url = url.substr(0, url.indexOf('?'));\n }\n const extension = url.substr((Math.max(0, url.lastIndexOf('.')) || Infinity) + 1);\n audioType = extension.toLowerCase();\n if (canPlayAudio(this.game.device, audioType)) {\n return urls[i];\n }\n }\n }\n const formats = this.game.device.supportedAudioFormats;\n this.game.logger.warn('No supported audio format found', { urls, formats });\n return null;\n }\n\n /**\n * Handles file loading errors, optionally retrying or marking the file as failed.\n * @param {object} file - The file object that failed to load.\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest object that failed.\n * @param {number | string} reason - The error code or message explaining the failure.\n */\n fileError(file, xhr = null, reason = 0) {\n // const url = file.requestUrl || this.transformUrl(file.url, file);\n if (!reason && xhr) {\n reason = xhr.status;\n }\n const message = `Error loading asset (${reason})`;\n this.asyncComplete(file, message);\n }\n\n /**\n * TBD.\n * @param {object} file - TBD.\n * @param {XMLHttpRequest} xhr - TBD.\n * @throws {Error}\n */\n fileComplete(file, xhr) {\n let loadNext = true;\n switch (file.type) {\n case 'packfile':\n // Pack data must never be false-ish after it is fetched without error\n file.data = JSON.parse(xhr.responseText) || {};\n break;\n case 'image':\n this.cache.addImage(file.key, file.url, file.data);\n break;\n case 'spritesheet':\n this.cache.addSpriteSheet(\n file.key,\n file.url,\n file.data,\n file.frameWidth,\n file.frameHeight,\n file.frameMax,\n file.margin,\n file.spacing\n );\n break;\n case 'textureatlas':\n if (file.atlasURL == null) {\n this.cache.addTextureAtlas(file.key, file.url, file.data, file.atlasData, file.format);\n } else {\n loadNext = false;\n if (file.format === TEXTURE_ATLAS_JSON_HASH) {\n this.xhrLoad(file, this.transformUrl(file.atlasURL, file), 'text', this.jsonLoadComplete);\n } else {\n throw new Error(`Invalid Texture Atlas format: ${file.format}`);\n }\n }\n break;\n case 'bitmapfont':\n if (!file.atlasURL) {\n this.cache.addBitmapFont(\n file.key,\n file.url,\n file.data,\n file.atlasData,\n file.atlasType,\n file.xSpacing,\n file.ySpacing\n );\n } else {\n // Load the XML before carrying on with the next file\n loadNext = false;\n this.xhrLoad(file, this.transformUrl(file.atlasURL, file), 'text', (bitmapFontFile, bitmapFontXhr) => {\n let json;\n try {\n // Try to parse as JSON, if it fails, then it's hopefully XML\n json = JSON.parse(bitmapFontXhr.responseText);\n } catch (error) {\n // pass\n }\n if (json) {\n bitmapFontFile.atlasType = 'json';\n this.jsonLoadComplete(bitmapFontFile, bitmapFontXhr);\n } else {\n bitmapFontFile.atlasType = 'xml';\n this.xmlLoadComplete(bitmapFontFile, bitmapFontXhr);\n }\n });\n }\n break;\n case 'audio':\n file.data = xhr.response;\n this.cache.addSound(file.key, file.url, file.data);\n if (file.autoDecode) {\n this.game.sound.decode(file.key);\n }\n break;\n case 'text':\n file.data = xhr.responseText;\n this.cache.addText(file.key, file.url, file.data);\n break;\n default:\n // pass\n break;\n }\n if (loadNext) {\n this.asyncComplete(file);\n }\n }\n\n /**\n * Handles successful file loading, processing the file content appropriately.\n * @param {object} file - The file object that was loaded successfully.\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest object containing the file data.\n */\n jsonLoadComplete(file, xhr) {\n const data = JSON.parse(xhr.responseText);\n if (file.type === 'bitmapfont') {\n this.cache.addBitmapFont(file.key, file.url, file.data, data, file.atlasType, file.xSpacing, file.ySpacing);\n } else if (file.type === 'json') {\n this.cache.addJSON(file.key, file.url, data);\n } else {\n this.cache.addTextureAtlas(file.key, file.url, file.data, data, file.format);\n }\n this.asyncComplete(file);\n }\n\n /**\n * TBD.\n */\n csvLoadComplete() {\n // TODO\n this.game.logger.warn('loader.csvLoadComplete() is not implemented');\n }\n\n /**\n * Processes JSON file data after loading.\n * @param {object} file - The file object containing the JSON data.\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest object containing the file data.\n */\n xmlLoadComplete(file, xhr) {\n // Always try parsing the content as XML, regardless of actually response type\n const data = xhr.responseText;\n const xml = this.parseXml(data);\n if (!xml) {\n const responseType = xhr.responseType || xhr.contentType; // contentType for MS-XDomainRequest\n this.game.logger.warn(`${file.key}: invalid XML (${responseType})`);\n this.asyncComplete(file, 'invalid XML');\n return;\n }\n if (file.type === 'bitmapfont') {\n this.cache.addBitmapFont(file.key, file.url, file.data, xml, file.atlasType, file.xSpacing, file.ySpacing);\n } else if (file.type === 'textureatlas') {\n this.cache.addTextureAtlas(file.key, file.url, file.data, xml, file.format);\n } else if (file.type === 'xml') {\n this.cache.addXML(file.key, file.url, xml);\n }\n this.asyncComplete(file);\n }\n\n /**\n * Parses XML string data into a DOM Document object.\n * @param {object} data - The XML string data to parse.\n * @returns {Document} The parsed DOM Document, or null if parsing failed.\n */\n parseXml(data) {\n let xml = null;\n try {\n if (window.DOMParser) {\n const domparser = new DOMParser();\n xml = domparser.parseFromString(data, 'text/xml');\n } else {\n xml = new window.ActiveXObject('Microsoft.XMLDOM');\n // Why is this 'false'?\n xml.async = 'false';\n xml.loadXML(data);\n }\n } catch (error) {\n xml = null;\n }\n if (!xml || !xml.documentElement || xml.getElementsByTagName('parsererror').length) {\n return null;\n }\n return xml;\n }\n\n /**\n * Updates the preload sprite's progress indicator.\n */\n updateProgress() {\n if (this.preloadSprite) {\n if (this.preloadSprite.direction === 0) {\n this.preloadSprite.rect.width = Math.floor((this.preloadSprite.width / 100) * this.progress);\n } else {\n this.preloadSprite.rect.height = Math.floor((this.preloadSprite.height / 100) * this.progress);\n }\n if (this.preloadSprite.sprite) {\n this.preloadSprite.sprite.updateCrop();\n } else {\n // We seem to have lost our sprite - maybe it was destroyed?\n this.preloadSprite = null;\n }\n }\n }\n\n /**\n * Logs a message to the console if logging is enabled.\n * @param {string} message - The message to log.\n * @param {string|object} data - Additional data to log with the message.\n */\n log(message, data = '') {\n if (!this.isUseLog) {\n return;\n }\n this.game.logger.info(message, data);\n }\n\n /**\n * Gets the number of files that have been loaded.\n * @returns {number} The total number of loaded files.\n */\n totalLoadedFiles() {\n return this._loadedFileCount;\n }\n\n /**\n * Gets the number of files that are still queued for loading.\n * @returns {number} The total number of queued files.\n */\n totalQueuedFiles() {\n return this._totalFileCount - this._loadedFileCount;\n }\n\n /**\n * Gets the number of pack files that have been loaded.\n * @returns {number} The total number of loaded pack files.\n */\n totalLoadedPacks() {\n return this._totalPackCount;\n }\n\n /**\n * Gets the number of pack files that are still queued for loading.\n * @returns {number} The total number of queued pack files.\n */\n totalQueuedPacks() {\n return this._totalPackCount - this._loadedPackCount;\n }\n\n /**\n * Gets the loading progress as a percentage (0-100).\n * @returns {number} The current loading progress as a percentage.\n */\n get progressFloat() {\n const progress = (this._loadedFileCount / this._totalFileCount) * 100;\n return Math.max(0, Math.min(100, progress || 0));\n }\n\n /**\n * Gets the loading progress as a rounded percentage (0-100).\n * @returns {number} The current loading progress as a rounded percentage.\n */\n get progress() {\n return Math.round(this.progressFloat);\n }\n}","export class RequestAnimationFrame {\n game: any;\n rafId: number;\n\n /**\n * Constructor.\n * @param {import('./game.js').Game} game - Reference to the game instance.\n */\n constructor(game) {\n this.game = game;\n this.rafId = 0;\n }\n\n /**\n * Starts an animation frame request.\n */\n start = () => {\n this.rafId = requestAnimationFrame(this.update);\n };\n\n /**\n * Cancels an animation frame request.\n */\n stop = () => {\n cancelAnimationFrame(this.rafId);\n };\n\n /**\n * Performs an animation frame request.\n * @param {number} rafTime - The timestamp provided by the browser's animation frame.\n */\n update = (rafTime) => {\n this.game.update(rafTime);\n this.rafId = requestAnimationFrame(this.update);\n };\n}\n","import { Point } from '../geom/point.js';\n\nclass VisualBoundsDesktopRectangle {\n /**\n * Gets the horizontal scroll position of the window.\n * @returns {number} The horizontal scroll position in pixels.\n */\n get x() {\n return window && 'pageXOffset' in window ? window.pageXOffset : document.documentElement.scrollLeft;\n }\n\n /**\n * Gets the vertical scroll position of the window.\n * @returns {number} The vertical scroll position in pixels.\n */\n get y() {\n return window && 'pageYOffset' in window ? window.pageYOffset : document.documentElement.scrollTop;\n }\n\n /**\n * Gets the width of the window.\n * @returns {number} The width of the window in pixels.\n */\n get width() {\n return Math.max(window.innerWidth, document.documentElement.clientWidth);\n }\n\n /**\n * Gets the height of the window.\n * @returns {number} The height of the window in pixels.\n */\n get height() {\n return Math.max(window.innerHeight, document.documentElement.clientHeight);\n }\n}\n\nclass LayoutBoundsDesktopRectangle {\n /**\n * Gets the horizontal scroll position of the window.\n * @returns {number} The horizontal scroll position in pixels.\n */\n get x() {\n return 0;\n }\n\n /**\n * Gets the vertical scroll position of the window.\n * @returns {number} The vertical scroll position in pixels.\n */\n get y() {\n return 0;\n }\n\n /**\n * Gets the width of the window.\n * @returns {number} The width of the window in pixels.\n */\n get width() {\n return Math.max(window.innerWidth, document.documentElement.clientWidth);\n }\n\n /**\n * Gets the height of the window.\n * @returns {number} The height of the window in pixels.\n */\n get height() {\n return Math.max(window.innerHeight, document.documentElement.clientHeight);\n }\n}\n\nclass VisualBoundsRectangle {\n /**\n * Gets the horizontal scroll position of the document.\n * @returns {number} The horizontal scroll position in pixels.\n */\n get x() {\n return window && 'pageXOffset' in window ? window.pageXOffset : document.documentElement.scrollLeft;\n }\n\n /**\n * Gets the vertical scroll position of the document.\n * @returns {number} The vertical scroll position in pixels.\n */\n get y() {\n return window && 'pageYOffset' in window ? window.pageYOffset : document.documentElement.scrollTop;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get width() {\n return window.innerWidth;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get height() {\n return window.innerHeight;\n }\n}\n\nclass LayoutBoundsRectangle {\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get x() {\n return 0;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get y() {\n return 0;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get width() {\n const a = document.documentElement.clientWidth;\n const b = window.innerWidth;\n return a < b ? b : a; // max\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get height() {\n const a = document.documentElement.clientHeight;\n const b = window.innerHeight;\n return a < b ? b : a; // max\n }\n}\n\n// For documentBounds\n// Ref. http://www.quirksmode.org/mobile/tableViewport_desktop.html\n\nclass DocumentBoundsRectangle {\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get x() {\n return 0;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get y() {\n return 0;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get width() {\n const d = document.documentElement;\n return Math.max(d.clientWidth, d.offsetWidth, d.scrollWidth);\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get height() {\n const d = document.documentElement;\n return Math.max(d.clientHeight, d.offsetHeight, d.scrollHeight);\n }\n}\n\nexport class DOM {\n treatAsDesktop: boolean;\n visualBounds: any;\n layoutBounds: any;\n documentBounds: any;\n scrollXProvider: () => number;\n scrollYProvider: () => number;\n\n /**\n * TBD.\n * @param {import('./device.js').Device} device - TBD.\n */\n constructor(device) {\n this.treatAsDesktop =\n device.desktop &&\n document.documentElement.clientWidth <= window.innerWidth &&\n document.documentElement.clientHeight <= window.innerHeight;\n this.visualBounds = this.treatAsDesktop ? new VisualBoundsDesktopRectangle() : new VisualBoundsRectangle();\n this.layoutBounds = this.treatAsDesktop ? new LayoutBoundsDesktopRectangle() : new LayoutBoundsRectangle();\n this.documentBounds = new DocumentBoundsRectangle();\n this.scrollXProvider =\n window && 'pageXOffset' in window ? () => window.pageXOffset : () => document.documentElement.scrollLeft;\n this.scrollYProvider =\n window && 'pageYOffset' in window ? () => window.pageYOffset : () => document.documentElement.scrollTop;\n }\n\n /**\n * Gets the offset position of an element relative to the document.\n * @param {HTMLCanvasElement} element - The element to get the offset for.\n * @param {Point} point - Optional Point object to store the result.\n * @returns {Point} The offset position of the element.\n */\n getOffset(element, point = null) {\n point = point || new Point();\n const box = element.getBoundingClientRect();\n const scrollTop = this.scrollY;\n const scrollLeft = this.scrollX;\n const clientTop = document.documentElement.clientTop;\n const clientLeft = document.documentElement.clientLeft;\n point.x = box.left + scrollLeft - clientLeft;\n point.y = box.top + scrollTop - clientTop;\n return point;\n }\n\n /**\n * Gets the bounding rectangle of an element with optional cushion.\n * @param {HTMLCanvasElement} element - The element to get bounds for.\n * @param {number} cushion - Optional padding to add around the element.\n * @returns {boolean} True if bounds were successfully retrieved, false otherwise.\n */\n getBounds(element, cushion = 0) {\n element = element && !element.nodeType ? element[0] : element;\n if (!element || element.nodeType !== 1) {\n return false;\n }\n return this.calibrate(element.getBoundingClientRect(), cushion);\n }\n\n /**\n * Calibrates DOM rectangle coordinates with optional cushion.\n * @param {DOMRect} coords - The DOM rectangle coordinates to calibrate.\n * @param {number} cushion - Optional padding to add around the rectangle.\n * @returns {{width: number, height: number, left: number, right: number, top: number, bottom: number}} The calibrated rectangle.\n */\n calibrate(coords, cushion = 0) {\n const output = {\n width: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n };\n output.width = (output.right = coords.right + cushion) - (output.left = coords.left - cushion);\n output.height = (output.bottom = coords.bottom + cushion) - (output.top = coords.top - cushion);\n return output;\n }\n\n /**\n * Gets the screen orientation.\n * @param {string} primaryFallback - The fallback method to use if screen orientation API is not available.\n * @returns {string} The screen orientation ('portrait-primary', 'landscape-primary', etc.).\n */\n getScreenOrientation(primaryFallback) {\n const screen = window.screen;\n // @ts-ignore\n const orientation = screen.orientation || screen.mozOrientation || screen.msOrientation;\n if (orientation && typeof orientation.type === 'string') {\n // Screen Orientation API specification\n return orientation.type;\n } else if (typeof orientation === 'string') {\n // moz/ms-orientation are strings\n return orientation;\n }\n const PORTRAIT = 'portrait-primary';\n const LANDSCAPE = 'landscape-primary';\n if (primaryFallback === 'screen') {\n return screen.height > screen.width ? PORTRAIT : LANDSCAPE;\n } else if (primaryFallback === 'viewport') {\n return this.visualBounds.height > this.visualBounds.width ? PORTRAIT : LANDSCAPE;\n } else if (primaryFallback === 'window.orientation' && typeof window.orientation === 'number') {\n // This may change by device based on \"natural\" orientation.\n return window.orientation === 0 || window.orientation === 180 ? PORTRAIT : LANDSCAPE;\n } else if (window.matchMedia) {\n if (window.matchMedia('(orientation: portrait)').matches) {\n return PORTRAIT;\n } else if (window.matchMedia('(orientation: landscape)').matches) {\n return LANDSCAPE;\n }\n }\n return this.visualBounds.height > this.visualBounds.width ? PORTRAIT : LANDSCAPE;\n }\n\n /**\n * Gets the horizontal scroll position of the window.\n * @returns {number} The horizontal scroll position in pixels.\n */\n get scrollX() {\n return this.scrollXProvider();\n }\n\n /**\n * Gets the vertical scroll position of the window.\n * @returns {number} The vertical scroll position in pixels.\n */\n get scrollY() {\n return this.scrollYProvider();\n }\n\n /**\n * Gets the width of the window's client area.\n * @returns {number} The width of the client area in pixels.\n */\n get clientWidth() {\n return Math.max(window.innerWidth, document.documentElement.clientWidth);\n }\n\n /**\n * Gets the height of the window's client area.\n * @returns {number} The height of the client area in pixels.\n */\n get clientHeight() {\n return Math.max(window.innerHeight, document.documentElement.clientHeight);\n }\n}\n","// @ts-nocheck\nimport { Point } from '../geom/point.js';\nimport { Rectangle } from '../geom/rectangle.js';\nimport { RENDER_CANVAS, SCALE_EXACT_FIT, SCALE_OFF, SCALE_RESIZE, SCALE_SHOW_ALL, SCALE_USER } from './const.js';\nimport { DOM } from './dom.js';\nimport { Signal } from './signal.js';\n\nexport class ScaleManager {\n /**\n * TBD.\n * @param {import('./game.js').Game} game - TBD.\n * @param {number} width - TBD.\n * @param {number} height - TBD.\n */\n constructor(game, width, height) {\n this.game = game;\n this.dom = new DOM(game.device);\n this.width = 0;\n this.height = 0;\n this.minWidth = null;\n this.maxWidth = null;\n this.minHeight = null;\n this.maxHeight = null;\n this.offset = new Point();\n this.forceLandscape = false;\n this.forcePortrait = false;\n this.incorrectOrientation = false;\n this._pageAlignHorizontally = false;\n this._pageAlignVertically = false;\n this.onOrientationChange = new Signal();\n this.enterIncorrectOrientation = new Signal();\n this.leaveIncorrectOrientation = new Signal();\n this.hasPhaserSetFullScreen = false;\n this.fullScreenTarget = null;\n this._createdFullScreenTarget = null;\n this.onFullScreenInit = new Signal();\n this.onFullScreenChange = new Signal();\n this.onFullScreenError = new Signal();\n this.screenOrientation = this.dom.getScreenOrientation();\n this.scaleFactor = new Point(1, 1);\n this.scaleFactorInversed = new Point(1, 1);\n this.margin = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n x: 0,\n y: 0,\n };\n this.bounds = new Rectangle();\n this.aspectRatio = 0;\n this.sourceAspectRatio = 0;\n /** @type {Event | null | undefined} */\n this.event = null;\n this.windowConstraints = {\n right: 'layout',\n bottom: '',\n };\n this.compatibility = {\n supportsFullScreen: false,\n orientationFallback: null,\n noMargins: false,\n canExpandParent: true,\n clickTrampoline: '',\n };\n this._scaleMode = SCALE_OFF;\n this._fullScreenScaleMode = SCALE_OFF;\n this.parentIsWindow = false;\n this.parentNode = null;\n this.parentScaleFactor = new Point(1, 1);\n this.trackParentInterval = 2000;\n this.onSizeChange = new Signal();\n this.onResize = null;\n this.onResizeContext = null;\n this._pendingScaleMode = null;\n this._fullScreenRestore = null;\n this._gameSize = new Rectangle();\n this._userScaleFactor = new Point(1, 1);\n this._userScaleTrim = new Point(0, 0);\n this._lastUpdate = 0;\n this._updateThrottle = 0;\n this._updateThrottleReset = 100;\n this._parentBounds = new Rectangle();\n this._tempBounds = new Rectangle();\n this._lastReportedCanvasSize = new Rectangle();\n this._lastReportedGameSize = new Rectangle();\n this._booted = false;\n if (game.config) {\n this.parseConfig(game.config);\n }\n this.setupScale(width, height);\n }\n\n /**\n * TBD.\n */\n boot() {\n // Configure device-dependent compatibility\n const compat = this.compatibility;\n compat.supportsFullScreen = this.game.device.fullscreen;\n if (this.game.device.desktop) {\n compat.orientationFallback = 'screen';\n compat.clickTrampoline = 'when-not-mouse';\n } else {\n compat.orientationFallback = '';\n compat.clickTrampoline = '';\n }\n // Configure event listeners\n const scope = this;\n this._orientationChange = (event) => scope.orientationChange(event);\n this._windowResize = (event) => scope.windowResize(event);\n // This does not appear to be on the standards track\n window.addEventListener('orientationchange', this._orientationChange, false);\n window.addEventListener('resize', this._windowResize, false);\n if (this.compatibility.supportsFullScreen) {\n this._fullScreenChange = (event) => scope.fullScreenChange(event);\n this._fullScreenError = (event) => scope.fullScreenError(event);\n document.addEventListener('webkitfullscreenchange', this._fullScreenChange, false);\n document.addEventListener('mozfullscreenchange', this._fullScreenChange, false);\n document.addEventListener('MSFullscreenChange', this._fullScreenChange, false);\n document.addEventListener('fullscreenchange', this._fullScreenChange, false);\n document.addEventListener('webkitfullscreenerror', this._fullScreenError, false);\n document.addEventListener('mozfullscreenerror', this._fullScreenError, false);\n document.addEventListener('MSFullscreenError', this._fullScreenError, false);\n document.addEventListener('fullscreenerror', this._fullScreenError, false);\n }\n this.game.onResume.add(this._gameResumed, this);\n // Initialize core bounds\n this.dom.getOffset(this.game.canvas, this.offset);\n this.bounds.setTo(this.offset.x, this.offset.y, this.width, this.height);\n this.setGameSize(this.game.width, this.game.height);\n // Don't use updateOrientationState so events are not fired\n this.screenOrientation = this.dom.getScreenOrientation(this.compatibility.orientationFallback);\n this._booted = true;\n if (this._pendingScaleMode !== null) {\n this.scaleMode = this._pendingScaleMode;\n this._pendingScaleMode = null;\n }\n }\n\n /**\n * TBD.\n * @param {object} config - TBD.\n */\n parseConfig(config) {\n if (config.scaleMode !== undefined) {\n if (this._booted) {\n this.scaleMode = config.scaleMode;\n } else {\n this._pendingScaleMode = config.scaleMode;\n }\n }\n if (config.fullScreenScaleMode !== undefined) {\n this.fullScreenScaleMode = config.fullScreenScaleMode;\n }\n if (config.fullScreenTarget) {\n this.fullScreenTarget = config.fullScreenTarget;\n } else {\n this.fullScreenTarget = document.documentElement;\n }\n }\n\n /**\n * TBD.\n * @param {number} width - TBD.\n * @param {number} height - TBD.\n */\n setupScale(width, height) {\n let target;\n const rect = new Rectangle();\n if (this.game.parent !== '') {\n if (typeof this.game.parent === 'string') {\n // hopefully an element ID\n target = document.getElementById(this.game.parent);\n } else if (this.game.parent && this.game.parent.nodeType === 1) {\n // quick test for a HTMLelement\n target = this.game.parent;\n }\n }\n // Fallback, covers an invalid ID and a non HTMLelement object\n if (!target) {\n // Use the full window\n this.parentNode = null;\n this.parentIsWindow = true;\n rect.width = this.dom.visualBounds.width;\n rect.height = this.dom.visualBounds.height;\n this.offset.setTo(0, 0);\n } else {\n this.parentNode = target;\n this.parentIsWindow = false;\n this.getParentBounds(this._parentBounds);\n rect.width = this._parentBounds.width;\n rect.height = this._parentBounds.height;\n this.offset.setTo(this._parentBounds.x, this._parentBounds.y);\n }\n let newWidth = 0;\n let newHeight = 0;\n if (typeof width === 'number') {\n newWidth = width;\n } else {\n // Percentage based\n this.parentScaleFactor.x = Number.parseInt(width, 10) / 100;\n newWidth = rect.width * this.parentScaleFactor.x;\n }\n if (typeof height === 'number') {\n newHeight = height;\n } else {\n // Percentage based\n this.parentScaleFactor.y = Number.parseInt(height, 10) / 100;\n newHeight = rect.height * this.parentScaleFactor.y;\n }\n newWidth = Math.floor(newWidth);\n newHeight = Math.floor(newHeight);\n this._gameSize.setTo(0, 0, newWidth, newHeight);\n this.updateDimensions(newWidth, newHeight, false);\n }\n\n /**\n * TBD.\n */\n _gameResumed() {\n this.queueUpdate(true);\n }\n\n /**\n * TBD.\n * @param {number} width - TBD.\n * @param {number} height - TBD.\n */\n setGameSize(width, height) {\n this._gameSize.setTo(0, 0, width, height);\n if (this.currentScaleMode !== SCALE_RESIZE) {\n this.updateDimensions(width, height, true);\n }\n this.queueUpdate(true);\n }\n\n /**\n * TBD.\n * @param {number} hScale - TBD.\n * @param {number} vScale - TBD.\n * @param {number} hTrim - TBD.\n * @param {number} vTrim - TBD.\n */\n setUserScale(hScale, vScale, hTrim, vTrim) {\n this._userScaleFactor.setTo(hScale, vScale);\n this._userScaleTrim.setTo(hTrim | 0, vTrim | 0);\n this.queueUpdate(true);\n }\n\n /**\n * TBD.\n * @param {Function} callback - TBD.\n * @param {object} context - TBD.\n */\n setResizeCallback(callback, context) {\n this.onResize = callback;\n this.onResizeContext = context;\n }\n\n /**\n * TBD.\n */\n signalSizeChange() {\n if (\n this.width !== this._lastReportedCanvasSize.width ||\n this.height !== this._lastReportedCanvasSize.height ||\n this.game.width !== this._lastReportedGameSize.width ||\n this.game.height !== this._lastReportedGameSize.height\n ) {\n const width = this.width;\n const height = this.height;\n this._lastReportedCanvasSize.setTo(0, 0, width, height);\n this._lastReportedGameSize.setTo(0, 0, this.game.width, this.game.height);\n this.onSizeChange.dispatch(this, width, height);\n // Per StateManager#onResizeCallback, it only occurs when in RESIZE mode.\n if (this.currentScaleMode === SCALE_RESIZE) {\n this.game.state.resize(width, height);\n this.game.load.resize(width, height);\n }\n }\n }\n\n /**\n * TBD.\n * @param {number} minWidth - TBD.\n * @param {number} minHeight - TBD.\n * @param {number} maxWidth - TBD.\n * @param {number} maxHeight - TBD.\n */\n setMinMax(minWidth, minHeight, maxWidth, maxHeight) {\n this.minWidth = minWidth;\n this.minHeight = minHeight;\n if (typeof maxWidth !== 'undefined') {\n this.maxWidth = maxWidth;\n }\n if (typeof maxHeight !== 'undefined') {\n this.maxHeight = maxHeight;\n }\n }\n\n /**\n * TBD.\n */\n preUpdate() {\n if (this.game.time.time < this._lastUpdate + this._updateThrottle) {\n return;\n }\n const prevThrottle = this._updateThrottle;\n this._updateThrottleReset = prevThrottle >= 400 ? 0 : 100;\n this.dom.getOffset(this.game.canvas, this.offset);\n const prevWidth = this._parentBounds.width;\n const prevHeight = this._parentBounds.height;\n const bounds = this.getParentBounds(this._parentBounds);\n const boundsChanged = bounds.width !== prevWidth || bounds.height !== prevHeight;\n // Always invalidate on a newly detected orientation change\n const orientationChanged = this.updateOrientationState();\n if (boundsChanged || orientationChanged) {\n if (this.onResize) {\n this.onResize.call(this.onResizeContext, this, bounds);\n }\n this.updateLayout();\n this.signalSizeChange();\n }\n // Next throttle, eg. 25, 50, 100, 200..\n let throttle = this._updateThrottle * 2;\n // Don't let an update be too eager about resetting the throttle.\n if (this._updateThrottle < prevThrottle) {\n throttle = Math.min(prevThrottle, this._updateThrottleReset);\n }\n this._updateThrottle = Math.max(25, Math.min(this.trackParentInterval, throttle));\n this._lastUpdate = this.game.time.time;\n }\n\n /**\n * TBD.\n */\n pauseUpdate() {\n this.preUpdate();\n // Updates at slowest.\n this._updateThrottle = this.trackParentInterval;\n }\n\n /**\n * TBD.\n * @param {number} width - TBD.\n * @param {number} height - TBD.\n * @param {boolean} resize - TBD.\n */\n updateDimensions(width, height, resize) {\n this.width = width * this.parentScaleFactor.x;\n this.height = height * this.parentScaleFactor.y;\n this.game.width = this.width;\n this.game.height = this.height;\n this.sourceAspectRatio = this.width / this.height;\n this.updateScalingAndBounds();\n if (resize) {\n // Resize the renderer (which in turn resizes the Display canvas!)\n this.game.renderer.resize(this.width, this.height);\n }\n }\n\n /**\n * TBD.\n */\n updateScalingAndBounds() {\n this.scaleFactor.x = this.game.width / this.width;\n this.scaleFactor.y = this.game.height / this.height;\n this.scaleFactorInversed.x = this.width / this.game.width;\n this.scaleFactorInversed.y = this.height / this.game.height;\n this.aspectRatio = this.width / this.height;\n // This can be invoked in boot pre-canvas\n if (this.game.canvas) {\n this.dom.getOffset(this.game.canvas, this.offset);\n }\n this.bounds.setTo(this.offset.x, this.offset.y, this.width, this.height);\n // Can be invoked in boot pre-input\n if (this.game.input && this.game.input.scale) {\n this.game.input.scale.setTo(this.scaleFactor.x, this.scaleFactor.y);\n }\n }\n\n /**\n * TBD.\n * @param {boolean} forceLandscape - TBD.\n * @param {boolean} forcePortrait - TBD.\n */\n forceOrientation(forceLandscape = false, forcePortrait = false) {\n this.forceLandscape = forceLandscape;\n this.forcePortrait = forcePortrait;\n this.queueUpdate(true);\n }\n\n /**\n * TBD.\n * @param {string} orientation - TBD.\n * @returns {string} TBD.\n */\n classifyOrientation(orientation) {\n if (orientation === 'portrait-primary' || orientation === 'portrait-secondary') {\n return 'portrait';\n } else if (orientation === 'landscape-primary' || orientation === 'landscape-secondary') {\n return 'landscape';\n }\n return null;\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n updateOrientationState() {\n const previousOrientation = this.screenOrientation;\n const previouslyIncorrect = this.incorrectOrientation;\n this.screenOrientation = this.dom.getScreenOrientation(this.compatibility.orientationFallback);\n this.incorrectOrientation = (this.forceLandscape && !this.isLandscape) || (this.forcePortrait && !this.isPortrait);\n const changed = previousOrientation !== this.screenOrientation;\n const correctnessChanged = previouslyIncorrect !== this.incorrectOrientation;\n if (correctnessChanged) {\n if (this.incorrectOrientation) {\n this.enterIncorrectOrientation.dispatch();\n } else {\n this.leaveIncorrectOrientation.dispatch();\n }\n }\n if (changed || correctnessChanged) {\n this.onOrientationChange.dispatch(this, previousOrientation, previouslyIncorrect);\n }\n return changed || correctnessChanged;\n }\n\n /**\n * TBD.\n * @param {Event} event - TBD.\n */\n orientationChange(event) {\n this.event = event;\n this.queueUpdate(true);\n }\n\n /**\n * TBD.\n * @param {Event} event - TBD.\n */\n windowResize(event) {\n this.event = event;\n this.queueUpdate(true);\n }\n\n /**\n * TBD.\n */\n refresh() {\n this.queueUpdate(true);\n }\n\n /**\n * TBD.\n */\n updateLayout() {\n const scaleMode = this.currentScaleMode;\n if (scaleMode === SCALE_RESIZE) {\n this.reflowGame();\n return;\n }\n if (this.incorrectOrientation) {\n this.setMaximum();\n } else if (scaleMode === SCALE_EXACT_FIT) {\n this.setExactFit();\n } else if (scaleMode === SCALE_SHOW_ALL) {\n if (!this.isFullScreen && this.boundingParent && this.compatibility.canExpandParent) {\n // Try to expand parent out, but choosing maximizing dimensions.\n // Then select minimize dimensions which should then honor parent\n // maximum bound applications.\n this.setShowAll(true);\n this.resetCanvas();\n this.setShowAll();\n } else {\n this.setShowAll();\n }\n } else if (scaleMode === SCALE_OFF) {\n this.width = this.game.width;\n this.height = this.game.height;\n } else if (scaleMode === SCALE_USER) {\n this.width = this.game.width * this._userScaleFactor.x - this._userScaleTrim.x;\n this.height = this.game.height * this._userScaleFactor.y - this._userScaleTrim.y;\n }\n if (!this.compatibility.canExpandParent && (scaleMode === SCALE_SHOW_ALL || scaleMode === SCALE_USER)) {\n const bounds = this.getParentBounds(this._tempBounds);\n this.width = Math.min(this.width, bounds.width);\n this.height = Math.min(this.height, bounds.height);\n }\n // Always truncate / force to integer\n this.width = this.width | 0;\n this.height = this.height | 0;\n this.reflowCanvas();\n }\n\n /**\n * TBD.\n * @param {Rectangle} target - TBD.\n * @returns {Rectangle} TBD.\n */\n getParentBounds(target) {\n const bounds = target || new Rectangle();\n const parentNode = this.boundingParent;\n const visualBounds = this.dom.visualBounds;\n const layoutBounds = this.dom.layoutBounds;\n if (!parentNode) {\n bounds.setTo(0, 0, visualBounds.width, visualBounds.height);\n } else {\n // Ref. http://msdn.microsoft.com/en-us/library/hh781509(v=vs.85).aspx for getBoundingClientRect\n const clientRect = parentNode.getBoundingClientRect();\n const parentRect = parentNode.offsetParent\n ? parentNode.offsetParent.getBoundingClientRect()\n : parentNode.getBoundingClientRect();\n bounds.setTo(\n clientRect.left - parentRect.left,\n clientRect.top - parentRect.top,\n clientRect.width,\n clientRect.height\n );\n const wc = this.windowConstraints;\n if (wc.right) {\n const windowBounds = wc.right === 'layout' ? layoutBounds : visualBounds;\n bounds.right = Math.min(bounds.right, windowBounds.width);\n }\n if (wc.bottom) {\n const windowBounds = wc.bottom === 'layout' ? layoutBounds : visualBounds;\n bounds.bottom = Math.min(bounds.bottom, windowBounds.height);\n }\n }\n bounds.setTo(Math.round(bounds.x), Math.round(bounds.y), Math.round(bounds.width), Math.round(bounds.height));\n return bounds;\n }\n\n /**\n * TBD.\n * @param {boolean} horizontal - TBD.\n * @param {boolean} vertical - TBD.\n */\n alignCanvas(horizontal, vertical) {\n const parentBounds = this.getParentBounds(this._tempBounds);\n const canvas = this.game.canvas;\n const margin = this.margin;\n if (horizontal) {\n margin.left = 0;\n margin.right = 0;\n const canvasBounds = canvas.getBoundingClientRect();\n if (this.width < parentBounds.width && !this.incorrectOrientation) {\n const currentEdge = canvasBounds.left - parentBounds.x;\n let targetEdge = parentBounds.width / 2 - this.width / 2;\n targetEdge = Math.max(targetEdge, 0);\n const offset = targetEdge - currentEdge;\n margin.left = Math.round(offset);\n }\n canvas.style.marginLeft = `${margin.left}px`;\n if (margin.left !== 0) {\n margin.right = -(parentBounds.width - canvasBounds.width - margin.left);\n canvas.style.marginRight = `${margin.right}px`;\n }\n }\n if (vertical) {\n margin.top = 0;\n margin.bottom = 0;\n const canvasBounds = canvas.getBoundingClientRect();\n if (this.height < parentBounds.height && !this.incorrectOrientation) {\n const currentEdge = canvasBounds.top - parentBounds.y;\n let targetEdge = parentBounds.height / 2 - this.height / 2;\n targetEdge = Math.max(targetEdge, 0);\n const offset = targetEdge - currentEdge;\n margin.top = Math.round(offset);\n }\n canvas.style.marginTop = `${margin.top}px`;\n if (margin.top !== 0) {\n margin.bottom = -(parentBounds.height - canvasBounds.height - margin.top);\n canvas.style.marginBottom = `${margin.bottom}px`;\n }\n }\n // Silly backwards compatibility..\n margin.x = margin.left;\n margin.y = margin.top;\n }\n\n /**\n * TBD.\n */\n reflowGame() {\n this.resetCanvas('', '');\n const bounds = this.getParentBounds(this._tempBounds);\n this.updateDimensions(bounds.width, bounds.height, true);\n }\n\n /**\n * TBD.\n */\n reflowCanvas() {\n if (!this.incorrectOrientation) {\n this.width = Math.max(this.minWidth || 0, Math.min(this.maxWidth || this.width, this.width));\n this.height = Math.max(this.minHeight || 0, Math.min(this.maxHeight || this.height, this.height));\n }\n this.resetCanvas();\n if (!this.compatibility.noMargins) {\n if (this.isFullScreen && this._createdFullScreenTarget) {\n this.alignCanvas(true, true);\n } else {\n this.alignCanvas(this.pageAlignHorizontally, this.pageAlignVertically);\n }\n }\n this.updateScalingAndBounds();\n }\n\n /**\n * TBD.\n * @param {string} cssWidth - TBD.\n * @param {string} cssHeight - TBD.\n */\n resetCanvas(cssWidth = `${this.width}px`, cssHeight = `${this.height}px`) {\n const canvas = this.game.canvas;\n if (!this.compatibility.noMargins) {\n canvas.style.marginLeft = '';\n canvas.style.marginTop = '';\n canvas.style.marginRight = '';\n canvas.style.marginBottom = '';\n }\n canvas.style.width = cssWidth;\n canvas.style.height = cssHeight;\n }\n\n /**\n * TBD.\n * @param {boolean} force - TBD.\n */\n queueUpdate(force) {\n if (force) {\n this._parentBounds.width = 0;\n this._parentBounds.height = 0;\n }\n this._updateThrottle = this._updateThrottleReset;\n }\n\n /**\n * TBD.\n */\n reset() {\n // pass\n }\n\n /**\n * TBD.\n */\n setMaximum() {\n this.width = this.dom.visualBounds.width;\n this.height = this.dom.visualBounds.height;\n }\n\n /**\n * TBD.\n * @param {boolean} expanding - TBD.\n */\n setShowAll(expanding = false) {\n const bounds = this.getParentBounds(this._tempBounds);\n const width = bounds.width;\n const height = bounds.height;\n let multiplier;\n if (expanding) {\n multiplier = Math.max(height / this.game.height, width / this.game.width);\n } else {\n multiplier = Math.min(height / this.game.height, width / this.game.width);\n }\n this.width = Math.round(this.game.width * multiplier);\n this.height = Math.round(this.game.height * multiplier);\n }\n\n /**\n * TBD.\n */\n setExactFit() {\n const bounds = this.getParentBounds(this._tempBounds);\n this.width = bounds.width;\n this.height = bounds.height;\n if (this.isFullScreen) {\n // Max/min not honored fullscreen\n return;\n }\n if (this.maxWidth) {\n this.width = Math.min(this.width, this.maxWidth);\n }\n if (this.maxHeight) {\n this.height = Math.min(this.height, this.maxHeight);\n }\n }\n\n /**\n * TBD.\n * @returns {HTMLDivElement} TBD.\n */\n createFullScreenTarget() {\n const fsTarget = document.createElement('div');\n fsTarget.style.margin = '0';\n fsTarget.style.padding = '0';\n fsTarget.style.background = '#000';\n return fsTarget;\n }\n\n /**\n * TBD.\n * @param {boolean} antialias - TBD.\n * @param {boolean} allowTrampoline - TBD.\n * @returns {boolean} TBD.\n */\n startFullScreen(antialias, allowTrampoline) {\n if (this.isFullScreen) {\n return false;\n }\n if (!this.compatibility.supportsFullScreen) {\n // Error is called in timeout to emulate the real fullscreenerror event better\n const scope = this;\n setTimeout(() => {\n scope.fullScreenError();\n }, 10);\n return false;\n }\n if (this.compatibility.clickTrampoline === 'when-not-mouse') {\n const input = this.game.input;\n if (\n input.activePointer &&\n input.activePointer !== input.mousePointer &&\n (allowTrampoline || allowTrampoline !== false)\n ) {\n input.activePointer.addClickTrampoline('startFullScreen', this.startFullScreen, this, [antialias, false]);\n return false;\n }\n }\n if (antialias !== undefined && this.game.renderer.type === RENDER_CANVAS) {\n this.game.stage.smoothed = antialias;\n }\n let fsTarget = this.fullScreenTarget;\n if (!fsTarget) {\n this.cleanupCreatedTarget();\n this._createdFullScreenTarget = this.createFullScreenTarget();\n fsTarget = this._createdFullScreenTarget;\n }\n this.hasPhaserSetFullScreen = true;\n this.onFullScreenInit.dispatch(this, { targetElement: fsTarget });\n if (this._createdFullScreenTarget) {\n // Move the Display canvas inside of the target and add the target to the DOM\n // (The target has to be added for the Fullscreen API to work.)\n const canvas = this.game.canvas;\n const parent = canvas.parentNode;\n parent.insertBefore(fsTarget, canvas);\n fsTarget.appendChild(canvas);\n }\n if (this.game.device.fullscreenKeyboard) {\n fsTarget[this.game.device.requestFullscreen](Element.ALLOW_KEYBOARD_INPUT);\n } else {\n fsTarget[this.game.device.requestFullscreen]();\n }\n return true;\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n stopFullScreen() {\n if (!this.isFullScreen || !this.compatibility.supportsFullScreen) {\n return false;\n }\n this.hasPhaserSetFullScreen = false;\n document[this.game.device.cancelFullscreen]();\n return true;\n }\n\n /**\n * TBD.\n */\n cleanupCreatedTarget() {\n const fsTarget = this._createdFullScreenTarget;\n if (fsTarget && fsTarget.parentNode) {\n // Make sure to cleanup synthetic target for sure;\n // swap the canvas back to the parent.\n const parent = fsTarget.parentNode;\n parent.insertBefore(this.game.canvas, fsTarget);\n parent.removeChild(fsTarget);\n }\n this._createdFullScreenTarget = null;\n }\n\n /**\n * TBD.\n * @param {boolean} enteringFullscreen - TBD.\n */\n prepScreenMode(enteringFullscreen) {\n const fsTarget = this._createdFullScreenTarget || this.fullScreenTarget;\n if (!fsTarget) {\n return;\n }\n if (enteringFullscreen) {\n if (this._createdFullScreenTarget || this.fullScreenScaleMode === SCALE_EXACT_FIT) {\n // Resize target, as long as it's not the canvas\n if (fsTarget !== this.game.canvas) {\n this._fullScreenRestore = {\n targetWidth: fsTarget.style.width,\n targetHeight: fsTarget.style.height,\n };\n fsTarget.style.width = '100%';\n fsTarget.style.height = '100%';\n }\n }\n } else {\n // Have restore information\n if (this._fullScreenRestore) {\n fsTarget.style.width = this._fullScreenRestore.targetWidth;\n fsTarget.style.height = this._fullScreenRestore.targetHeight;\n this._fullScreenRestore = null;\n }\n // Always reset to game size\n this.updateDimensions(this._gameSize.width, this._gameSize.height, true);\n this.resetCanvas();\n }\n }\n\n /**\n * TBD.\n * @param {Event} event - TBD.\n */\n fullScreenChange(event) {\n this.event = event;\n if (this.isFullScreen) {\n this.prepScreenMode(true);\n this.updateLayout();\n this.queueUpdate(true);\n } else {\n this.prepScreenMode(false);\n this.cleanupCreatedTarget();\n this.updateLayout();\n this.queueUpdate(true);\n }\n this.onFullScreenChange.dispatch(this, this.width, this.height);\n }\n\n /**\n * TBD.\n * @param {Event} [event] - TBD.\n */\n fullScreenError(event) {\n this.event = event;\n this.cleanupCreatedTarget();\n this.onFullScreenError.dispatch(this);\n }\n\n /**\n * TBD.\n */\n destroy() {\n this.game.onResume.remove(this._gameResumed, this);\n window.removeEventListener('orientationchange', this._orientationChange, false);\n window.removeEventListener('resize', this._windowResize, false);\n if (this.compatibility.supportsFullScreen) {\n document.removeEventListener('webkitfullscreenchange', this._fullScreenChange, false);\n document.removeEventListener('mozfullscreenchange', this._fullScreenChange, false);\n document.removeEventListener('MSFullscreenChange', this._fullScreenChange, false);\n document.removeEventListener('fullscreenchange', this._fullScreenChange, false);\n\n document.removeEventListener('webkitfullscreenerror', this._fullScreenError, false);\n document.removeEventListener('mozfullscreenerror', this._fullScreenError, false);\n document.removeEventListener('MSFullscreenError', this._fullScreenError, false);\n document.removeEventListener('fullscreenerror', this._fullScreenError, false);\n }\n }\n\n /**\n * TBD.\n * @returns {ParentNode | null} TBD.\n */\n get boundingParent() {\n if (this.parentIsWindow || (this.isFullScreen && this.hasPhaserSetFullScreen && !this._createdFullScreenTarget)) {\n return null;\n }\n const parentNode = this.game.canvas && this.game.canvas.parentNode;\n return parentNode || null;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get scaleMode() {\n return this._scaleMode;\n }\n\n /**\n * TBD.\n */\n set scaleMode(value) {\n if (value !== this._scaleMode) {\n if (!this.isFullScreen) {\n this.updateDimensions(this._gameSize.width, this._gameSize.height, true);\n this.queueUpdate(true);\n }\n this._scaleMode = value;\n }\n // return this._scaleMode;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get fullScreenScaleMode() {\n return this._fullScreenScaleMode;\n }\n\n /**\n * TBD.\n */\n set fullScreenScaleMode(value) {\n if (value !== this._fullScreenScaleMode) {\n // If in fullscreen then need a wee bit more work\n if (this.isFullScreen) {\n this.prepScreenMode(false);\n this._fullScreenScaleMode = value;\n this.prepScreenMode(true);\n this.queueUpdate(true);\n } else {\n this._fullScreenScaleMode = value;\n }\n }\n // return this._fullScreenScaleMode;\n }\n\n /**\n * TBD.\n * @returns {number} TBD.\n */\n get currentScaleMode() {\n return this.isFullScreen ? this._fullScreenScaleMode : this._scaleMode;\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n get pageAlignHorizontally() {\n return this._pageAlignHorizontally;\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n get pageAlignVertically() {\n return this._pageAlignVertically;\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n get isFullScreen() {\n return !!(\n document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullScreenElement ||\n document.msFullscreenElement\n );\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n get isPortrait() {\n return this.classifyOrientation(this.screenOrientation) === 'portrait';\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n get isLandscape() {\n return this.classifyOrientation(this.screenOrientation) === 'landscape';\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n get isGamePortrait() {\n return this.height > this.width;\n }\n\n /**\n * TBD.\n * @returns {boolean} TBD.\n */\n get isGameLandscape() {\n return this.width > this.height;\n }\n}\n","// @ts-nocheck\nexport class Scene {\n /**\n * Creates a new Scene instance.\n */\n constructor() {\n this.game = null;\n this.key = '';\n }\n\n /**\n * Initialize the scene.\n * This method is called before preload() and create().\n */\n init() {\n // inherit\n }\n\n /**\n * Load assets for the scene.\n * This method is called after init() and before create().\n */\n preload() {\n // inherit\n }\n\n /**\n * Create the scene.\n * This method is called after preload() and is where you create your game objects.\n */\n create() {\n // inherit\n }\n\n /**\n * Update the scene.\n * This method is called every frame while the scene is active.\n */\n update() {\n // inherit\n }\n\n /**\n * Handle scene resize.\n * @param {number} width - The new width of the scene.\n * @param {number} height - The new height of the scene.\n */\n resize(width, height) {\n // inherit\n }\n\n /**\n * Update the scene while paused.\n * This method is called every frame while the scene is paused.\n */\n pauseUpdate() {\n // inherit\n }\n\n /**\n * Shutdown the scene.\n * This method is called when the scene is about to be destroyed.\n */\n shutdown() {\n // inherit\n }\n}\n","// @ts-nocheck\nimport { Scene } from './scene.js';\n\nexport class SceneManager {\n /**\n * Creates a new SceneManager instance.\n * @param {import('./game.js').Game} game - The game instance this manager belongs to.\n * @param {string} pendingState - The state to load when the game boots.\n */\n constructor(game, pendingState) {\n this.game = game;\n this.states = {};\n this._pendingState = null;\n if (typeof pendingState !== 'undefined' && pendingState !== null) {\n this._pendingState = pendingState;\n }\n this._clearWorld = false;\n this._clearCache = false;\n this._created = false;\n this._args = [];\n this.current = '';\n this.onInitCallback = null;\n this.onPreloadCallback = null;\n this.onCreateCallback = null;\n this.onUpdateCallback = null;\n this.onResizeCallback = null;\n this.onPauseUpdateCallback = null;\n this.onShutDownCallback = null;\n }\n\n /**\n * Initialize the scene manager.\n * This method is called when the game boots and sets up the initial state.\n */\n boot() {\n if (this._pendingState !== null && typeof this._pendingState !== 'string') {\n this.add('default', this._pendingState, true);\n }\n }\n\n /**\n * Add a new scene state to the manager.\n * @param {string} key - The unique key for this state.\n * @param {object} state - The scene state to add.\n * @param {boolean} autoStart - Whether to start this state immediately.\n * @returns {Scene|object} The created scene or state object.\n */\n add(key, state, autoStart = false) {\n let newState = null;\n if (state instanceof Scene) {\n newState = state;\n } else if (typeof state === 'object') {\n newState = state;\n newState.game = this.game;\n } else if (typeof state === 'function') {\n newState = new state(this.game);\n }\n this.states[key] = newState;\n if (autoStart) {\n if (this.game.isBooted) {\n this.start(key);\n } else {\n this._pendingState = key;\n }\n }\n return newState;\n }\n\n /**\n * Remove a scene state from the manager.\n * @param {string} key - The unique key for the state to remove.\n */\n remove(key) {\n if (this.current === key) {\n this.callbackContext = null;\n this.onInitCallback = null;\n this.onShutDownCallback = null;\n this.onPreloadCallback = null;\n this.onCreateCallback = null;\n this.onUpdateCallback = null;\n this.onResizeCallback = null;\n this.onPauseUpdateCallback = null;\n }\n delete this.states[key];\n }\n\n /**\n * Start a scene state.\n * @param {string} key - The unique key for the state to start.\n * @param {boolean} clearWorld - Whether to clear the world before starting.\n * @param {boolean} clearCache - Whether to clear the cache before starting.\n * @param {...any} args - Additional arguments to pass to the state.\n */\n start(key, clearWorld = true, clearCache = false, ...args) {\n if (this.checkState(key)) {\n // Place the state in the queue. It will be started the next time the game loop begins.\n this._pendingState = key;\n this._clearWorld = clearWorld;\n this._clearCache = clearCache;\n if (args && args.length > 0) {\n this._args = args.slice();\n }\n }\n }\n\n /**\n * Restart the current scene state.\n * @param {boolean} clearWorld - Whether to clear the world before restarting.\n * @param {boolean} clearCache - Whether to clear the cache before restarting.\n * @param {...any} args - Additional arguments to pass to the state.\n */\n restart(clearWorld = true, clearCache = false, ...args) {\n this._pendingState = this.current;\n this._clearWorld = clearWorld;\n this._clearCache = clearCache;\n if (args && args.length > 0) {\n this._args = args.slice();\n }\n }\n\n /**\n * Pre-update the scene manager.\n * This method is called before the game loop updates.\n */\n preUpdate() {\n if (this._pendingState && this.game.isBooted) {\n // var previousStateKey = this.current;\n // Already got a state running?\n this.clearCurrentState();\n this.setCurrentState(this._pendingState);\n this.game.world.x = 0;\n this.game.world.y = 0;\n if (this.current !== this._pendingState) {\n return;\n }\n this._pendingState = null;\n // If StateManager.start has been called from the init of a State that ALSO has a preload, then\n // onPreloadCallback will be set, but must be ignored\n if (this.onPreloadCallback) {\n this.game.load.reset(true);\n this.onPreloadCallback.call(this.callbackContext, this.game);\n // Is the loader empty?\n if (this.game.load.totalQueuedFiles() === 0 && this.game.load.totalQueuedPacks() === 0) {\n this.loadComplete();\n } else {\n // Start the loader going as we have something in the queue\n this.game.load.start();\n }\n } else {\n // No init? Then there was nothing to load either\n this.loadComplete();\n }\n }\n }\n\n /**\n * Clear the current scene state.\n * This method is called when switching scenes to clean up the previous scene.\n */\n clearCurrentState() {\n if (this.current) {\n if (this.onShutDownCallback) {\n this.onShutDownCallback.call(this.callbackContext, this.game);\n }\n this.game.tweens.removeAll();\n this.game.input.reset(true);\n this.game.time.removeAll();\n this.game.scale.reset(this._clearWorld);\n if (this._clearWorld) {\n this.game.world.destroy(true, true);\n if (this._clearCache) {\n this.game.cache.destroy();\n }\n }\n }\n }\n\n /**\n * Check if a scene state exists.\n * @param {string} key - The unique key for the state to check.\n * @returns {boolean} True if the scene exists, false otherwise.\n */\n checkState(key) {\n if (this.states[key]) {\n if (this.states[key].preload || this.states[key].create || this.states[key].update || this.states[key].render) {\n return true;\n }\n return false;\n }\n return false;\n }\n\n /**\n * Link a scene state to the manager.\n * @param {string} key - The unique key for the state to link.\n */\n link(key) {\n this.states[key].game = this.game;\n this.states[key].key = key;\n }\n\n /**\n * Unlink a scene state from the manager.\n * @param {string} key - The unique key for the state to unlink.\n */\n unlink(key) {\n if (this.states[key]) {\n this.states[key].game = null;\n }\n }\n\n /**\n * Set the current scene state.\n * @param {string} key - The unique key for the state to set as current.\n */\n setCurrentState(key) {\n this.callbackContext = this.states[key];\n this.link(key);\n // Used when the state is set as being the current active state\n this.onInitCallback = this.callbackContext.init || this.dummy;\n this.onPreloadCallback = this.callbackContext.preload || null;\n this.onCreateCallback = this.callbackContext.create || null;\n this.onUpdateCallback = this.callbackContext.update || null;\n this.onResizeCallback = this.callbackContext.resize || null;\n this.onPauseUpdateCallback = this.callbackContext.pauseUpdate || null;\n this.onShutDownCallback = this.callbackContext.shutdown || this.dummy;\n this.current = key;\n this._created = false;\n this.onInitCallback.apply(this.callbackContext, this._args);\n if (key === this._pendingState) {\n this._args = [];\n }\n this.game.isKickStart = true;\n }\n\n /**\n * Get the current scene state.\n * @returns {Scene} The current scene state.\n */\n getCurrentState() {\n return this.states[this.current];\n }\n\n /**\n * Handle loading completion.\n * This method is called when scene loading is complete.\n */\n loadComplete() {\n if (this._created === false && this.onCreateCallback) {\n this._created = true;\n this.onCreateCallback.call(this.callbackContext, this.game);\n } else {\n this._created = true;\n }\n }\n\n /**\n * Update the scene manager.\n * This method is called every frame while the game is running.\n */\n update() {\n if (this._created && this.onUpdateCallback) {\n this.onUpdateCallback.call(this.callbackContext, this.game);\n }\n }\n\n /**\n * Pause the scene manager updates.\n * This method is called when the game is paused.\n */\n pauseUpdate() {\n if (this._created && this.onPauseUpdateCallback) {\n this.onPauseUpdateCallback.call(this.callbackContext, this.game);\n }\n }\n\n /**\n * Handle scene resize.\n * @param {number} width - The new width of the scene.\n * @param {number} height - The new height of the scene.\n */\n resize(width, height) {\n if (this.onResizeCallback) {\n this.onResizeCallback.call(this.callbackContext, width, height);\n }\n }\n\n /**\n * Destroy the scene manager.\n * This method is called when the scene manager is about to be destroyed.\n */\n destroy() {\n this._clearWorld = true;\n this._clearCache = true;\n this.clearCurrentState();\n this.callbackContext = null;\n this.onInitCallback = null;\n this.onShutDownCallback = null;\n this.onPreloadCallback = null;\n this.onCreateCallback = null;\n this.onUpdateCallback = null;\n this.onPauseUpdateCallback = null;\n this.game = null;\n this.states = {};\n this._pendingState = null;\n this.current = '';\n }\n\n /**\n * Dummy function for callbacks.\n * This is a placeholder function used when no callback is defined.\n */\n dummy() {\n // pass\n }\n\n /**\n * Get whether the scene has been created.\n * @returns {boolean} True if the scene has been created, false otherwise.\n */\n get created() {\n return this._created;\n }\n}\n","// @ts-nocheck\nimport { Signal } from './signal.js';\n\nexport class Sound {\n /**\n * Creates a new Sound instance.\n * @param {import('./game.js').Game} game - Reference to the Phaser Game instance.\n * @param {string} key - The key of the sound to play.\n * @param {number} volume - The initial volume level (0.0 to 1.0).\n * @param {boolean} loop - Whether the sound should loop.\n * @param {boolean} connect - Whether to connect to the master gain node.\n */\n constructor(game, key, volume = 1, loop = false, connect = null) {\n // TODO\n // https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Migrating_from_webkitAudioContext\n if (!connect) {\n connect = game.sound.connectToMaster;\n }\n this.game = game;\n this.name = key;\n this.key = key;\n this.loop = loop;\n this.markers = {};\n this.context = null;\n this.autoplay = false;\n this.totalDuration = 0;\n this.startTime = 0;\n this.currentTime = 0;\n this.duration = 0;\n this.durationMS = 0;\n this.position = 0;\n this.stopTime = 0;\n this.paused = false;\n this.pausedPosition = 0;\n this.pausedTime = 0;\n this.isPlaying = false;\n this.currentMarker = '';\n this.fadeTween = null;\n this.pendingPlayback = false;\n this.override = false;\n this.allowMultiple = false;\n /** @type {GainNode} */\n this.externalNode = null;\n /** @type {GainNode} */\n this.masterGainNode = null;\n /** @type {GainNode} */\n this.gainNode = null;\n /** @type {AudioBufferSourceNode} */\n this._sound = null;\n this._markedToDelete = false;\n this._removeFromSoundManager = false;\n this.context = this.game.sound.context;\n this.masterGainNode = this.game.sound.masterGain;\n if (this.context.createGain === undefined) {\n this.gainNode = this.context.createGainNode();\n } else {\n this.gainNode = this.context.createGain();\n }\n this.gainNode.gain.value = volume * this.game.sound.volume;\n if (connect) {\n this.gainNode.connect(this.masterGainNode);\n }\n this.onPlay = new Signal();\n this.onPause = new Signal();\n this.onResume = new Signal();\n this.onLoop = new Signal();\n this.onStop = new Signal();\n this.onMute = new Signal();\n this.onMarkerComplete = new Signal();\n this.onFadeComplete = new Signal();\n this._volume = volume;\n /** @type {AudioBuffer} */\n this._buffer = null;\n this._muted = false;\n this._tempMarker = '';\n this._tempPosition = 0;\n this._tempVolume = 0;\n this._tempPause = 0;\n this._muteVolume = 0;\n this._tempLoop = false;\n this._paused = false;\n }\n\n /**\n * Callback when a sound has been unlocked.\n * @param {string} key - The key of the sound that was unlocked.\n */\n soundHasUnlocked(key) {\n if (key === this.key) {\n this._sound = this.game.cache.getSoundData(this.key);\n this.totalDuration = this._sound.duration;\n }\n }\n\n /**\n * Adds a marker to the sound.\n * @param {string} name - The name of the marker.\n * @param {number} start - The start time (in seconds) of the marker.\n * @param {number} duration - The duration (in seconds) of the marker.\n * @param {number} volume - The volume level (0.0 to 1.0) of the marker.\n * @param {boolean} loop - Whether the marker should loop.\n */\n addMarker(name, start, duration = 1, volume = 1, loop = false) {\n this.markers[name] = {\n name,\n start,\n stop: start + duration,\n volume,\n duration,\n durationMS: duration * 1000,\n loop,\n };\n }\n\n /**\n * Removes a marker from the sound.\n * @param {string} name - The name of the marker to remove.\n */\n removeMarker(name) {\n delete this.markers[name];\n }\n\n /**\n * Handler for when the sound ends.\n */\n onEndedHandler() {\n this._sound.onended = null;\n this.isPlaying = false;\n this.currentTime = this.durationMS;\n this.stop();\n if (!this._markedToDelete) {\n return;\n }\n if (this.externalNode) {\n this._sound.disconnect(this.externalNode);\n } else if (this.gainNode) {\n this._sound.disconnect(this.gainNode);\n }\n if (this._removeFromSoundManager) {\n this.game.sound.remove(this);\n } else {\n this.markers = {};\n this.context = null;\n this._buffer = null;\n this.externalNode = null;\n this.onPlay.dispose();\n this.onPause.dispose();\n this.onResume.dispose();\n this.onLoop.dispose();\n this.onStop.dispose();\n this.onMute.dispose();\n this.onMarkerComplete.dispose();\n this.onFadeComplete.dispose();\n }\n }\n\n /**\n * Updates the sound state.\n */\n update() {\n if (!this.game.cache.checkSoundKey(this.key)) {\n this.destroy();\n return;\n }\n if (this.pendingPlayback && this.game.cache.isSoundReady(this.key)) {\n this.pendingPlayback = false;\n this.play(this._tempMarker, this._tempPosition, this._tempVolume, this._tempLoop);\n }\n if (!this.isPlaying) {\n return;\n }\n this.currentTime = this.game.time.time - this.startTime;\n if (this.currentTime >= this.durationMS) {\n if (this.loop) {\n // won't work with markers, needs to reset the position\n this.onLoop.dispatch(this);\n // Gets reset by the play function\n this.isPlaying = false;\n if (this.currentMarker === '') {\n this.currentTime = 0;\n this.startTime = this.game.time.time;\n this.isPlaying = true; // play not called again in this case\n } else {\n this.onMarkerComplete.dispatch(this.currentMarker, this);\n this.play(this.currentMarker, 0, this.volume, true, true);\n }\n } else if (this.currentMarker !== '') {\n // Stop if we're using an audio marker, otherwise we let onended handle it\n this.stop();\n }\n }\n }\n\n /**\n * Plays the sound at full volume in a loop.\n * @param {number} volume - The volume level (0.0 to 1.0) to play at.\n * @returns {Sound} This Sound instance for chaining.\n */\n loopFull(volume) {\n return this.play(null, 0, volume, true);\n }\n\n /**\n * Plays the sound, optionally using a marker.\n * @param {string} marker - The name of the marker to play, or null/undefined to play the entire sound.\n * @param {number} position - The position (in seconds) to start playing from.\n * @param {number} volume - The volume level (0.0 to 1.0) to play at.\n * @param {boolean} loop - Whether the sound should loop.\n * @param {boolean} forceRestart - Whether to force restarting the sound even if it's already playing.\n * @returns {Sound} This Sound instance for chaining.\n */\n play(marker, position, volume, loop, forceRestart = true) {\n if (marker === undefined || marker === false || marker === null) {\n marker = '';\n }\n if (forceRestart === undefined) {\n forceRestart = true;\n }\n\n if (this.isPlaying && !this.allowMultiple && !forceRestart && !this.override) {\n // Use Restart instead\n return this;\n }\n if (this._sound && this.isPlaying && !this.allowMultiple && (this.override || forceRestart)) {\n if (this._sound.stop === undefined) {\n this._sound.noteOff(0);\n } else {\n this._sound.stop(0);\n }\n if (this.externalNode) {\n this._sound.disconnect(this.externalNode);\n } else if (this.gainNode) {\n this._sound.disconnect(this.gainNode);\n }\n this.isPlaying = false;\n }\n if (marker === '' && Object.keys(this.markers).length > 0) {\n // If they didn't specify a marker but this is an audio sprite,\n // we should never play the entire thing\n return this;\n }\n if (marker !== '') {\n if (this.markers[marker]) {\n this.currentMarker = marker;\n // Playing a marker? Then we default to the marker values\n this.position = this.markers[marker].start;\n this.volume = this.markers[marker].volume;\n this.loop = this.markers[marker].loop;\n this.duration = this.markers[marker].duration;\n this.durationMS = this.markers[marker].durationMS;\n if (typeof volume !== 'undefined') {\n this.volume = volume;\n }\n if (typeof loop !== 'undefined') {\n this.loop = loop;\n }\n this._tempMarker = marker;\n this._tempPosition = this.position;\n this._tempVolume = this.volume;\n this._tempLoop = this.loop;\n } else {\n this.game.logger.warn(`Sound.play: audio marker ${marker} does not exist`);\n return this;\n }\n } else {\n position = position || 0;\n if (volume === undefined) {\n volume = this._volume;\n }\n if (loop === undefined) {\n loop = this.loop;\n }\n this.position = Math.max(0, position);\n this.volume = volume;\n this.loop = loop;\n this.duration = 0;\n this.durationMS = 0;\n this._tempMarker = marker;\n this._tempPosition = position;\n this._tempVolume = volume;\n this._tempLoop = loop;\n }\n // Does the sound need decoding?\n if (this.game.cache.isSoundDecoded(this.key)) {\n this._sound = this.context.createBufferSource();\n if (this.externalNode) {\n this._sound.connect(this.externalNode);\n } else {\n this._sound.connect(this.gainNode);\n }\n this._buffer = this.game.cache.getSoundData(this.key);\n this._sound.buffer = this._buffer;\n if (this.loop && marker === '') {\n this._sound.loop = true;\n }\n if (!this.loop && marker === '') {\n this._sound.onended = this.onEndedHandler.bind(this);\n }\n this.totalDuration = this._sound.buffer.duration;\n if (this.duration === 0) {\n this.duration = this.totalDuration;\n this.durationMS = Math.ceil(this.totalDuration * 1000);\n }\n // Useful to cache this somewhere perhaps?\n if (this._sound.start === undefined) {\n this._sound.noteGrainOn(0, this.position, this.duration);\n } else if (this.loop && marker === '') {\n this._sound.start(0, 0);\n } else {\n this._sound.start(0, this.position, this.duration);\n }\n this.isPlaying = true;\n this.startTime = this.game.time.time;\n this.currentTime = 0;\n this.stopTime = this.startTime + this.durationMS;\n this.onPlay.dispatch(this);\n } else {\n this.pendingPlayback = true;\n if (this.game.cache.getSound(this.key) && this.game.cache.getSound(this.key).isDecoding === false) {\n this.game.sound.decode(this.key);\n }\n }\n return this;\n }\n\n /**\n * Restarts the sound, optionally using a marker.\n * @param {string} marker - The name of the marker to play, or empty string to play the entire sound.\n * @param {number} position - The position (in seconds) to start playing from.\n * @param {number} volume - The volume level (0.0 to 1.0) to play at.\n * @param {boolean} loop - Whether the sound should loop.\n */\n restart(marker = '', position = 0, volume = 1, loop = false) {\n this.play(marker, position, volume, loop, true);\n }\n\n /**\n * Pauses the sound.\n */\n pause() {\n if (this.isPlaying && this._sound) {\n this.paused = true;\n this.pausedPosition = this.currentTime;\n this.pausedTime = this.game.time.time;\n this._tempPause = this._sound.currentTime;\n this.onPause.dispatch(this);\n this.stop();\n }\n }\n\n /**\n * Resumes the sound.\n */\n resume() {\n if (this.paused && this._sound) {\n const p = Math.max(0, this.position + this.pausedPosition / 1000);\n this._sound = this.context.createBufferSource();\n this._sound.buffer = this._buffer;\n if (this.externalNode) {\n this._sound.connect(this.externalNode);\n } else {\n this._sound.connect(this.gainNode);\n }\n if (this.loop) {\n this._sound.loop = true;\n }\n if (!this.loop && this.currentMarker === '') {\n this._sound.onended = this.onEndedHandler.bind(this);\n }\n const duration = this.duration - this.pausedPosition / 1000;\n if (this._sound.start === undefined) {\n this._sound.noteGrainOn(0, p, duration);\n } else {\n this._sound.start(0, p, duration);\n }\n this.isPlaying = true;\n this.paused = false;\n this.startTime += this.game.time.time - this.pausedTime;\n this.onResume.dispatch(this);\n }\n }\n\n /**\n * Stops the sound.\n */\n stop() {\n if (this.isPlaying && this._sound) {\n if (this._sound.stop === undefined) {\n this._sound.noteOff(0);\n } else {\n this._sound.stop(0);\n }\n if (this.externalNode) {\n this._sound.disconnect(this.externalNode);\n } else if (this.gainNode) {\n this._sound.disconnect(this.gainNode);\n }\n }\n this.pendingPlayback = false;\n this.isPlaying = false;\n if (!this.paused) {\n const prevMarker = this.currentMarker;\n if (this.currentMarker !== '') {\n this.onMarkerComplete.dispatch(this.currentMarker, this);\n }\n this.currentMarker = '';\n if (this.fadeTween !== null) {\n this.fadeTween.stop();\n }\n this.onStop.dispatch(this, prevMarker);\n }\n }\n\n /**\n * Fades in the sound to full volume.\n * @param {number} duration - The fade-in duration (in milliseconds).\n * @param {boolean} loop - Whether the sound should loop.\n * @param {string} marker - The name of the marker to fade in, or empty string to use current marker.\n */\n fadeIn(duration, loop = false, marker = this.currentMarker) {\n if (this.paused) {\n return;\n }\n this.play(marker, 0, 0, loop);\n this.fadeTo(duration, 1);\n }\n\n /**\n * Fades out the sound to silence.\n * @param {number} duration - The fade-out duration (in milliseconds).\n */\n fadeOut(duration) {\n this.fadeTo(duration, 0);\n }\n\n /**\n * Fades the sound to a specific volume level.\n * @param {number} duration - The fade duration (in milliseconds).\n * @param {number} volume - The target volume level (0.0 to 1.0).\n */\n fadeTo(duration = 100, volume = 0) {\n if (!this.isPlaying || this.paused || volume === this.volume) {\n return;\n }\n this.fadeTween = this.game.tweens.create(this).to({ volume }, duration, 'Linear', true);\n this.fadeTween.onComplete.addOnce(this.fadeComplete, this);\n }\n\n /**\n * Callback when fade completes.\n */\n fadeComplete() {\n this.onFadeComplete.dispatch(this, this.volume);\n if (this.volume === 0) {\n this.stop();\n }\n }\n\n /**\n * Destroys the sound and cleans up resources.\n * @param {boolean} remove - Whether to remove the sound from the SoundManager.\n */\n destroy(remove = true) {\n this._markedToDelete = true;\n this._removeFromSoundManager = remove;\n this.stop();\n if (remove) {\n this.game.sound.remove(this);\n } else {\n this.markers = {};\n this.context = null;\n this._buffer = null;\n this.externalNode = null;\n this.onPlay.dispose();\n this.onPause.dispose();\n this.onResume.dispose();\n this.onLoop.dispose();\n this.onStop.dispose();\n this.onMute.dispose();\n this.onMarkerComplete.dispose();\n this.onFadeComplete.dispose();\n }\n }\n\n /**\n * Gets the muted state of the sound.\n * @returns {boolean} True if the sound is muted, false otherwise.\n */\n get mute() {\n return this._muted || this.game.sound.mute;\n }\n\n /**\n * Sets the muted state of the sound.\n */\n set mute(value) {\n value = value || false;\n if (value === this._muted) {\n return;\n }\n if (value) {\n this._muted = true;\n this._muteVolume = this._tempVolume;\n this.gainNode.gain.value = 0;\n } else {\n this._muted = false;\n this.gainNode.gain.value = this._muteVolume;\n }\n this.onMute.dispatch(this);\n }\n\n /**\n * Gets the volume of the sound.\n * @returns {number} The volume level (0.0 to 1.0).\n */\n get volume() {\n return this._volume;\n }\n\n /**\n * Sets the volume of the sound.\n */\n set volume(value) {\n if (this._muted) {\n this._muteVolume = value;\n return;\n }\n this._tempVolume = value;\n this._volume = value;\n this.gainNode.gain.value = value;\n }\n}","// @ts-nocheck\nexport class SoundSprite {\n /**\n * TBD.\n * @param {import('./game.js').Game} game - TBD.\n * @param {string} key - TBD.\n */\n constructor(game, key) {\n this.game = game;\n this.key = key;\n this.config = this.game.cache.getJSON(`${key}-audioatlas`);\n this.autoplayKey = null;\n this.autoplay = false;\n /** @type {{[key: string]: import('./sound.js').Sound}} */\n this.sounds = {};\n for (let k in this.config.spritemap) {\n const marker = this.config.spritemap[k];\n const sound = this.game.sound.add(this.key);\n sound.addMarker(k, marker.start, marker.end - marker.start, null, marker.loop);\n this.sounds[k] = sound;\n }\n if (this.config.autoplay) {\n this.autoplayKey = this.config.autoplay;\n this.play(this.autoplayKey);\n this.autoplay = this.sounds[this.autoplayKey];\n }\n }\n\n /**\n * TBD.\n * @param {string} marker - TBD.\n * @param {number} volume - TBD.\n * @returns {import('./sound.js').Sound} TBD.\n */\n play(marker, volume = 1) {\n return this.sounds[marker].play(marker, null, volume);\n }\n\n /**\n * TBD.\n * @param {string} marker - TBD.\n */\n stop(marker) {\n if (!marker) {\n for (let key in this.sounds) {\n this.sounds[key].stop();\n }\n } else {\n this.sounds[marker].stop();\n }\n }\n\n /**\n * TBD.\n * @param {string} marker - TBD.\n * @returns {import('./sound.js').Sound} TBD.\n */\n get(marker) {\n return this.sounds[marker];\n }\n}","// @ts-nocheck\nimport {\n addPageLifecycleCallback,\n getPageLifecycleEventEmitter,\n PAGE_LIFECYCLE_STATE_ACTIVE,\n PAGE_LIFECYCLE_STATE_CHANGE_EVENT,\n} from '@vpmedia/simplify';\nimport { ArraySet } from './array_set.js';\nimport { AUDIO_DISABLED, AUDIO_STANDARD, AUDIO_WEBKIT } from './const.js';\nimport { ENGINE_ERROR_CREATING_AUDIO_CONTEXT } from './error_code.js';\nimport { Signal } from './signal.js';\nimport { Sound } from './sound.js';\nimport { SoundSprite } from './sound_sprite.js';\n\nexport class SoundManager {\n /**\n * Creates a new SoundManager instance.\n * @param {import('./game.js').Game} game - Reference to the Phaser Game instance.\n */\n constructor(game) {\n this.game = game;\n this.onChange = new Signal();\n /** @type {AudioContext} */\n this.context = null;\n this.baseLatency = 0; // https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/baseLatency\n this.noAudio = false;\n this.type = AUDIO_DISABLED;\n this.connectToMaster = true;\n this.isLocked = false;\n // this.muteOnPause = true;\n this._codeMuted = false;\n this._muted = false;\n this._unlockSource = null;\n this._volume = 1;\n /** @type {Sound[]} */\n this._sounds = [];\n this._watchList = new ArraySet();\n this._watching = false;\n this._watchCallback = null;\n this._watchContext = null;\n }\n\n /**\n * Initializes the sound manager and sets up audio context.\n */\n boot() {\n const setAudioDisabledState = () => {\n this.type = AUDIO_DISABLED;\n this.noAudio = true;\n this.isLocked = false;\n };\n if (this.game.config.isForceDisabledAudio) {\n setAudioDisabledState();\n return;\n }\n if (window.AudioContext) {\n try {\n this.game.logger.info('initAudioContext');\n this.context = new window.AudioContext();\n this.type = AUDIO_STANDARD;\n } catch (error) {\n this.context = null;\n setAudioDisabledState();\n const typedError = error instanceof Error ? error : new Error(String(error));\n this.game.logger.exception('SoundManager', typedError);\n }\n } else if (window.webkitAudioContext) {\n try {\n this.game.logger.info('initWebkitAudioContext');\n this.context = new window.webkitAudioContext();\n this.type = AUDIO_WEBKIT;\n } catch (error) {\n this.context = null;\n setAudioDisabledState();\n const typedError = error instanceof Error ? error : new Error(String(error));\n this.game.logger.exception('SoundManager', typedError);\n }\n }\n if (!this.context) {\n this.game.logger.exception('SoundManager', new Error(ENGINE_ERROR_CREATING_AUDIO_CONTEXT));\n setAudioDisabledState();\n return;\n }\n this.baseLatency = this.context.baseLatency || 256 / (this.context.sampleRate || 44100);\n if (this.context.createGain === undefined) {\n this.masterGain = this.context.createGainNode();\n } else {\n this.masterGain = this.context.createGain();\n }\n this.masterGain.gain.value = 1;\n this.masterGain.connect(this.context.destination);\n // handle audio state unlock\n // possible states: interrupted, suspended, running, closed\n if (this.context.state === 'suspended' || this.context.state === 'interrupted') {\n this.addUnlockHandlers();\n }\n this.context.addEventListener('statechange', this.onContextStateChange, false);\n getPageLifecycleEventEmitter().on(PAGE_LIFECYCLE_STATE_CHANGE_EVENT, this.onPageLifecycleChange);\n }\n\n /**\n * Handles page lifecycle changes for audio management.\n */\n onPageLifecycleChange = () => {\n if (!document.hidden) {\n this.checkUnlockHandlers();\n }\n };\n\n /**\n * Handles audio context state changes.\n */\n onContextStateChange = () => {\n this.game.logger.info('onContextStateChange', {\n state: this.context.state,\n isLocked: this.isLocked,\n });\n this.checkUnlockHandlers();\n };\n\n /**\n * Checks if audio unlock handlers need to be added or removed.\n */\n checkUnlockHandlers = () => {\n this.game.logger.info('checkUnlockHandlers', {\n state: this.context.state,\n isLocked: this.isLocked,\n });\n if (!this.isLocked && (this.context.state === 'suspended' || this.context.state === 'interrupted')) {\n this.addUnlockHandlers();\n } else if (this.isLocked && this.context.state === 'running') {\n this.removeUnlockHandlers();\n }\n };\n\n /**\n * Adds event listeners to unlock audio context.\n */\n addUnlockHandlers = () => {\n this.isLocked = true;\n this.game.logger.info('addUnlockHandlers', {\n state: this.context.state,\n isLocked: this.isLocked,\n });\n for (const eventType of ['touchend', 'click', 'keydown']) {\n document.body.addEventListener(eventType, this.onUnlockEvent, false);\n }\n };\n\n /**\n * Removes event listeners that unlock audio context.\n */\n removeUnlockHandlers = () => {\n this.isLocked = false;\n this.game.logger.info('removeUnlockHandlers', {\n state: this.context.state,\n isLocked: this.isLocked,\n });\n for (const eventType of ['touchend', 'click', 'keydown']) {\n document.body.removeEventListener(eventType, this.onUnlockEvent, false);\n }\n };\n\n /**\n * Handles unlock events to resume audio context.\n * @param {Event} event - The DOM event that triggered the unlock.\n */\n onUnlockEvent = (event) => {\n const initialState = this.context.state;\n if (initialState !== 'suspended' && initialState !== 'interrupted') {\n this.game.logger.info('onUnlockResumeDenied', {\n state: initialState,\n isLocked: this.isLocked,\n event,\n });\n this.removeUnlockHandlers();\n return;\n }\n this.game.logger.info('onContextResumeStart', {\n state: initialState,\n isLocked: this.isLocked,\n event,\n });\n this.context\n .resume()\n .then(() => {\n this.game.logger.info('onContextResumeResult', {\n initialState,\n state: this.context.state,\n isLocked: this.isLocked,\n });\n this.removeUnlockHandlers();\n })\n .catch((error) => {\n this.game.logger.info('onContextResumeReject', {\n initialState,\n state: this.context.state,\n isLocked: this.isLocked,\n error,\n });\n this.removeUnlockHandlers();\n this.game.logger.exception('', error, {\n tags: { 'audio.initialState': initialState, 'audio.state': this.context.state },\n });\n });\n };\n\n /**\n * Stops all sounds in the manager.\n */\n stopAll() {\n if (this.noAudio) {\n return;\n }\n for (let i = 0; i < this._sounds.length; i += 1) {\n if (this._sounds[i]) {\n this._sounds[i].stop();\n }\n }\n }\n\n /**\n * Pauses all sounds in the manager.\n */\n pauseAll() {\n if (this.noAudio) {\n return;\n }\n for (let i = 0; i < this._sounds.length; i += 1) {\n if (this._sounds[i]) {\n this._sounds[i].pause();\n }\n }\n }\n\n /**\n * Resumes all sounds in the manager.\n */\n resumeAll() {\n if (this.noAudio) {\n return;\n }\n for (let i = 0; i < this._sounds.length; i += 1) {\n if (this._sounds[i]) {\n this._sounds[i].resume();\n }\n }\n }\n\n /**\n * Decodes an audio file for playback.\n * @param {string} key - The key of the sound to decode.\n */\n decode(key) {\n const soundData = this.game.cache.getSoundData(key);\n if (!soundData) {\n return;\n }\n if (this.game.cache.isSoundDecoded(key) === true) {\n return;\n }\n this.game.cache.updateSound(key, 'isDecoding', true);\n this.context\n .decodeAudioData(soundData)\n .then((buffer) => {\n this.game.cache.decodedSound(key, buffer);\n })\n .catch((error) => {\n const typedError = error instanceof Error ? error : new Error(String(error));\n this.game.logger.exception('SoundManager', typedError, { tags: { 'asset.key': key } });\n if (typedError.name === 'InvalidStateError') {\n addPageLifecycleCallback(PAGE_LIFECYCLE_STATE_ACTIVE, () => {\n this.decode(key);\n });\n } else if (typedError.name === 'EncodingError') {\n this._watchList.remove(key);\n }\n });\n }\n\n /**\n * Sets up a callback to be called when audio files are decoded.\n * @param {Sound[]|string[]} files - The sound files or keys to wait for.\n * @param {Function} callback - The callback function to call when all files are decoded.\n * @param {object} callbackContext - The context in which to call the callback.\n */\n setDecodedCallback(files, callback, callbackContext) {\n if (typeof files === 'string') {\n files = [files];\n }\n this._watchList.reset();\n for (let i = 0; i < files.length; i += 1) {\n if (files[i] instanceof Sound) {\n if (!this.game.cache.isSoundDecoded(files[i].key)) {\n this._watchList.add(files[i].key);\n }\n } else if (!this.game.cache.isSoundDecoded(files[i])) {\n this._watchList.add(files[i]);\n }\n }\n // All decoded already?\n if (this._watchList.total === 0) {\n this._watching = false;\n callback.call(callbackContext);\n } else {\n this._watching = true;\n this._watchCallback = callback;\n this._watchContext = callbackContext;\n }\n }\n\n /**\n * Updates the sound manager state.\n */\n update() {\n if (this.noAudio) {\n return;\n }\n for (let i = 0; i < this._sounds.length; i += 1) {\n this._sounds[i].update();\n }\n if (this._watching) {\n let key = this._watchList.first;\n while (key) {\n if (this.game.cache.isSoundDecoded(key)) {\n this._watchList.remove(key);\n }\n key = this._watchList.next;\n }\n if (this._watchList.total === 0) {\n this.game.logger.info('All sounds decoded');\n this._watching = false;\n this._watchCallback.call(this._watchContext);\n }\n }\n }\n\n /**\n * Adds a new sound to the manager.\n * @param {string} key - The key of the sound to add.\n * @param {number} volume - The initial volume level (0.0 to 1.0).\n * @param {boolean} loop - Whether the sound should loop.\n * @param {boolean} connect - Whether to connect to the master gain node.\n * @returns {Sound} The created Sound object.\n */\n add(key, volume = 1, loop = false, connect = this.connectToMaster) {\n const sound = new Sound(this.game, key, volume, loop, connect);\n this._sounds.push(sound);\n return sound;\n }\n\n /**\n * Adds a new sound sprite to the manager.\n * @param {string} key - The key of the sound sprite to add.\n * @returns {SoundSprite} The created SoundSprite object.\n */\n addSprite(key) {\n return new SoundSprite(this.game, key);\n }\n\n /**\n * Removes a sound from the manager.\n * @param {Sound | null | undefined} sound - The sound object to remove.\n * @returns {boolean} True if the sound was removed, false otherwise.\n */\n remove(sound) {\n let i = this._sounds.length;\n while (i) {\n i -= 1;\n if (this._sounds[i] === sound) {\n this._sounds[i].destroy(false);\n this._sounds.splice(i, 1);\n return true;\n }\n }\n return false;\n }\n\n /**\n * Removes all sounds with a specific key from the manager.\n * @param {string} key - The key of sounds to remove.\n * @returns {number} The number of sounds removed.\n */\n removeByKey(key) {\n let i = this._sounds.length;\n let removed = 0;\n while (i) {\n i -= 1;\n if (this._sounds[i].key === key) {\n this._sounds[i].destroy(false);\n this._sounds.splice(i, 1);\n removed += 1;\n }\n }\n return removed;\n }\n\n /**\n * Plays a sound by key.\n * @param {string} key - The key of the sound to play.\n * @param {number} volume - The volume level (0.0 to 1.0).\n * @param {boolean} loop - Whether the sound should loop.\n * @returns {Sound} The created Sound object, or null if audio is disabled.\n */\n play(key, volume = 1, loop = false) {\n if (this.noAudio) {\n return null;\n }\n const sound = this.add(key, volume, loop);\n sound.play();\n return sound;\n }\n\n /**\n * Mutes all sounds in the manager.\n */\n setMute() {\n if (this._muted) {\n return;\n }\n this._muted = true;\n if (!this.noAudio) {\n this._muteVolume = this.masterGain.gain.value;\n this.masterGain.gain.value = 0;\n }\n this.onChange.dispatch('muted');\n }\n\n /**\n * Unmutes all sounds in the manager.\n */\n unsetMute() {\n if (!this._muted || this._codeMuted) {\n return;\n }\n this._muted = false;\n if (!this.noAudio) {\n this.masterGain.gain.value = this._muteVolume;\n }\n this.onChange.dispatch('unmuted');\n }\n\n /**\n * Destroys the sound manager and cleans up resources.\n */\n destroy() {\n this.stopAll();\n for (let i = 0; i < this._sounds.length; i += 1) {\n if (this._sounds[i]) {\n this._sounds[i].destroy();\n }\n }\n this._sounds = [];\n this.onChange.dispose();\n if (this.context?.close) {\n this.context.close();\n }\n }\n\n /**\n * Gets the muted state of the sound manager.\n * @returns {boolean} True if the manager is muted, false otherwise.\n */\n get mute() {\n return this._muted;\n }\n\n /**\n * Sets the muted state of the sound manager.\n */\n set mute(value) {\n if (value || false) {\n if (this._muted) {\n return;\n }\n this._codeMuted = true;\n this.setMute();\n } else {\n if (!this._muted) {\n return;\n }\n this._codeMuted = false;\n this.unsetMute();\n }\n }\n\n /**\n * Gets the volume level of the sound manager.\n * @returns {number} The volume level (0.0 to 1.0).\n */\n get volume() {\n return this._volume;\n }\n\n /**\n * Sets the volume level of the sound manager.\n */\n set volume(value) {\n if (value < 0) {\n value = 0;\n } else if (value > 1) {\n value = 1;\n }\n if (this._volume !== value) {\n this._volume = value;\n if (!this.noAudio) {\n this.masterGain.gain.value = value;\n }\n }\n }\n}","// @ts-nocheck\nimport { setTouchAction, setUserSelect } from '../display/canvas/util.js';\nimport { DisplayObject } from '../display/display_object.js';\nimport { Matrix } from '../geom/matrix.js';\nimport { valueToColor } from '../util/math.js';\nimport { SCALE_LINEAR, SCALE_NEAREST } from './const.js';\n\nexport class Stage extends DisplayObject {\n /**\n * Creates a new Stage instance.\n * @param {import('./game.js').Game} game - The game instance.\n */\n constructor(game) {\n super(game);\n this.name = '_stage_root';\n this.worldTransform = new Matrix();\n this.currentRenderOrderID = 0;\n this._bgColor = {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n color: 0,\n rgba: '#000000',\n };\n if (!game.config.transparent) {\n // transparent = 0,0,0,0 - otherwise r,g,b,1\n this._bgColor.a = 1;\n }\n if (game.config.backgroundColor && !this.game.config.transparent) {\n this.setBackgroundColor(game.config.backgroundColor);\n }\n }\n\n /**\n * Sets the background color of the stage.\n * @param {number} color - The color to set as the background.\n */\n setBackgroundColor(color) {\n if (this.game.config.transparent) {\n return;\n }\n valueToColor(color, this._bgColor);\n // For gl.clearColor (canvas uses _bgColor.rgba)\n this._bgColor.r /= 255;\n this._bgColor.g /= 255;\n this._bgColor.b /= 255;\n this._bgColor.a = 1;\n }\n\n /**\n * Initializes the stage after game creation.\n */\n boot() {\n setUserSelect(this.game.canvas, 'none');\n setTouchAction(this.game.canvas, 'none');\n }\n\n /**\n * Pre-updates the stage and its children.\n */\n preUpdate() {\n this.currentRenderOrderID = 0;\n // This can't loop in reverse, we need the renderOrderID to be in sequence\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].preUpdate();\n }\n }\n\n /**\n * Updates the stage and its children.\n */\n update() {\n let i = this.children.length;\n while (i) {\n i -= 1;\n this.children[i].update();\n }\n }\n\n /**\n * Post-updates the stage and its children.\n */\n postUpdate() {\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].postUpdate();\n }\n this.updateTransform();\n }\n\n /**\n * Updates the stage's transformation matrix.\n */\n updateTransform() {\n this.worldAlpha = 1;\n for (let i = 0; i < this.children.length; i += 1) {\n this.children[i].updateTransform();\n }\n }\n\n /**\n * Destroys the stage and cleans up resources.\n */\n destroy() {\n this.exists = false;\n this.game = null;\n this.worldTransform = null;\n this._bgColor = null;\n }\n\n /**\n * Gets the background color of the stage.\n * @returns {number} The background color.\n */\n get backgroundColor() {\n return this._bgColor.color;\n }\n\n /**\n * Sets the background color of the stage.\n */\n set backgroundColor(value) {\n this.setBackgroundColor(value);\n }\n\n /**\n * Gets whether texture smoothing is enabled.\n * @returns {boolean} True if texture smoothing is enabled, false otherwise.\n */\n get smoothed() {\n return window.PhaserRegistry.TEXTURE_SCALE_MODE === SCALE_LINEAR;\n }\n\n /**\n * Sets whether texture smoothing is enabled.\n */\n set smoothed(value) {\n window.PhaserRegistry.TEXTURE_SCALE_MODE = value ? SCALE_LINEAR : SCALE_NEAREST;\n }\n}\n","// @ts-nocheck\nexport class TimerEvent {\n /**\n * Creates a new TimerEvent instance.\n * @param {import('./timer.js').Timer} timer - Reference to the parent Timer.\n * @param {number} delay - The delay (in milliseconds) before the event should occur.\n * @param {number} tick - The tick (in milliseconds) at which the event should occur.\n * @param {number} repeatCount - The number of times the event should repeat.\n * @param {boolean} loop - Whether the event should loop.\n * @param {Function} callback - The function to call when the event occurs.\n * @param {object} callbackContext - The context in which to call the callback function.\n * @param {...any} args - Arguments to pass to the callback function.\n */\n constructor(timer, delay, tick, repeatCount, loop, callback, callbackContext, args) {\n this.timer = timer;\n this.delay = delay;\n this.tick = tick;\n this.repeatCount = repeatCount - 1;\n this.loop = loop;\n this.callback = callback;\n this.callbackContext = callbackContext;\n this.args = args;\n this.pendingDelete = false;\n }\n}","// @ts-nocheck\nimport { Signal } from './signal.js';\nimport { TimerEvent } from './timer_event.js';\n\nexport class Timer {\n /**\n * Creates a new Timer instance.\n * @param {import('./game.js').Game} game - The game instance.\n * @param {boolean} autoDestroy - Whether to automatically destroy the timer when it completes.\n */\n constructor(game, autoDestroy = false) {\n this.game = game;\n /** @type {boolean} */\n this.running = false;\n /** @type {boolean} */\n this.autoDestroy = autoDestroy;\n /** @type {boolean} */\n this.expired = false;\n /** @type {number} */\n this.elapsed = 0;\n /** @type {TimerEvent[]} */\n this.events = [];\n /** @type {Signal} */\n this.onComplete = new Signal();\n /** @type {number} */\n this.nextTick = 0;\n /** @type {number} */\n this.timeCap = 1000;\n /** @type {boolean} */\n this.paused = false;\n /** @type {boolean} */\n this._codePaused = false;\n /** @type {number} */\n this._started = 0;\n /** @type {number} */\n this._pauseStarted = 0;\n /** @type {number} */\n this._pauseTotal = 0;\n /** @type {number} */\n this._now = Date.now();\n /** @type {number} */\n this._len = 0;\n /** @type {number} */\n this._marked = 0;\n /** @type {number} */\n this._i = 0;\n /** @type {number} */\n this._diff = 0;\n /** @type {number} */\n this._newTick = 0;\n }\n\n /**\n * Creates a new TimerEvent.\n * @param {number} delay - The delay in milliseconds before the event fires.\n * @param {boolean} loop - Whether the event should loop indefinitely.\n * @param {number} repeatCount - The number of times to repeat the event (0 = infinite).\n * @param {Function} callback - The function to call when the event fires.\n * @param {object} callbackContext - The context in which to call the callback.\n * @param {...any} args - Arguments to pass to the callback function.\n * @returns {TimerEvent} The created TimerEvent.\n */\n create(delay, loop, repeatCount, callback, callbackContext = null, args) {\n const roundedDelay = Math.round(delay);\n let tick = roundedDelay;\n if (this._now === 0) {\n tick += this.game.time.time;\n } else {\n tick += this._now;\n }\n const event = new TimerEvent(this, roundedDelay, tick, repeatCount, loop, callback, callbackContext, args);\n this.events.push(event);\n this.order();\n this.expired = false;\n return event;\n }\n\n /**\n * Creates a new TimerEvent that runs once.\n * @param {number} delay - The delay in milliseconds before the event fires.\n * @param {Function} callback - The function to call when the event fires.\n * @param {object} callbackContext - The context in which to call the callback.\n * @param {...any} args - Arguments to pass to the callback function.\n * @returns {TimerEvent} The created TimerEvent.\n */\n add(delay, callback, callbackContext = null, ...args) {\n return this.create(delay, false, 0, callback, callbackContext, args);\n }\n\n /**\n * Creates a new async TimerEvent that runs once.\n * @template T\n * @param {number} delay - The delay in milliseconds before the promise resolves.\n * @param {...T} args - Arguments to pass to the resolve function.\n * @returns {Promise<T | T[]>} The created Promise.\n */\n wait(delay, ...args) {\n return new Promise((resolve) => {\n this.create(delay, false, 0, () => {\n resolve(args.length <= 1 ? args[0] : args);\n });\n });\n }\n\n /**\n * Creates a new TimerEvent that repeats a specified number of times.\n * @param {number} delay - The delay in milliseconds before the event fires.\n * @param {number} repeatCount - The number of times to repeat the event (0 = infinite).\n * @param {Function} callback - The function to call when the event fires.\n * @param {object} callbackContext - The context in which to call the callback.\n * @param {...any} args - Arguments to pass to the callback function.\n * @returns {TimerEvent} The created TimerEvent.\n */\n repeat(delay, repeatCount, callback, callbackContext = null, ...args) {\n return this.create(delay, false, repeatCount, callback, callbackContext, args);\n }\n\n /**\n * Creates a new TimerEvent that loops indefinitely.\n * @param {number} delay - The delay in milliseconds before the event fires.\n * @param {Function} callback - The function to call when the event fires.\n * @param {object} callbackContext - The context in which to call the callback.\n * @param {...any} args - Arguments to pass to the callback function.\n * @returns {TimerEvent} The created TimerEvent.\n */\n loop(delay, callback, callbackContext = null, ...args) {\n return this.create(delay, true, 0, callback, callbackContext, args);\n }\n\n /**\n * Starts the timer.\n * @param {number} delay - The delay in milliseconds before starting (optional).\n */\n start(delay = 0) {\n if (this.running) {\n return;\n }\n this._started = this.game.time.time + (delay || 0);\n this.running = true;\n for (let i = 0; i < this.events.length; i += 1) {\n this.events[i].tick = this.events[i].delay + this._started;\n }\n }\n\n /**\n * Stops the timer.\n * @param {boolean} clearEvents - Whether to clear all events (default: true).\n */\n stop(clearEvents = true) {\n this.running = false;\n if (clearEvents) {\n this.events.length = 0;\n }\n }\n\n /**\n * Removes a TimerEvent from the timer.\n * @param {TimerEvent | null | undefined} event - The TimerEvent to remove.\n * @returns {boolean} True if the event was removed, false otherwise.\n */\n remove(event) {\n for (let i = 0; i < this.events.length; i += 1) {\n if (this.events[i] === event) {\n this.events[i].pendingDelete = true;\n return true;\n }\n }\n return false;\n }\n\n /**\n * Orders the timer events by their next tick time.\n */\n order() {\n if (this.events.length > 0) {\n // Sort the events so the one with the lowest tick is first\n this.events.sort(this.sortHandler);\n this.nextTick = this.events[0].tick;\n }\n }\n\n /**\n * Sorts TimerEvents by their tick time.\n * @param {TimerEvent} a - First TimerEvent to compare.\n * @param {TimerEvent} b - Second TimerEvent to compare.\n * @returns {number} Comparison result (-1, 0, or 1).\n */\n sortHandler(a, b) {\n if (a.tick < b.tick) {\n return -1;\n } else if (a.tick > b.tick) {\n return 1;\n }\n return 0;\n }\n\n /**\n * Clears pending events from the timer.\n */\n clearPendingEvents() {\n this._i = this.events.length;\n while (this._i) {\n this._i -= 1;\n if (this.events[this._i].pendingDelete) {\n this.events.splice(this._i, 1);\n }\n }\n this._len = this.events.length;\n this._i = 0;\n }\n\n /**\n * Updates the timer state at a given time.\n * @param {number} time - The current time in milliseconds.\n * @returns {boolean} True if the timer should continue running, false if it should be destroyed.\n */\n update(time) {\n if (this.paused) {\n return true;\n }\n this.elapsed = time - this._now;\n this._now = time;\n // spike-dislike\n if (this.elapsed > this.timeCap) {\n // For some reason the time between now and the last time the game was updated was larger than our timeCap.\n // This can happen if the Game.config.disableVisibilityChange is true and you swap tabs, which makes the raf pause.\n // In this case we need to adjust the TimerEvents and nextTick.\n this.adjustEvents(time - this.elapsed);\n }\n this._marked = 0;\n // Clears events marked for deletion and resets _len and _i to 0.\n this.clearPendingEvents();\n if (this.running && this._now >= this.nextTick && this._len > 0) {\n while (this._i < this._len && this.running) {\n if (this._now >= this.events[this._i].tick && !this.events[this._i].pendingDelete) {\n // (now + delay) - (time difference from last tick to now)\n this._newTick = this._now + this.events[this._i].delay - (this._now - this.events[this._i].tick);\n if (this._newTick < 0) {\n this._newTick = this._now + this.events[this._i].delay;\n }\n if (this.events[this._i].loop === true) {\n this.events[this._i].tick = this._newTick;\n this.events[this._i].callback.apply(this.events[this._i].callbackContext, this.events[this._i].args);\n } else if (this.events[this._i].repeatCount > 0) {\n this.events[this._i].repeatCount -= 1;\n this.events[this._i].tick = this._newTick;\n this.events[this._i].callback.apply(this.events[this._i].callbackContext, this.events[this._i].args);\n } else {\n this._marked += 1;\n this.events[this._i].pendingDelete = true;\n this.events[this._i].callback.apply(this.events[this._i].callbackContext, this.events[this._i].args);\n }\n this._i += 1;\n } else {\n break;\n }\n }\n // Are there any events left?\n if (this.events.length > this._marked) {\n this.order();\n } else {\n this.expired = true;\n this.onComplete.dispatch(this);\n }\n }\n if (this.expired && this.autoDestroy) {\n return false;\n }\n return true;\n }\n\n /**\n * Pauses the timer.\n */\n pause() {\n if (!this.running) {\n return;\n }\n this._codePaused = true;\n if (this.paused) {\n return;\n }\n this._pauseStarted = this.game.time.time;\n this.paused = true;\n }\n\n /**\n * Internal pause method for the timer.\n */\n _pause() {\n if (this.paused || !this.running) {\n return;\n }\n this._pauseStarted = this.game.time.time;\n this.paused = true;\n }\n\n /**\n * Adjusts timer events when time has jumped (e.g., when tab is switched).\n * @param {number} baseTime - The time to adjust from.\n */\n adjustEvents(baseTime) {\n for (let i = 0; i < this.events.length; i += 1) {\n if (!this.events[i].pendingDelete) {\n // Work out how long there would have been from when the game paused until the events next tick\n let t = this.events[i].tick - baseTime;\n if (t < 0) {\n t = 0;\n }\n // Add the difference on to the time now\n this.events[i].tick = this._now + t;\n }\n }\n const d = this.nextTick - baseTime;\n if (d < 0) {\n this.nextTick = this._now;\n } else {\n this.nextTick = this._now + d;\n }\n }\n\n /**\n * Resumes the timer.\n */\n resume() {\n if (!this.paused) {\n return;\n }\n const now = this.game.time.time;\n this._pauseTotal += now - this._now;\n this._now = now;\n this.adjustEvents(this._pauseStarted);\n this.paused = false;\n this._codePaused = false;\n }\n\n /**\n * Internal resume method for the timer.\n */\n _resume() {\n if (this._codePaused) {\n return;\n }\n this.resume();\n }\n\n /**\n * Removes all events from the timer.\n */\n removeAll() {\n this.onComplete.removeAll();\n this.events.length = 0;\n this._len = 0;\n this._i = 0;\n }\n\n /**\n * Destroys the timer and cleans up resources.\n */\n destroy() {\n this.onComplete.removeAll();\n this.running = false;\n this.events = [];\n this._len = 0;\n this._i = 0;\n }\n\n /**\n * Gets the next tick time for the timer.\n * @returns {number} The next tick time in milliseconds.\n */\n get next() {\n return this.nextTick;\n }\n\n /**\n * Gets the duration until the next event.\n * @returns {number} The duration in milliseconds.\n */\n get duration() {\n if (this.running && this.nextTick > this._now) {\n return this.nextTick - this._now;\n }\n return 0;\n }\n\n /**\n * Gets the number of active events in the timer.\n * @returns {number} The number of events.\n */\n get length() {\n return this.events.length;\n }\n\n /**\n * Gets the elapsed time since the timer started.\n * @returns {number} The elapsed time in milliseconds.\n */\n get ms() {\n if (this.running) {\n return this._now - this._started - this._pauseTotal;\n }\n return 0;\n }\n\n /**\n * Gets the elapsed time in seconds since the timer started.\n * @returns {number} The elapsed time in seconds.\n */\n get seconds() {\n if (this.running) {\n return this.ms * 0.001;\n }\n return 0;\n }\n}","// @ts-nocheck\nimport { Timer } from './timer.js';\n\nexport class Time {\n /**\n * Creates a new Time instance.\n * @param {import('./game.js').Game} game - Reference to the Phaser Game instance.\n */\n constructor(game) {\n this.game = game;\n /** @type {number} */\n this.time = 0;\n /** @type {number} */\n this.prevTime = 0;\n /** @type {number} */\n this.now = 0;\n /** @type {number} */\n this.elapsed = 0;\n /** @type {number} */\n this.elapsedMS = 0;\n /** @type {number} */\n this.desiredFpsMult = 1 / 60;\n /** @type {number} */\n this._desiredFps = 60;\n /** @type {number} */\n this.suggestedFps = this.desiredFps;\n /** @type {boolean} */\n this.advancedTiming = false;\n /** @type {number} */\n this.frames = 0;\n /** @type {number} */\n this.fps = 0;\n /** @type {number} */\n this.fpsMin = 1000;\n /** @type {number} */\n this.fpsMax = 0;\n /** @type {number} */\n this.msMin = 1000;\n /** @type {number} */\n this.msMax = 0;\n /** @type {number} */\n this.pauseDuration = 0;\n /** @type {number} */\n this.timeToCall = 0;\n /** @type {number} */\n this.timeExpected = 0;\n /** @type {Timer} */\n this.events = new Timer(this.game, false);\n /** @type {number} */\n this._frameCount = 0;\n /** @type {number} */\n this._elapsedAccumulator = 0;\n this._started = 0;\n /** @type {number} */\n this._timeLastSecond = 0;\n /** @type {number} */\n this._pauseStarted = 0;\n /** @type {boolean} */\n this._justResumed = false;\n /** @type {Timer[]} */\n this._timers = [];\n }\n\n /**\n * Initializes the time manager and starts tracking time.\n */\n boot() {\n this._started = Date.now();\n this.time = Date.now();\n this.events.start();\n this.timeExpected = this.time;\n }\n\n /**\n * Adds a Timer to the Time manager.\n * @param {Timer} timer - The Timer to add.\n * @returns {Timer} The added Timer object.\n */\n add(timer) {\n this._timers.push(timer);\n return timer;\n }\n\n /**\n * Creates a new Timer and adds it to the Time manager.\n * @param {boolean} autoDestroy - Whether the timer should be automatically destroyed when it completes.\n * @returns {Timer} The created Timer object.\n */\n create(autoDestroy = true) {\n const timer = new Timer(this.game, autoDestroy);\n this._timers.push(timer);\n return timer;\n }\n\n /**\n * Removes all timers from the Time manager.\n */\n removeAll() {\n for (let i = 0; i < this._timers.length; i += 1) {\n this._timers[i].destroy();\n }\n this._timers = [];\n this.events.removeAll();\n }\n\n /**\n * Refreshes the time tracking values.\n */\n refresh() {\n const previousDateNow = this.time;\n // this.time always holds a Date.now value\n this.time = Date.now();\n // Adjust accordingly.\n this.elapsedMS = this.time - previousDateNow;\n }\n\n /**\n * Updates the Time manager with a new timestamp.\n * @param {number} time - The new timestamp to use for updating.\n */\n update(time) {\n const previousDateNow = this.time;\n // this.time always holds a Date.now value\n this.time = Date.now();\n // Adjust accordingly.\n this.elapsedMS = this.time - previousDateNow;\n // 'now' is currently still holding the time of the last call, move it into prevTime\n this.prevTime = this.now;\n // update 'now' to hold the current time\n // this.now may hold the RAF high resolution time value if RAF is available (otherwise it also holds Date.now)\n this.now = time;\n // elapsed time between previous call and now - this could be a high resolution value\n this.elapsed = this.now - this.prevTime;\n if (this.advancedTiming) {\n this.updateAdvancedTiming();\n }\n // Paused but still running?\n if (!this.game.paused) {\n // Our internal Phaser.Timer\n this.events.update(this.time);\n if (this._timers.length) {\n this.updateTimers();\n }\n }\n }\n\n /**\n * Updates all timers managed by the Time manager.\n */\n updateTimers() {\n let i = 0;\n let len = this._timers.length;\n while (i < len) {\n if (this._timers[i].update(this.time)) {\n i += 1;\n } else {\n // Timer requests to be removed\n this._timers.splice(i, 1);\n len -= 1;\n }\n }\n }\n\n /**\n * Updates the advanced timing values.\n */\n updateAdvancedTiming() {\n // count the number of time.update calls\n this._frameCount += 1;\n this._elapsedAccumulator += this.elapsed;\n // occasionally recalculate the suggestedFps based on the accumulated elapsed time\n if (this._frameCount >= this._desiredFps * 2) {\n // this formula calculates suggestedFps in multiples of 5 fps\n this.suggestedFps = Math.floor(200 / (this._elapsedAccumulator / this._frameCount)) * 5;\n this._frameCount = 0;\n this._elapsedAccumulator = 0;\n }\n this.msMin = Math.min(this.msMin, this.elapsed);\n this.msMax = Math.max(this.msMax, this.elapsed);\n this.frames += 1;\n if (this.now > this._timeLastSecond + 1000) {\n this.fps = Math.round((this.frames * 1000) / (this.now - this._timeLastSecond));\n this.fpsMin = Math.min(this.fpsMin, this.fps);\n this.fpsMax = Math.max(this.fpsMax, this.fps);\n this._timeLastSecond = this.now;\n this.frames = 0;\n }\n }\n\n /**\n * Handles game pause event.\n */\n gamePaused() {\n this._pauseStarted = Date.now();\n this.events.pause();\n let i = this._timers.length;\n while (i) {\n i -= 1;\n this._timers[i]._pause();\n }\n }\n\n /**\n * Handles game resume event.\n */\n gameResumed() {\n this.time = Date.now();\n this.pauseDuration = this.time - this._pauseStarted;\n this.events.resume();\n let i = this._timers.length;\n while (i) {\n i -= 1;\n this._timers[i]._resume();\n }\n }\n\n /**\n * Gets the total elapsed time in seconds since the game started.\n * @returns {number} The total elapsed time in seconds.\n */\n totalElapsedSeconds() {\n return (this.time - this._started) * 0.001;\n }\n\n /**\n * Gets the elapsed time in milliseconds since a given timestamp.\n * @param {number} since - The timestamp to calculate elapsed time from.\n * @returns {number} The elapsed time in milliseconds.\n */\n elapsedSince(since) {\n return this.time - since;\n }\n\n /**\n * Gets the elapsed time in seconds since a given timestamp.\n * @param {number} since - The timestamp to calculate elapsed time from.\n * @returns {number} The elapsed time in seconds.\n */\n elapsedSecondsSince(since) {\n return (this.time - since) * 0.001;\n }\n\n /**\n * Resets the time tracking values.\n */\n reset() {\n this._started = this.time;\n this.removeAll();\n }\n\n /**\n * Destroys the Time manager and cleans up resources.\n */\n destroy() {\n this.reset();\n }\n\n /**\n * Gets the desired frames per second.\n * @returns {number} The desired frames per second.\n */\n get desiredFps() {\n return this._desiredFps;\n }\n\n /**\n * Sets the desired frames per second.\n */\n set desiredFps(value) {\n this._desiredFps = value;\n this.desiredFpsMult = 1 / value;\n }\n}","// @ts-nocheck\nimport * as MathUtils from '../util/math.js';\nimport { TWEEN_COMPLETE, TWEEN_LOOPED, TWEEN_PENDING, TWEEN_RUNNING } from './const.js';\n\nexport class TweenData {\n /**\n * Creates a new TweenData instance.\n * @param {import('./tween.js').Tween} parent - The parent Tween instance.\n */\n constructor(parent) {\n this.parent = parent;\n this.game = parent.game;\n this.vStart = {};\n this.vStartCache = {};\n this.vEnd = {};\n this.vEndCache = {};\n this.duration = 1000;\n this.percent = 0;\n this.value = 0;\n this.repeatCounter = 0;\n this.repeatDelay = 0;\n this.repeatTotal = 0;\n this.interpolate = false;\n this.yoyo = false;\n this.yoyoDelay = 0;\n this.inReverse = false;\n this.delay = 0;\n this.dt = 0;\n this.startTime = null;\n this.easingFunction = (k) => k;\n this.interpolationFunction = MathUtils.linearInterpolation;\n this.interpolationContext = MathUtils;\n this.isRunning = false;\n this.isFrom = false;\n }\n\n /**\n * Sets the target properties to tween to.\n * @param {object} properties - The properties to tween to.\n * @param {number} duration - The duration of the tween in milliseconds.\n * @param {(number) => number} ease - The easing function to use.\n * @param {number} delay - The delay before starting the tween in milliseconds.\n * @param {number} repeat - The number of times to repeat the tween (0 = no repeat, -1 = infinite).\n * @param {boolean} yoyo - Whether to reverse the tween on each repeat.\n * @returns {TweenData} This TweenData object for chaining.\n */\n to(properties, duration, ease, delay, repeat, yoyo) {\n this.vEnd = properties;\n this.duration = duration;\n this.easingFunction = ease;\n this.delay = delay;\n this.repeatTotal = repeat;\n this.yoyo = yoyo;\n this.isFrom = false;\n return this;\n }\n\n /**\n * Sets the target properties to tween from (in reverse).\n * @param {object} properties - The properties to tween from.\n * @param {number} duration - The duration of the tween in milliseconds.\n * @param {(number) => number} ease - The easing function to use.\n * @param {number} delay - The delay before starting the tween in milliseconds.\n * @param {number} repeat - The number of times to repeat the tween (0 = no repeat, -1 = infinite).\n * @param {boolean} yoyo - Whether to reverse the tween on each repeat.\n * @returns {TweenData} This TweenData object for chaining.\n */\n from(properties, duration, ease, delay, repeat, yoyo) {\n this.vEnd = properties;\n this.duration = duration;\n this.easingFunction = ease;\n this.delay = delay;\n this.repeatTotal = repeat;\n this.yoyo = yoyo;\n this.isFrom = true;\n return this;\n }\n\n /**\n * Starts the tween.\n * @returns {TweenData} This TweenData object for chaining.\n */\n start() {\n this.startTime = this.game.time.time + this.delay;\n if (this.parent.reverse) {\n this.dt = this.duration;\n } else {\n this.dt = 0;\n }\n if (this.delay > 0) {\n this.isRunning = false;\n } else {\n this.isRunning = true;\n }\n if (this.isFrom) {\n // Reverse them all and instant set them\n const keys = Object.keys(this.vStartCache);\n for (let k = 0; k < keys.length; k += 1) {\n const property = keys[k];\n this.vStart[property] = this.vEndCache[property];\n this.vEnd[property] = this.vStartCache[property];\n this.parent.target[property] = this.vStart[property];\n }\n }\n this.value = 0;\n this.yoyoCounter = 0;\n this.repeatCounter = this.repeatTotal;\n return this;\n }\n\n /**\n * Loads the tween values from the parent object.\n * @returns {TweenData} This TweenData object for chaining.\n */\n loadValues() {\n const keys = Object.keys(this.parent.properties);\n for (let k = 0; k < keys.length; k += 1) {\n const property = keys[k];\n // Load the property from the parent object\n this.vStart[property] = this.parent.properties[property];\n // Check if an Array was provided as property value\n if (Array.isArray(this.vEnd[property])) {\n if (this.vEnd[property].length === 0) {\n // pass\n // TODO: this was continue;\n } else if (this.percent === 0) {\n // Put the start value at the beginning of the array\n // but we only want to do this once, if the Tween hasn't run before\n this.vEnd[property] = [this.vStart[property]].concat(this.vEnd[property]);\n }\n }\n if (typeof this.vEnd[property] !== 'undefined') {\n if (typeof this.vEnd[property] === 'string') {\n // Parses relative end values with start as base (e.g.: +10, -3)\n this.vEnd[property] = this.vStart[property] + Number.parseFloat(this.vEnd[property]);\n }\n this.parent.properties[property] = this.vEnd[property];\n } else {\n // Null tween\n this.vEnd[property] = this.vStart[property];\n }\n this.vStartCache[property] = this.vStart[property];\n this.vEndCache[property] = this.vEnd[property];\n }\n return this;\n }\n\n /**\n * Updates the tween at a given time.\n * @param {number} time - The current time in milliseconds.\n * @returns {number} The tween status (TWEEN_PENDING, TWEEN_RUNNING, or TWEEN_COMPLETE).\n */\n update(time) {\n if (!this.isRunning) {\n if (time >= this.startTime) {\n this.isRunning = true;\n } else {\n return TWEEN_PENDING;\n }\n } else if (time < this.startTime) {\n // Is Running, but is waiting to repeat\n return TWEEN_RUNNING;\n }\n const ms = this.game.time.elapsedMS;\n if (this.parent.reverse) {\n this.dt -= ms * this.parent.timeScale;\n this.dt = Math.max(this.dt, 0);\n } else {\n this.dt += ms * this.parent.timeScale;\n this.dt = Math.min(this.dt, this.duration);\n }\n this.percent = this.dt / this.duration;\n this.value = this.easingFunction(this.percent);\n const keys = Object.keys(this.vEnd);\n for (let k = 0; k < keys.length; k += 1) {\n const property = keys[k];\n const start = this.vStart[property];\n const end = this.vEnd[property];\n if (Array.isArray(end)) {\n this.parent.target[property] = this.interpolationFunction.call(this.interpolationContext, end, this.value);\n } else {\n this.parent.target[property] = start + (end - start) * this.value;\n }\n }\n if ((!this.parent.reverse && this.percent === 1) || (this.parent.reverse && this.percent === 0)) {\n return this.repeat();\n }\n return TWEEN_RUNNING;\n }\n\n /**\n * Generates an array of tween data points for a given frame rate.\n * @param {number} frameRate - The frame rate to generate data for.\n * @returns {object[]} An array of tween data points.\n */\n generateData(frameRate) {\n if (this.parent.reverse) {\n this.dt = this.duration;\n } else {\n this.dt = 0;\n }\n let data = [];\n let complete = false;\n const fps = (1 / frameRate) * 1000;\n do {\n if (this.parent.reverse) {\n this.dt -= fps;\n this.dt = Math.max(this.dt, 0);\n } else {\n this.dt += fps;\n this.dt = Math.min(this.dt, this.duration);\n }\n this.percent = this.dt / this.duration;\n this.value = this.easingFunction(this.percent);\n const blob = {};\n const keys = Object.keys(this.vEnd);\n for (let k = 0; k < keys.length; k += 1) {\n const property = keys[k];\n const start = this.vStart[property];\n const end = this.vEnd[property];\n if (Array.isArray(end)) {\n blob[property] = this.interpolationFunction(end, this.value);\n } else {\n blob[property] = start + (end - start) * this.value;\n }\n }\n data.push(blob);\n if ((!this.parent.reverse && this.percent === 1) || (this.parent.reverse && this.percent === 0)) {\n complete = true;\n }\n } while (!complete);\n if (this.yoyo) {\n const reversed = data.slice();\n reversed.reverse();\n data = data.concat(reversed);\n }\n return data;\n }\n\n /**\n * Handles tween repetition logic.\n * @returns {number} The tween status (TWEEN_LOOPED or TWEEN_COMPLETE).\n */\n repeat() {\n // If not a yoyo and repeatCounter = 0 then we're done\n if (this.yoyo) {\n // We're already in reverse mode, which means the yoyo has finished and there's no repeats, so end\n if (this.inReverse && this.repeatCounter === 0) {\n // Restore the properties\n const keys = Object.keys(this.vStartCache);\n for (let k = 0; k < keys.length; k += 1) {\n const property = keys[k];\n this.vStart[property] = this.vStartCache[property];\n this.vEnd[property] = this.vEndCache[property];\n }\n this.inReverse = false;\n return TWEEN_COMPLETE;\n }\n this.inReverse = !this.inReverse;\n } else if (this.repeatCounter === 0) {\n return TWEEN_COMPLETE;\n }\n if (this.inReverse) {\n // If inReverse we're going from vEnd to vStartCache\n const keys = Object.keys(this.vStartCache);\n for (let k = 0; k < keys.length; k += 1) {\n const property = keys[k];\n this.vStart[property] = this.vEndCache[property];\n this.vEnd[property] = this.vStartCache[property];\n }\n } else {\n // If not inReverse we're just repopulating the cache again\n const keys = Object.keys(this.vStartCache);\n for (let k = 0; k < keys.length; k += 1) {\n const property = keys[k];\n this.vStart[property] = this.vStartCache[property];\n this.vEnd[property] = this.vEndCache[property];\n }\n // -1 means repeat forever, otherwise decrement the repeatCounter\n // We only decrement this counter if the tween isn't doing a yoyo, as that doesn't count towards the repeat total\n if (this.repeatCounter > 0) {\n this.repeatCounter -= 1;\n }\n }\n this.startTime = this.game.time.time;\n if (this.yoyo && this.inReverse) {\n this.startTime += this.yoyoDelay;\n } else if (!this.inReverse) {\n this.startTime += this.repeatDelay;\n }\n if (this.parent.reverse) {\n this.dt = this.duration;\n } else {\n this.dt = 0;\n }\n return TWEEN_LOOPED;\n }\n}","// @ts-nocheck\nimport * as MathUtils from '../util/math.js';\nimport { TWEEN_COMPLETE, TWEEN_LOOPED, TWEEN_PENDING, TWEEN_RUNNING } from './const.js';\nimport { Signal } from './signal.js';\nimport { TweenData } from './tween_data.js';\n\nexport class Tween {\n /**\n * Creates a new Tween instance.\n * @param {import('../display/display_object.js').DisplayObject} target - The object to tween.\n * @param {import('./game.js').Game} game - Reference to the Phaser Game instance.\n * @param {import('./tween_manager.js').TweenManager} manager - Reference to the Tween Manager.\n */\n constructor(target, game, manager) {\n this.game = game;\n this.target = target;\n /** @type {import('./tween_manager.js').TweenManager} */\n this.manager = manager;\n /** @type {TweenData[]} */\n this.timeline = [];\n /** @type {boolean} */\n this.reverse = false;\n /** @type {number} */\n this.timeScale = 1;\n /** @type {number} */\n this.repeatCounter = 0;\n /** @type {boolean} */\n this.pendingDelete = false;\n /** @type {Signal} */\n this.onStart = new Signal();\n /** @type {Signal} */\n this.onLoop = new Signal();\n /** @type {Signal} */\n this.onRepeat = new Signal();\n /** @type {Signal} */\n this.onChildComplete = new Signal();\n /** @type {Signal} */\n this.onComplete = new Signal();\n /** @type {boolean} */\n this.isRunning = false;\n /** @type {number} */\n this.current = 0;\n this.properties = {};\n this.chainedTween = null;\n /** @type {boolean} */\n this.isPaused = false;\n this._onUpdateCallback = null;\n this._onUpdateCallbackContext = null;\n /** @type {number} */\n this._pausedTime = 0;\n /** @type {boolean} */\n this._codePaused = false;\n /** @type {boolean} */\n this._hasStarted = false;\n }\n\n /**\n * Adds a tween to the timeline that animates properties to their target values.\n * @param {object} properties - The properties to tween and their target values.\n * @param {number} duration - The duration of the tween in milliseconds.\n * @param {string | Function} ease - The easing function to use.\n * @param {boolean} autoStart - Whether to start the tween immediately.\n * @param {number} delay - The delay before starting the tween in milliseconds.\n * @param {number} repeat - Number of times to repeat the tween.\n * @param {boolean} yoyo - Whether to reverse the tween on repeat.\n * @returns {Tween} This Tween object for chaining.\n */\n to(properties, duration = 1000, ease = 'Linear', autoStart = false, delay = 0, repeat = 0, yoyo = false) {\n if (typeof ease === 'string' && this.manager.easeMap[ease]) {\n ease = this.manager.easeMap[ease];\n }\n if (this.isRunning) {\n return this;\n }\n // @ts-ignore\n this.timeline.push(new TweenData(this).to(properties, duration, ease, delay, repeat, yoyo));\n if (autoStart) {\n this.start();\n }\n return this;\n }\n\n /**\n * Adds a tween to the timeline that animates properties from their current values.\n * @param {object} properties - The properties to tween and their target values.\n * @param {number} duration - The duration of the tween in milliseconds.\n * @param {string | Function} ease - The easing function to use.\n * @param {boolean} autoStart - Whether to start the tween immediately.\n * @param {number} delay - The delay before starting the tween in milliseconds.\n * @param {number} repeat - Number of times to repeat the tween.\n * @param {boolean} yoyo - Whether to reverse the tween on repeat.\n * @returns {Tween} This Tween object for chaining.\n */\n from(properties, duration = 1000, ease = 'Linear', autoStart = false, delay = 0, repeat = 0, yoyo = false) {\n if (typeof ease === 'string' && this.manager.easeMap[ease]) {\n ease = this.manager.easeMap[ease];\n }\n if (this.isRunning) {\n this.game.logger.warn('Tween.from cannot be called after Tween.start');\n return this;\n }\n // @ts-ignore\n this.timeline.push(new TweenData(this).from(properties, duration, ease, delay, repeat, yoyo));\n if (autoStart) {\n this.start();\n }\n return this;\n }\n\n /**\n * Starts the tween timeline from a specific index.\n * @param {number} index - The index to start from in the timeline.\n * @returns {Tween} This Tween object for chaining.\n */\n start(index = 0) {\n if (this.game === null || this.target === null || this.timeline.length === 0 || this.isRunning) {\n return this;\n }\n // Populate the tween data\n for (let i = 0; i < this.timeline.length; i += 1) {\n // Build our master property list with the starting values\n const keys = Object.keys(this.timeline[i].vEnd);\n for (let k = 0; k < keys.length; k += 1) {\n const property = keys[k];\n this.properties[property] = this.target[property] || 0;\n if (!Array.isArray(this.properties[property])) {\n // Ensures we're using numbers, not strings\n this.properties[property] *= 1;\n }\n }\n }\n for (let i = 0; i < this.timeline.length; i += 1) {\n this.timeline[i].loadValues();\n }\n this.manager.add(this);\n this.isRunning = true;\n if (index < 0 || index > this.timeline.length - 1) {\n index = 0;\n }\n this.current = index;\n this.timeline[this.current].start();\n return this;\n }\n\n /**\n * Stops the tween and optionally completes it.\n * @param {boolean} complete - Whether to dispatch the complete event.\n * @returns {Tween} This Tween object for chaining.\n */\n stop(complete = false) {\n this.isRunning = false;\n this._onUpdateCallback = null;\n this._onUpdateCallbackContext = null;\n if (complete) {\n this.onComplete.dispatch(this.target, this);\n this._hasStarted = false;\n if (this.chainedTween) {\n this.chainedTween.start();\n }\n }\n this.manager.remove(this);\n return this;\n }\n\n /**\n * Updates a property in the tween data.\n * @param {string} property - The property name to update.\n * @param {object} value - The new value for the property.\n * @param {number} index - The index in the timeline to update.\n * @returns {Tween} This Tween object for chaining.\n */\n updateTweenData(property, value, index = 0) {\n if (this.timeline.length === 0) {\n return this;\n }\n if (index === -1) {\n for (let i = 0; i < this.timeline.length; i += 1) {\n this.timeline[i][property] = value;\n }\n } else {\n this.timeline[index][property] = value;\n }\n return this;\n }\n\n /**\n * Sets a delay for a specific timeline entry.\n * @param {number} duration - The delay in milliseconds.\n * @param {number} index - The index in the timeline to apply the delay to.\n * @returns {Tween} This Tween object for chaining.\n */\n delay(duration, index) {\n return this.updateTweenData('delay', duration, index);\n }\n\n /**\n * Sets how many times to repeat the tween.\n * @param {number} total - The number of times to repeat (-1 for infinite).\n * @param {number} repeatDelay - Delay between repeats in milliseconds.\n * @param {number} index - The index in the timeline to apply the repeat to.\n * @returns {Tween} This Tween object for chaining.\n */\n repeat(total, repeatDelay = 0, index = 0) {\n this.updateTweenData('repeatCounter', total, index);\n return this.updateTweenData('repeatDelay', repeatDelay, index);\n }\n\n /**\n * Sets the repeat delay for a specific timeline entry.\n * @param {number} duration - The delay between repeats in milliseconds.\n * @param {number} index - The index in the timeline to apply the delay to.\n * @returns {Tween} This Tween object for chaining.\n */\n repeatDelay(duration, index) {\n return this.updateTweenData('repeatDelay', duration, index);\n }\n\n /**\n * Enables or disables yoyo behavior for a timeline entry.\n * @param {boolean} enable - Whether to enable yoyo behavior.\n * @param {number} yoyoDelay - Delay between yoyo cycles in milliseconds.\n * @param {number} index - The index in the timeline to apply yoyo to.\n * @returns {Tween} This Tween object for chaining.\n */\n yoyo(enable, yoyoDelay = 0, index = 0) {\n this.updateTweenData('yoyo', enable, index);\n return this.updateTweenData('yoyoDelay', yoyoDelay, index);\n }\n\n /**\n * Sets the yoyo delay for a specific timeline entry.\n * @param {number} duration - The delay between yoyo cycles in milliseconds.\n * @param {number} index - The index in the timeline to apply the delay to.\n * @returns {Tween} This Tween object for chaining.\n */\n yoyoDelay(duration, index) {\n return this.updateTweenData('yoyoDelay', duration, index);\n }\n\n /**\n * Sets the easing function for a timeline entry.\n * @param {string|Function} ease - The easing function to use.\n * @param {number} index - The index in the timeline to apply easing to.\n * @returns {Tween} This Tween object for chaining.\n */\n easing(ease, index) {\n if (typeof ease === 'string' && this.manager.easeMap[ease]) {\n ease = this.manager.easeMap[ease];\n }\n return this.updateTweenData('easingFunction', ease, index);\n }\n\n /**\n * Sets the interpolation function for a timeline entry.\n * @param {Function} interpolation - The interpolation function to use.\n * @param {object} context - The context in which to call the interpolation function.\n * @param {number} index - The index in the timeline to apply interpolation to.\n * @returns {Tween} This Tween object for chaining.\n */\n interpolation(interpolation, context = MathUtils, index = 0) {\n this.updateTweenData('interpolationFunction', interpolation, index);\n return this.updateTweenData('interpolationContext', context, index);\n }\n\n /**\n * Sets how many times to repeat all timeline entries.\n * @param {number} total - The number of times to repeat (-1 for infinite).\n * @returns {Tween} This Tween object for chaining.\n */\n repeatAll(total = 0) {\n this.repeatCounter = total;\n return this;\n }\n\n /**\n * Chains one or more tweens to this tween.\n * @param {...any} args - The tweens to chain.\n * @returns {Tween} This Tween object for chaining.\n */\n chain(...args) {\n let i = args.length;\n while (i) {\n i -= 1;\n if (i > 0) {\n args[i - 1].chainedTween = args[i];\n } else {\n this.chainedTween = args[i];\n }\n }\n return this;\n }\n\n /**\n * Sets whether the tween should loop infinitely.\n * @param {boolean} value - Whether to loop infinitely.\n * @returns {Tween} This Tween object for chaining.\n */\n loop(value = true) {\n this.repeatCounter = value ? -1 : 0;\n return this;\n }\n\n /**\n * Sets a callback to be called when the tween updates.\n * @param {Function} callback - The callback function to call.\n * @param {object} callbackContext - The context in which to call the callback.\n * @returns {Tween} This Tween object for chaining.\n */\n onUpdateCallback(callback, callbackContext) {\n this._onUpdateCallback = callback;\n this._onUpdateCallbackContext = callbackContext;\n return this;\n }\n\n /**\n * Pauses the tween.\n */\n pause() {\n this.isPaused = true;\n this._codePaused = true;\n this._pausedTime = this.game.time.time;\n }\n\n /**\n * Internal method to pause the tween.\n */\n _pause() {\n if (!this._codePaused) {\n this.isPaused = true;\n this._pausedTime = this.game.time.time;\n }\n }\n\n /**\n * Resumes the tween.\n */\n resume() {\n if (this.isPaused) {\n this.isPaused = false;\n this._codePaused = false;\n for (let i = 0; i < this.timeline.length; i += 1) {\n if (!this.timeline[i].isRunning) {\n this.timeline[i].startTime += this.game.time.time - this._pausedTime;\n }\n }\n }\n }\n\n /**\n * Internal method to resume the tween.\n */\n _resume() {\n if (!this._codePaused) {\n this.resume();\n }\n }\n\n /**\n * Updates the tween state at a given time.\n * @param {number} time - The current game time.\n * @returns {boolean} True if the tween should continue running, false if it's complete.\n */\n update(time) {\n if (this.pendingDelete || !this.target) {\n return false;\n }\n if (this.isPaused) {\n return true;\n }\n const status = this.timeline[this.current].update(time);\n if (status === TWEEN_PENDING) {\n return true;\n } else if (status === TWEEN_RUNNING) {\n if (!this._hasStarted) {\n this.onStart.dispatch(this.target, this);\n this._hasStarted = true;\n }\n if (this._onUpdateCallback !== null) {\n this._onUpdateCallback.call(\n this._onUpdateCallbackContext,\n this,\n this.timeline[this.current].value,\n this.timeline[this.current]\n );\n }\n // In case the update callback modifies this tween\n return this.isRunning;\n } else if (status === TWEEN_LOOPED) {\n if (this.timeline[this.current].repeatCounter === -1) {\n this.onLoop.dispatch(this.target, this);\n } else {\n this.onRepeat.dispatch(this.target, this);\n }\n return true;\n } else if (status === TWEEN_COMPLETE) {\n let complete = false;\n // What now?\n if (this.reverse) {\n this.current -= 1;\n if (this.current < 0) {\n this.current = this.timeline.length - 1;\n complete = true;\n }\n } else {\n this.current += 1;\n if (this.current === this.timeline.length) {\n this.current = 0;\n complete = true;\n }\n }\n if (complete) {\n // We've reached the start or end of the child tweens (depending on Tween.reverse), should we repeat it?\n if (this.repeatCounter === -1) {\n this.timeline[this.current].start();\n this.onLoop.dispatch(this.target, this);\n return true;\n } else if (this.repeatCounter > 0) {\n this.repeatCounter -= 1;\n\n this.timeline[this.current].start();\n this.onRepeat.dispatch(this.target, this);\n return true;\n }\n // No more repeats and no more children, so we're done\n this.isRunning = false;\n this.onComplete.dispatch(this.target, this);\n this._hasStarted = false;\n if (this.chainedTween) {\n this.chainedTween.start();\n }\n return false;\n }\n // We've still got some children to go\n this.onChildComplete.dispatch(this.target, this);\n this.timeline[this.current].start();\n return true;\n }\n return false;\n }\n\n /**\n * Generates animation data for a given frame rate.\n * @param {number} frameRate - The target frame rate.\n * @param {object[]} data - The array to store the generated data in.\n * @returns {object[]} The populated data array.\n */\n generateData(frameRate = 60, data = []) {\n if (this.game === null || this.target === null) {\n return null;\n }\n // Populate the tween data\n for (let i = 0; i < this.timeline.length; i += 1) {\n // Build our master property list with the starting values\n const keys = Object.keys(this.timeline[i].vEnd);\n for (let k = 0; k < keys.length; k += 1) {\n const property = keys[k];\n this.properties[property] = this.target[property] || 0;\n if (!Array.isArray(this.properties[property])) {\n // Ensures we're using numbers, not strings\n this.properties[property] *= 1;\n }\n }\n }\n for (let i = 0; i < this.timeline.length; i += 1) {\n this.timeline[i].loadValues();\n }\n for (let i = 0; i < this.timeline.length; i += 1) {\n data = data.concat(this.timeline[i].generateData(frameRate));\n }\n return data;\n }\n\n /**\n * Gets the total duration of all timeline entries.\n * @returns {number} The total duration in milliseconds.\n */\n get totalDuration() {\n let total = 0;\n for (let i = 0; i < this.timeline.length; i += 1) {\n total += this.timeline[i].duration;\n }\n return total;\n }\n}","/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const LinearNone = (k) => {\n return k;\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const QuadraticIn = (k) => {\n return k * k;\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const QuadraticOut = (k) => {\n return k * (2 - k);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const QuadraticInOut = (k) => {\n if ((k *= 2) < 1) return 0.5 * k * k;\n return -0.5 * (--k * (k - 2) - 1);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const CubicIn = (k) => {\n return k * k * k;\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const CubicOut = (k) => {\n return --k * k * k + 1;\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const CubicInOut = (k) => {\n if ((k *= 2) < 1) return 0.5 * k * k * k;\n return 0.5 * ((k -= 2) * k * k + 2);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const QuarticIn = (k) => {\n return k * k * k * k;\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const QuarticOut = (k) => {\n return 1 - --k * k * k * k;\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const QuarticInOut = (k) => {\n if ((k *= 2) < 1) return 0.5 * k * k * k * k;\n return -0.5 * ((k -= 2) * k * k * k - 2);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const QuinticIn = (k) => {\n return k * k * k * k * k;\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const QuinticOut = (k) => {\n return --k * k * k * k * k + 1;\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const QuinticInOut = (k) => {\n if ((k *= 2) < 1) return 0.5 * k * k * k * k * k;\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const SinusoidalIn = (k) => {\n if (k === 0) return 0;\n if (k === 1) return 1;\n return 1 - Math.cos((k * Math.PI) / 2);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const SinusoidalOut = (k) => {\n if (k === 0) return 0;\n if (k === 1) return 1;\n return Math.sin((k * Math.PI) / 2);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const SinusoidalInOut = (k) => {\n if (k === 0) return 0;\n if (k === 1) return 1;\n return 0.5 * (1 - Math.cos(Math.PI * k));\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const ExponentialIn = (k) => {\n return k === 0 ? 0 : Math.pow(1024, k - 1);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const ExponentialOut = (k) => {\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const ExponentialInOut = (k) => {\n if (k === 0) return 0;\n if (k === 1) return 1;\n if ((k *= 2) < 1) return 0.5 * Math.pow(1024, k - 1);\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const CircularIn = (k) => {\n return 1 - Math.sqrt(1 - k * k);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const CircularOut = (k) => {\n return Math.sqrt(1 - --k * k);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const CircularInOut = (k) => {\n if ((k *= 2) < 1) return -0.5 * (Math.sqrt(1 - k * k) - 1);\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const ElasticIn = (k) => {\n let s;\n let a = 0.1;\n const p = 0.4;\n if (k === 0) return 0;\n if (k === 1) return 1;\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = (p * Math.asin(1 / a)) / (2 * Math.PI);\n }\n return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin(((k - s) * (2 * Math.PI)) / p));\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const ElasticOut = (k) => {\n let s;\n let a = 0.1;\n const p = 0.4;\n if (k === 0) return 0;\n if (k === 1) return 1;\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = (p * Math.asin(1 / a)) / (2 * Math.PI);\n }\n return a * Math.pow(2, -10 * k) * Math.sin(((k - s) * (2 * Math.PI)) / p) + 1;\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const ElasticInOut = (k) => {\n let s;\n let a = 0.1;\n const p = 0.4;\n if (k === 0) return 0;\n if (k === 1) return 1;\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = (p * Math.asin(1 / a)) / (2 * Math.PI);\n }\n if ((k *= 2) < 1) return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin(((k - s) * (2 * Math.PI)) / p));\n return a * Math.pow(2, -10 * (k -= 1)) * Math.sin(((k - s) * (2 * Math.PI)) / p) * 0.5 + 1;\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const BackIn = (k) => {\n const s = 1.70158;\n return k * k * ((s + 1) * k - s);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const BackOut = (k) => {\n const s = 1.70158;\n return --k * k * ((s + 1) * k + s) + 1;\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const BackInOut = (k) => {\n const s = 1.70158 * 1.525;\n if ((k *= 2) < 1) return 0.5 * (k * k * ((s + 1) * k - s));\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const BounceOut = (k) => {\n if (k < 1 / 2.75) {\n return 7.5625 * k * k;\n } else if (k < 2 / 2.75) {\n return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;\n } else if (k < 2.5 / 2.75) {\n return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;\n }\n return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const BounceIn = (k) => {\n return 1 - BounceOut(1 - k);\n};\n\n/**\n * TBD.\n * @param {number} k - TBD.\n * @returns {number} TBD.\n */\nexport const BounceInOut = (k) => {\n if (k < 0.5) return BounceIn(k * 2) * 0.5;\n return BounceOut(k * 2 - 1) * 0.5 + 0.5;\n};\n","// @ts-nocheck\nimport { GROUP } from './const.js';\nimport { Tween } from './tween.js';\nimport {\n BackIn,\n BackInOut,\n BackOut,\n BounceIn,\n BounceInOut,\n BounceOut,\n CircularIn,\n CircularInOut,\n CircularOut,\n CubicIn,\n CubicInOut,\n CubicOut,\n ElasticIn,\n ElasticInOut,\n ElasticOut,\n ExponentialIn,\n ExponentialInOut,\n ExponentialOut,\n LinearNone,\n QuadraticIn,\n QuadraticInOut,\n QuadraticOut,\n QuarticIn,\n QuarticInOut,\n QuarticOut,\n QuinticIn,\n QuinticInOut,\n QuinticOut,\n SinusoidalIn,\n SinusoidalInOut,\n SinusoidalOut,\n} from './tween_easing.js';\n\nexport class TweenManager {\n /**\n * Creates a new TweenManager instance.\n * @param {import('./game.js').Game} game - The game instance this manager belongs to.\n */\n constructor(game) {\n this.game = game;\n /** @type {Tween[]} */\n this._tweens = [];\n /** @type {Tween[]} */\n this._add = [];\n /** @type {{[key: string]: (k: number) => number}} */\n this.easeMap = {\n Linear: LinearNone,\n Quad: QuadraticOut,\n Cubic: CubicOut,\n Quart: QuarticOut,\n Quint: QuinticOut,\n Sine: SinusoidalOut,\n Expo: ExponentialOut,\n Circ: CircularOut,\n Elastic: ElasticOut,\n Back: BackOut,\n Bounce: BounceOut,\n 'Quad.easeIn': QuadraticIn,\n 'Cubic.easeIn': CubicIn,\n 'Quart.easeIn': QuarticIn,\n 'Quint.easeIn': QuinticIn,\n 'Sine.easeIn': SinusoidalIn,\n 'Expo.easeIn': ExponentialIn,\n 'Circ.easeIn': CircularIn,\n 'Elastic.easeIn': ElasticIn,\n 'Back.easeIn': BackIn,\n 'Bounce.easeIn': BounceIn,\n 'Quad.easeOut': QuadraticOut,\n 'Cubic.easeOut': CubicOut,\n 'Quart.easeOut': QuarticOut,\n 'Quint.easeOut': QuinticOut,\n 'Sine.easeOut': SinusoidalOut,\n 'Expo.easeOut': ExponentialOut,\n 'Circ.easeOut': CircularOut,\n 'Elastic.easeOut': ElasticOut,\n 'Back.easeOut': BackOut,\n 'Bounce.easeOut': BounceOut,\n 'Quad.easeInOut': QuadraticInOut,\n 'Cubic.easeInOut': CubicInOut,\n 'Quart.easeInOut': QuarticInOut,\n 'Quint.easeInOut': QuinticInOut,\n 'Sine.easeInOut': SinusoidalInOut,\n 'Expo.easeInOut': ExponentialInOut,\n 'Circ.easeInOut': CircularInOut,\n 'Elastic.easeInOut': ElasticInOut,\n 'Back.easeInOut': BackInOut,\n 'Bounce.easeInOut': BounceInOut,\n };\n\n this.game.onPause.add(this._pauseAll, this);\n this.game.onResume.add(this._resumeAll, this);\n }\n\n /**\n * Get all tweens managed by this manager.\n * @returns {Tween[]} An array of all active tweens.\n */\n getAll() {\n return this._tweens;\n }\n\n /**\n * Remove all tweens from the manager.\n * This method removes all active and pending tweens.\n */\n removeAll() {\n for (let i = 0; i < this._tweens.length; i += 1) {\n this._tweens[i].pendingDelete = true;\n }\n this._add = [];\n }\n\n /**\n * Remove tweens associated with an object or its children.\n * @param {object} obj - The object to remove tweens from.\n * @param {object[]} children - Optional array of child objects to remove tweens from.\n */\n removeFrom(obj, children = null) {\n let i;\n let len;\n if (Array.isArray(obj)) {\n for (i = 0, len = obj.length; i < len; i += 1) {\n this.removeFrom(obj[i]);\n }\n } else if (obj.type === GROUP && children) {\n for (i = 0, len = obj.children.length; i < len; i += 1) {\n this.removeFrom(obj.children[i]);\n }\n } else {\n for (i = 0, len = this._tweens.length; i < len; i += 1) {\n if (obj === this._tweens[i].target) {\n this.remove(this._tweens[i]);\n }\n }\n for (i = 0, len = this._add.length; i < len; i += 1) {\n if (obj === this._add[i].target) {\n this.remove(this._add[i]);\n }\n }\n }\n }\n\n /**\n * Add a tween to the manager.\n * @param {Tween} tween - The tween to add.\n */\n add(tween) {\n tween.manager = this;\n this._add.push(tween);\n }\n\n /**\n * Create a new tween for an object.\n * @param {object} object - The object to create a tween for.\n * @returns {Tween} The created Tween object.\n */\n create(object) {\n return new Tween(object, this.game, this);\n }\n\n /**\n * Remove a tween from the manager.\n * @param {Tween | null | undefined} tween - The tween to remove.\n */\n remove(tween) {\n let i = this._tweens.indexOf(tween);\n if (i !== -1) {\n this._tweens[i].pendingDelete = true;\n } else {\n i = this._add.indexOf(tween);\n if (i !== -1) {\n this._add[i].pendingDelete = true;\n }\n }\n }\n\n /**\n * Update all tweens managed by this manager.\n * @returns {boolean} True if any tweens were updated, false otherwise.\n */\n update() {\n const addTweens = this._add.length;\n let numTweens = this._tweens.length;\n if (numTweens === 0 && addTweens === 0) {\n return false;\n }\n let i = 0;\n while (i < numTweens) {\n if (this._tweens[i].update(this.game.time.time)) {\n i += 1;\n } else {\n this._tweens.splice(i, 1);\n numTweens -= 1;\n }\n }\n // If there are any new tweens to be added, do so now - otherwise they can be spliced out of the array before ever running\n if (addTweens > 0) {\n this._tweens = this._tweens.concat(this._add);\n this._add.length = 0;\n }\n return true;\n }\n\n /**\n * Check if an object is currently being tweened.\n * @param {object} object - The object to check.\n * @returns {boolean} True if the object is being tweened, false otherwise.\n */\n isTweening(object) {\n return this._tweens.some((tween) => tween.target === object);\n }\n\n /**\n * Pause all tweens managed by this manager.\n * This method pauses all active tweens.\n */\n _pauseAll() {\n for (let i = this._tweens.length - 1; i >= 0; i -= 1) {\n this._tweens[i]._pause();\n }\n }\n\n /**\n * Resume all tweens managed by this manager.\n * This method resumes all paused tweens.\n */\n _resumeAll() {\n for (let i = this._tweens.length - 1; i >= 0; i -= 1) {\n this._tweens[i]._resume();\n }\n }\n\n /**\n * Pause all tweens managed by this manager.\n * This method pauses all active tweens.\n */\n pauseAll() {\n for (let i = this._tweens.length - 1; i >= 0; i -= 1) {\n this._tweens[i].pause();\n }\n }\n\n /**\n * Resume all tweens managed by this manager.\n * This method resumes all paused tweens.\n */\n resumeAll() {\n for (let i = this._tweens.length - 1; i >= 0; i -= 1) {\n this._tweens[i].resume(true);\n }\n }\n}","// @ts-nocheck\nimport { Group } from '../display/group.js';\n\nexport class World extends Group {\n /**\n * Creates a new World instance.\n * @param {import('./game.js').Game} game - The game instance this world belongs to.\n */\n constructor(game) {\n super(game, null, '__world', false);\n }\n\n /**\n * Initialize the world.\n * This method is called when the game boots and sets up the world.\n */\n boot() {\n this.game.stage.addChild(this);\n }\n}\n","// @ts-nocheck\nimport { Logger } from '@vpmedia/simplify';\nimport { CanvasRenderer } from '../display/canvas/renderer.js';\nimport { addToDOM, create, removeFromDOM, setTouchAction } from '../display/canvas/util.js';\nimport { WebGLRenderer } from '../display/webgl/renderer.js';\nimport { Cache } from './cache.js';\nimport { RENDER_AUTO, RENDER_WEBGL } from './const.js';\nimport { Device } from './device.js';\nimport { checkOS, initialize } from './device_util.js';\nimport { GameObjectFactory } from './factory.js';\nimport { Input } from './input.js';\nimport { Loader } from './loader.js';\nimport { RequestAnimationFrame } from './raf.js';\nimport { ScaleManager } from './scale_manager.js';\nimport { SceneManager } from './scene_manager.js';\nimport { Signal } from './signal.js';\nimport { SoundManager } from './sound_manager.js';\nimport { Stage } from './stage.js';\nimport { Time } from './time.js';\nimport { TweenManager } from './tween_manager.js';\nimport { World } from './world.js';\n\nexport class Game {\n /**\n * Creates a new Game instance.\n * @param {object} gameConfig - The configuration object for the game.\n * @param {number} gameConfig.width - The width of the game canvas (default: 800).\n * @param {number} gameConfig.height - The height of the game canvas (default: 600).\n * @param {string} gameConfig.backgroundColor - The background color of the canvas (default: 0x000000).\n * @param {string} gameConfig.canvasID - The ID of the canvas element (default: '').\n * @param {object} gameConfig.canvasStyle - CSS styles to apply to the canvas.\n * @param {number} gameConfig.resolution - The resolution scale factor (default: 1).\n * @param {boolean} gameConfig.transparent - Whether the canvas should be transparent (default: false).\n * @param {boolean} gameConfig.antialias - Whether to enable antialiasing (default: false).\n * @param {boolean} gameConfig.preserveDrawingBuffer - Whether to preserve the drawing buffer (default: false).\n * @param {boolean} gameConfig.clearBeforeRender - Whether to clear the canvas before rendering (default: true).\n * @param {boolean} gameConfig.roundPixels - Whether to round pixel values (default: true).\n * @param {number} gameConfig.renderType - The rendering type to use (default: RENDER_AUTO).\n * @param {boolean} gameConfig.isForceDisabledAudio - Whether to force disable audio (default: false).\n * @param {number} gameConfig.maxParallelDownloads - Maximum parallel downloads (default: 16).\n * @param {string|HTMLElement} gameConfig.parent - The parent element to append the canvas to.\n * @param {object} gameConfig.state - The initial state object or class.\n */\n constructor(gameConfig = {}) {\n if (!window.PhaserRegistry) {\n window.PhaserRegistry = {};\n }\n this.config = {};\n this.id = 0;\n this.parent = '';\n this.width = 800;\n this.height = 600;\n this.renderer = null;\n this.state = null;\n this.isBooted = false;\n this.paused = false;\n this.raf = null;\n this.add = null;\n this.cache = null;\n this.input = null;\n this.load = null;\n this.scale = null;\n this.sound = null;\n this.stage = null;\n this.time = null;\n this.tweens = null;\n this.world = null;\n this.device = new Device();\n /** @type {Logger} */\n this.logger = null;\n /** @type {HTMLCanvasElement} */\n this.canvas = null;\n /** @type {CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext} */\n this.context = null;\n this.onPause = new Signal();\n this.onResume = new Signal();\n this.onBoot = new Signal();\n this.isPaused = false;\n this.parseConfig(gameConfig);\n checkOS(this.device);\n if (document.readyState === 'complete') {\n initialize(this.device);\n this.boot();\n } else {\n window.addEventListener(\n 'load',\n () => {\n initialize(this.device);\n this.boot();\n },\n false\n );\n }\n }\n\n /**\n * Boots the game and initializes all systems.\n */\n boot() {\n if (this.isBooted) {\n return;\n }\n this.isBooted = true;\n this.scale = new ScaleManager(this, this.config.width, this.config.height);\n this.stage = new Stage(this);\n this.initRenderer();\n this.world = new World(this);\n this.add = new GameObjectFactory(this);\n this.cache = new Cache(this);\n this.load = new Loader(this);\n this.time = new Time(this);\n this.tweens = new TweenManager(this);\n this.input = new Input(this);\n this.sound = new SoundManager(this);\n this.time.boot();\n this.stage.boot();\n this.world.boot();\n this.scale.boot();\n this.input.boot();\n this.sound.boot();\n this.state.boot();\n if (window.focus) {\n window.focus();\n }\n if (!this.config.isSkipTicker) {\n this.raf = new RequestAnimationFrame(this);\n this.raf.start();\n }\n this.onBoot.dispatch(this);\n }\n\n /**\n * Creates the renderer canvas element.\n */\n createRendererCanvas() {\n this.logger.info('createRendererCanvas');\n if (this.canvas) {\n removeFromDOM(this.canvas);\n }\n if (this.config.canvas) {\n this.canvas = this.config.canvas;\n } else {\n this.canvas = create(this, this.width, this.height, this.config.canvasID, true);\n }\n if (this.config.canvasStyle) {\n const properties = Object.keys(this.config.canvasStyle);\n for (const property of properties) {\n this.canvas.style[property] = this.config.canvasStyle[property];\n }\n } else {\n this.canvas.style['-webkit-full-screen'] = 'width: 100%; height: 100%';\n }\n }\n\n /**\n * Initializes the renderer and sets up the rendering context.\n */\n initRenderer() {\n let isWebGlReady = false;\n if (this.config.renderType === RENDER_AUTO || this.config.renderType === RENDER_WEBGL) {\n try {\n this.createRendererCanvas();\n this.logger.info('initWebGLRenderer');\n this.renderer = new WebGLRenderer(this);\n this.context = null;\n this.contextLostBinded = this.contextLost.bind(this);\n this.contextRestoredBinded = this.contextRestored.bind(this);\n this.canvas.addEventListener('webglcontextlost', this.contextLostBinded, false);\n this.canvas.addEventListener('webglcontextrestored', this.contextRestoredBinded, false);\n isWebGlReady = true;\n } catch (error) {\n isWebGlReady = false;\n if (window.PhaserRegistry?.GL_PROGRAM_INFO_LOG) {\n this.logger.warn('WebGL program info', { log: window.PhaserRegistry.GL_PROGRAM_INFO_LOG });\n }\n if (window.PhaserRegistry?.GL_SHADER_INFO_LOG) {\n this.logger.warn('WebGL shader info', { log: window.PhaserRegistry.GL_SHADER_INFO_LOG });\n }\n const typedError = error instanceof Error ? error : new Error(String(error));\n this.logger.exception('Game', typedError);\n }\n }\n if (!isWebGlReady) {\n if (this.contextLostBinded) {\n this.canvas.removeEventListener('webglcontextlost', this.contextLostBinded, false);\n }\n if (this.contextRestoredBinded) {\n this.canvas.removeEventListener('webglcontextlost', this.contextRestoredBinded, false);\n }\n if (this.renderer) {\n this.renderer.destroy();\n }\n this.createRendererCanvas();\n this.logger.info('initCanvasRenderer');\n this.renderer = new CanvasRenderer(this);\n this.context = this.renderer.context;\n }\n this.stage.smoothed = this.config.antialias;\n addToDOM(this.canvas, this.parent, false);\n setTouchAction(this.canvas);\n }\n\n /**\n * Parses a configuration element and sets it on the game config.\n * @param {object} config - The configuration object to parse from.\n * @param {string} key - The configuration key to parse.\n * @param {*} defaultValue - The default value if the key is not found in config.\n */\n parseConfigElement(config, key, defaultValue) {\n if (config[key] !== undefined) {\n this.config[key] = config[key];\n } else {\n this.config[key] = defaultValue;\n }\n }\n\n /**\n * Parses the configuration object and sets up game properties.\n * @param {object} config - The configuration object to parse.\n */\n parseConfig(config) {\n this.logger = config.logger ?? new Logger('phaser');\n this.logger.info('parseConfig');\n this.parseConfigElement(config, 'width', 800);\n this.parseConfigElement(config, 'height', 600);\n this.parseConfigElement(config, 'backgroundColor', 0x000000);\n this.parseConfigElement(config, 'canvasID', '');\n this.parseConfigElement(config, 'canvasStyle', undefined);\n this.parseConfigElement(config, 'resolution', 1);\n this.parseConfigElement(config, 'transparent', false);\n this.parseConfigElement(config, 'antialias', false);\n this.parseConfigElement(config, 'preserveDrawingBuffer', false);\n this.parseConfigElement(config, 'clearBeforeRender', true);\n this.parseConfigElement(config, 'roundPixels', true);\n this.parseConfigElement(config, 'renderType', RENDER_AUTO);\n this.parseConfigElement(config, 'isForceDisabledAudio', false);\n this.parseConfigElement(config, 'maxParallelDownloads', 16);\n if (config.parent) {\n this.parent = config.parent;\n }\n let state = null;\n if (config.state) {\n state = config.state;\n }\n this.state = new SceneManager(this, state);\n }\n\n /**\n * Called when the WebGL context is lost.\n * @param {WebGLContextEvent | Event} event - The WebGL context loss event.\n */\n contextLost(event) {\n this.logger.info('contextLost', event);\n event.preventDefault();\n if (this.renderer) {\n this.renderer.contextLost = true;\n }\n }\n\n /**\n * Called when the WebGL context is restored.\n * @param {WebGLContextEvent | Event} event - The WebGL context restore event.\n */\n contextRestored(event) {\n this.logger.info('contextRestored', event);\n if (this.renderer) {\n this.renderer.initContext(this);\n // this.cache.clearGLTextures();\n this.renderer.contextLost = false;\n }\n }\n\n /**\n * Updates the game state.\n * @param {number} time - The current timestamp.\n */\n update(time) {\n this.time.update(time);\n if (!this.isPaused) {\n this.scale.preUpdate();\n this.state.preUpdate();\n this.stage.preUpdate();\n this.state.update();\n this.stage.update();\n this.tweens.update();\n this.sound.update();\n this.input.update();\n this.stage.postUpdate();\n } else {\n this.scale.pauseUpdate();\n this.state.pauseUpdate();\n }\n this.stage.updateTransform();\n this.renderer.render(this.stage);\n }\n\n /**\n * Destroys the game and cleans up all resources.\n */\n destroy() {\n this.logger.info('destroy');\n this.isPaused = true;\n\n if (!this.cache) {\n return;\n }\n if (this.raf) {\n this.raf.stop();\n }\n\n this.time.destroy();\n this.state.destroy();\n this.sound.destroy();\n this.scale.destroy();\n this.stage.destroy();\n this.input.destroy();\n\n if (this.canvas) {\n if (this.contextLostBinded) {\n this.canvas.removeEventListener('webglcontextlost', this.contextLostBinded, false);\n }\n if (this.contextRestoredBinded) {\n this.canvas.removeEventListener('webglcontextlost', this.contextRestoredBinded, false);\n }\n }\n this.renderer.destroy(false);\n removeFromDOM(this.canvas);\n\n this.cache = null;\n this.load = null;\n this.time = null;\n this.world = null;\n this.state = null;\n this.sound = null;\n this.scale = null;\n this.stage = null;\n this.input = null;\n this.canvas = null;\n this.renderer = null;\n }\n}\n","import { Line } from '../line.js';\nimport { Point } from '../point.js';\nimport { intersects as intersectsRect } from './rectangle.js';\n\n/**\n * Clones a line.\n * @param {Line} input - The line to clone.\n * @param {Line} output - Optional line to store the result in.\n * @returns {Line} The cloned line.\n */\nexport const clone = (input, output = null) => {\n const result = output || new Line();\n result.start.x = input.start.x;\n result.start.y = input.start.y;\n result.end.x = input.end.x;\n result.end.y = input.end.y;\n return result;\n};\n\n/**\n * Gets the intersection point of two lines.\n * @param {object} a - The first line (with x1, y1, x2, y2 properties).\n * @param {object} b - The second line (with x1, y1, x2, y2 properties).\n * @param {object} e - The first endpoint of the first line (with x, y properties).\n * @param {object} f - The second endpoint of the second line (with x, y properties).\n * @param {boolean} asSegment - True if the lines are treated as segments, false if infinite lines.\n * @param {Point} output - Optional point to store the result in.\n * @returns {Point} The intersection point, or null if there is no intersection.\n */\nexport const intersectsPoints = (a, b, e, f, asSegment = true, output = null) => {\n const result = output || new Point();\n const a1 = b.y - a.y;\n const a2 = f.y - e.y;\n const b1 = a.x - b.x;\n const b2 = e.x - f.x;\n const c1 = b.x * a.y - a.x * b.y;\n const c2 = f.x * e.y - e.x * f.y;\n const denom = a1 * b2 - a2 * b1;\n if (denom === 0) {\n return null;\n }\n result.x = (b1 * c2 - b2 * c1) / denom;\n result.y = (a2 * c1 - a1 * c2) / denom;\n if (asSegment) {\n const uc = (f.y - e.y) * (b.x - a.x) - (f.x - e.x) * (b.y - a.y);\n const ua = ((f.x - e.x) * (a.y - e.y) - (f.y - e.y) * (a.x - e.x)) / uc;\n const ub = ((b.x - a.x) * (a.y - e.y) - (b.y - a.y) * (a.x - e.x)) / uc;\n if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {\n return result;\n }\n return null;\n }\n return result;\n};\n\n/**\n * Gets the intersection point of two lines (alternative implementation).\n * @param {object} a - The first line (with x1, y1, x2, y2 properties).\n * @param {object} b - The second line (with x1, y1, x2, y2 properties).\n * @param {boolean} asSegment - True if the lines are treated as segments, false if infinite lines.\n * @param {Point} result - Optional point to store the result in.\n * @returns {Point} The intersection point, or null if there is no intersection.\n */\nexport const intersects = (a, b, asSegment, result) => {\n return intersectsPoints(a.start, a.end, b.start, b.end, asSegment, result);\n};\n\n/**\n * Checks if a line intersects with a rectangle.\n * @param {object} line - The line to check (with x1, y1, x2, y2 properties).\n * @param {object} rect - The rectangle to check (with x, y, width, height properties).\n * @returns {boolean} True if the line intersects with the rectangle, false otherwise.\n */\nexport const intersectsRectangle = (line, rect) => {\n // Quick bail out of the Line and Rect bounds don't intersect\n if (!intersectsRect(line, rect)) {\n return false;\n }\n const x1 = line.start.x;\n const y1 = line.start.y;\n const x2 = line.end.x;\n const y2 = line.end.y;\n const bx1 = rect.x;\n const by1 = rect.y;\n const bx2 = rect.right;\n const by2 = rect.bottom;\n let t = 0;\n // If the start or end of the line is inside the rect then we assume\n // collision, as rects are solid for our use-case.\n if ((x1 >= bx1 && x1 <= bx2 && y1 >= by1 && y1 <= by2) || (x2 >= bx1 && x2 <= bx2 && y2 >= by1 && y2 <= by2)) {\n return true;\n }\n if (x1 < bx1 && x2 >= bx1) {\n // Left edge\n t = y1 + ((y2 - y1) * (bx1 - x1)) / (x2 - x1);\n if (t > by1 && t <= by2) {\n return true;\n }\n } else if (x1 > bx2 && x2 <= bx2) {\n // Right edge\n t = y1 + ((y2 - y1) * (bx2 - x1)) / (x2 - x1);\n if (t >= by1 && t <= by2) {\n return true;\n }\n }\n if (y1 < by1 && y2 >= by1) {\n // Top edge\n t = x1 + ((x2 - x1) * (by1 - y1)) / (y2 - y1);\n if (t >= bx1 && t <= bx2) {\n return true;\n }\n } else if (y1 > by2 && y2 <= by2) {\n // Bottom edge\n t = x1 + ((x2 - x1) * (by2 - y1)) / (y2 - y1);\n if (t >= bx1 && t <= bx2) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * Calculates the distance between two points (line length).\n * @param {object} a - The first point (with x, y properties).\n * @param {object} b - The second point (with x, y properties).\n * @returns {number} The distance between the points.\n */\nexport const reflect = (a, b) => {\n return 2 * b.normalAngle - 3.141592653589793 - a.angle;\n};\n","import { Point } from './point.js';\nimport { clone, intersectsPoints, reflect } from './util/line.js';\nimport { wrap } from '../util/math.js';\nimport { GEOM_LINE } from '../core/const.js';\n\nexport class Line {\n start: Point;\n end: Point;\n type: number;\n\n /**\n * Creates a new Line instance.\n * @param {number} x1 - The x coordinate of the start point (default: 0).\n * @param {number} y1 - The y coordinate of the start point (default: 0).\n * @param {number} x2 - The x coordinate of the end point (default: 0).\n * @param {number} y2 - The y coordinate of the end point (default: 0).\n */\n constructor(x1 = 0, y1 = 0, x2 = 0, y2 = 0) {\n /** @type {Point} */\n this.start = new Point(x1, y1);\n /** @type {Point} */\n this.end = new Point(x2, y2);\n /** @type {number} */\n this.type = GEOM_LINE;\n }\n\n /**\n * Sets the coordinates of this line to new values.\n * @param {number} x1 - The new x coordinate of the start point.\n * @param {number} y1 - The new y coordinate of the start point.\n * @param {number} x2 - The new x coordinate of the end point.\n * @param {number} y2 - The new y coordinate of the end point.\n * @returns {Line} This line instance for chaining.\n */\n setTo(x1, y1, x2, y2) {\n this.start.setTo(x1, y1);\n this.end.setTo(x2, y2);\n return this;\n }\n\n /**\n * Sets the coordinates of this line to match the positions of two sprites.\n * @param {object} startSprite - The starting sprite to get the position from.\n * @param {object} endSprite - The ending sprite to get the position from.\n * @param {boolean} useCenter - Whether to use the center of the sprites (default: false).\n * @returns {Line} This line instance for chaining.\n */\n fromSprite(startSprite, endSprite, useCenter = false) {\n if (useCenter) {\n return this.setTo(startSprite.center.x, startSprite.center.y, endSprite.center.x, endSprite.center.y);\n }\n return this.setTo(startSprite.x, startSprite.y, endSprite.x, endSprite.y);\n }\n\n /**\n * Sets the coordinates of this line to a point at a specific angle and distance.\n * @param {number} x - The x coordinate of the starting point.\n * @param {number} y - The y coordinate of the starting point.\n * @param {number} angle - The angle in radians to set the line at.\n * @param {number} length - The length of the line.\n * @returns {Line} This line instance for chaining.\n */\n fromAngle(x, y, angle, length) {\n this.start.setTo(x, y);\n this.end.setTo(x + Math.cos(angle) * length, y + Math.sin(angle) * length);\n return this;\n }\n\n /**\n * Rotates this line around its center point by the specified angle.\n * @param {number} angle - The angle in radians (or degrees if asDegrees is true) to rotate by.\n * @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false).\n * @returns {Line} This line instance for chaining.\n */\n rotate(angle, asDegrees = false) {\n const cx = (this.start.x + this.end.x) / 2;\n const cy = (this.start.y + this.end.y) / 2;\n this.start.rotate(cx, cy, angle, asDegrees);\n this.end.rotate(cx, cy, angle, asDegrees);\n return this;\n }\n\n /**\n * Rotates this line around a specific point by the specified angle.\n * @param {number} x - The x coordinate of the center point to rotate around.\n * @param {number} y - The y coordinate of the center point to rotate around.\n * @param {number} angle - The angle in radians (or degrees if asDegrees is true) to rotate by.\n * @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false).\n * @returns {Line} This line instance for chaining.\n */\n rotateAround(x, y, angle, asDegrees = false) {\n this.start.rotate(x, y, angle, asDegrees);\n this.end.rotate(x, y, angle, asDegrees);\n return this;\n }\n\n /**\n * Checks if this line intersects with another line.\n * @param {Line} line - The other line to check for intersection with.\n * @param {boolean} asSegment - Whether to treat the lines as segments (default: false).\n * @param {Point} result - The point to store the intersection in (optional).\n * @returns {Point} The intersection point, or null if no intersection occurs.\n */\n intersects(line, asSegment, result) {\n return intersectsPoints(this.start, this.end, line.start, line.end, asSegment, result);\n }\n\n /**\n * Calculates the reflection of this line off another line.\n * @param {Line} line - The line to reflect off.\n * @returns {number} The angle of reflection in radians.\n */\n reflect(line) {\n return reflect(this, line);\n }\n\n /**\n * Returns the midpoint of this line.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} The midpoint of this line.\n */\n midPoint(output = null) {\n const result = output || new Point();\n result.x = (this.start.x + this.end.x) / 2;\n result.y = (this.start.y + this.end.y) / 2;\n return result;\n }\n\n /**\n * Centers this line on the specified point.\n * @param {number} x - The x coordinate to center the line on.\n * @param {number} y - The y coordinate to center the line on.\n */\n centerOn(x, y) {\n const cx = (this.start.x + this.end.x) / 2;\n const cy = (this.start.y + this.end.y) / 2;\n const tx = x - cx;\n const ty = y - cy;\n this.start.add(tx, ty);\n this.end.add(tx, ty);\n }\n\n /**\n * Checks if the specified point lies on this line (not necessarily on the segment).\n * @param {number} x - The x coordinate of the point to check.\n * @param {number} y - The y coordinate of the point to check.\n * @returns {boolean} True if the point lies on this line, false otherwise.\n */\n pointOnLine(x, y) {\n return (x - this.start.x) * (this.end.y - this.start.y) === (this.end.x - this.start.x) * (y - this.start.y);\n }\n\n /**\n * Checks if the specified point lies on this line segment.\n * @param {number} x - The x coordinate of the point to check.\n * @param {number} y - The y coordinate of the point to check.\n * @returns {boolean} True if the point lies on this line segment, false otherwise.\n */\n pointOnSegment(x, y) {\n const xMin = Math.min(this.start.x, this.end.x);\n const xMax = Math.max(this.start.x, this.end.x);\n const yMin = Math.min(this.start.y, this.end.y);\n const yMax = Math.max(this.start.y, this.end.y);\n return this.pointOnLine(x, y) && x >= xMin && x <= xMax && y >= yMin && y <= yMax;\n }\n\n /**\n * Returns a random point on this line.\n * @param {Point} output - The point to store the result in (optional).\n * @returns {Point} A random point on this line.\n */\n random(output = null) {\n const result = output || new Point();\n const t = Math.random();\n result.x = this.start.x + t * (this.end.x - this.start.x);\n result.y = this.start.y + t * (this.end.y - this.start.y);\n return result;\n }\n\n /**\n * Gets coordinates of points along this line at regular intervals.\n * @param {number} stepRate - The interval between points (default: 1).\n * @param {number[][]} results - The array to store the results in (optional).\n * @returns {number[][]} An array of coordinate pairs representing points along this line.\n */\n coordinatesOnLine(stepRate = 1, results = []) {\n let x1 = Math.round(this.start.x);\n let y1 = Math.round(this.start.y);\n const x2 = Math.round(this.end.x);\n const y2 = Math.round(this.end.y);\n const dx = Math.abs(x2 - x1);\n const dy = Math.abs(y2 - y1);\n const sx = x1 < x2 ? 1 : -1;\n const sy = y1 < y2 ? 1 : -1;\n let err = dx - dy;\n results.push([x1, y1]);\n let i = 1;\n while (!(x1 === x2 && y1 === y2)) {\n const e2 = err << 1;\n if (e2 > -dy) {\n err -= dy;\n x1 += sx;\n }\n if (e2 < dx) {\n err += dx;\n y1 += sy;\n }\n if (i % stepRate === 0) {\n results.push([x1, y1]);\n }\n i += 1;\n }\n return results;\n }\n\n /**\n * Creates a clone of this line.\n * @returns {Line} A new line with the same values as this one.\n */\n clone() {\n return clone(this);\n }\n\n /**\n * Gets the length of this line.\n * @returns {number} The length of this line.\n */\n get length() {\n return Math.sqrt(\n (this.end.x - this.start.x) * (this.end.x - this.start.x) +\n (this.end.y - this.start.y) * (this.end.y - this.start.y)\n );\n }\n\n /**\n * Gets the angle of this line in radians.\n * @returns {number} The angle of this line in radians.\n */\n get angle() {\n return Math.atan2(this.end.y - this.start.y, this.end.x - this.start.x);\n }\n\n /**\n * Gets the slope of this line.\n * @returns {number} The slope of this line.\n */\n get slope() {\n return (this.end.y - this.start.y) / (this.end.x - this.start.x);\n }\n\n /**\n * Gets the perpendicular slope of this line.\n * @returns {number} The perpendicular slope of this line.\n */\n get perpSlope() {\n return -((this.end.x - this.start.x) / (this.end.y - this.start.y));\n }\n\n /**\n * Gets the x coordinate of the leftmost point on this line.\n * @returns {number} The x coordinate of the leftmost point on this line.\n */\n get x() {\n return Math.min(this.start.x, this.end.x);\n }\n\n /**\n * Gets the y coordinate of the topmost point on this line.\n * @returns {number} The y coordinate of the topmost point on this line.\n */\n get y() {\n return Math.min(this.start.y, this.end.y);\n }\n\n /**\n * Gets the x coordinate of the leftmost point on this line.\n * @returns {number} The x coordinate of the leftmost point on this line.\n */\n get left() {\n return Math.min(this.start.x, this.end.x);\n }\n\n /**\n * Gets the x coordinate of the rightmost point on this line.\n * @returns {number} The x coordinate of the rightmost point on this line.\n */\n get right() {\n return Math.max(this.start.x, this.end.x);\n }\n\n /**\n * Gets the y coordinate of the topmost point on this line.\n * @returns {number} The y coordinate of the topmost point on this line.\n */\n get top() {\n return Math.min(this.start.y, this.end.y);\n }\n\n /**\n * Gets the y coordinate of the bottommost point on this line.\n * @returns {number} The y coordinate of the bottommost point on this line.\n */\n get bottom() {\n return Math.max(this.start.y, this.end.y);\n }\n\n /**\n * Gets the width of this line (absolute difference between x coordinates).\n * @returns {number} The width of this line.\n */\n get width() {\n return Math.abs(this.start.x - this.end.x);\n }\n\n /**\n * Gets the height of this line (absolute difference between y coordinates).\n * @returns {number} The height of this line.\n */\n get height() {\n return Math.abs(this.start.y - this.end.y);\n }\n\n /**\n * Gets the normal vector x component of this line (perpendicular to the line).\n * @returns {number} The normal vector x component of this line.\n */\n get normalX() {\n return Math.cos(this.angle - 1.5707963267948966);\n }\n\n /**\n * Gets the normal vector y component of this line (perpendicular to the line).\n * @returns {number} The normal vector y component of this line.\n */\n get normalY() {\n return Math.sin(this.angle - 1.5707963267948966);\n }\n\n /**\n * Gets the angle of the normal vector of this line in radians.\n * @returns {number} The angle of the normal vector of this line in radians.\n */\n get normalAngle() {\n return wrap(this.angle - 1.5707963267948966, -Math.PI, Math.PI);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,MAAa,cAAc;;;;AAI3B,MAAa,cAAc;;;;;;;;;;ACqD3B,MAAaG,cAAY,GAAG,GAAG,QAAQ,UAAU;CAC/C,MAAM,KAAK,EAAE,IAAI,EAAE;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