vue-phaserjs 2.38.0 → 2.38.1

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 (226) hide show
  1. package/dist/index.d.ts +10223 -193
  2. package/dist/index.js +1589 -889
  3. package/dist/vue-shims-Bl66Srx_.d.ts +6 -0
  4. package/package.json +22 -8
  5. package/dist/components/Arc.vue.d.ts +0 -285
  6. package/dist/components/BitmapText.vue.d.ts +0 -315
  7. package/dist/components/Circle.vue.d.ts +0 -285
  8. package/dist/components/Container.vue.d.ts +0 -262
  9. package/dist/components/Curve.vue.d.ts +0 -281
  10. package/dist/components/Ellipse.vue.d.ts +0 -283
  11. package/dist/components/Game.vue.d.ts +0 -18
  12. package/dist/components/Graphics.vue.d.ts +0 -257
  13. package/dist/components/Image.vue.d.ts +0 -321
  14. package/dist/components/IsoBox.vue.d.ts +0 -295
  15. package/dist/components/IsoTriangle.vue.d.ts +0 -297
  16. package/dist/components/Line.vue.d.ts +0 -281
  17. package/dist/components/Nineslice.vue.d.ts +0 -290
  18. package/dist/components/Particles.vue.d.ts +0 -263
  19. package/dist/components/PathFollower.vue.d.ts +0 -331
  20. package/dist/components/Polygon.vue.d.ts +0 -279
  21. package/dist/components/Rectangle.vue.d.ts +0 -281
  22. package/dist/components/RenderTexture.vue.d.ts +0 -309
  23. package/dist/components/Scene.vue.d.ts +0 -27
  24. package/dist/components/Sprite.vue.d.ts +0 -322
  25. package/dist/components/Star.vue.d.ts +0 -283
  26. package/dist/components/Text.vue.d.ts +0 -308
  27. package/dist/components/TileSprite.vue.d.ts +0 -16
  28. package/dist/components/Tilemap.vue.d.ts +0 -19
  29. package/dist/components/Triangle.vue.d.ts +0 -279
  30. package/dist/components/Video.vue.d.ts +0 -313
  31. package/dist/components/Zone.vue.d.ts +0 -260
  32. package/dist/components/index.d.ts +0 -28
  33. package/dist/composables/useAnimations.d.ts +0 -45
  34. package/dist/composables/useGame.d.ts +0 -2
  35. package/dist/composables/useInitializeGameObject.d.ts +0 -5
  36. package/dist/composables/useInitializeGameObjectEvents.d.ts +0 -7
  37. package/dist/composables/useInitializeGameObjectSetters.d.ts +0 -7
  38. package/dist/composables/useInjectSceneKey.d.ts +0 -2
  39. package/dist/composables/useTween.d.ts +0 -2
  40. package/dist/hooks/onCreate.d.ts +0 -2
  41. package/dist/hooks/onInit.d.ts +0 -2
  42. package/dist/hooks/onNextTick.d.ts +0 -2
  43. package/dist/hooks/onPreload.d.ts +0 -2
  44. package/dist/hooks/onShutdown.d.ts +0 -2
  45. package/dist/hooks/onUpdate.d.ts +0 -2
  46. package/dist/models/configuration/ArcConfiguration.d.ts +0 -4
  47. package/dist/models/configuration/BitmapTextConfiguration.d.ts +0 -16
  48. package/dist/models/configuration/ContainerConfiguration.d.ts +0 -12
  49. package/dist/models/configuration/CurveConfiguration.d.ts +0 -5
  50. package/dist/models/configuration/EllipseConfiguration.d.ts +0 -4
  51. package/dist/models/configuration/GraphicsConfiguration.d.ts +0 -11
  52. package/dist/models/configuration/ImageConfiguration.d.ts +0 -18
  53. package/dist/models/configuration/IsoBoxConfiguration.d.ts +0 -6
  54. package/dist/models/configuration/IsoTriangleConfiguration.d.ts +0 -6
  55. package/dist/models/configuration/LineConfiguration.d.ts +0 -5
  56. package/dist/models/configuration/NinesliceConfiguration.d.ts +0 -15
  57. package/dist/models/configuration/ParticlesConfiguration.d.ts +0 -14
  58. package/dist/models/configuration/PathFollowerConfiguration.d.ts +0 -19
  59. package/dist/models/configuration/PolygonConfiguration.d.ts +0 -5
  60. package/dist/models/configuration/RectangleConfiguration.d.ts +0 -4
  61. package/dist/models/configuration/RenderTextureConfiguration.d.ts +0 -17
  62. package/dist/models/configuration/SpriteConfiguration.d.ts +0 -19
  63. package/dist/models/configuration/StarConfiguration.d.ts +0 -4
  64. package/dist/models/configuration/TextConfiguration.d.ts +0 -18
  65. package/dist/models/configuration/TileSpriteConfiguration.d.ts +0 -18
  66. package/dist/models/configuration/TriangleConfiguration.d.ts +0 -5
  67. package/dist/models/configuration/VideoConfiguration.d.ts +0 -18
  68. package/dist/models/configuration/ZoneConfiguration.d.ts +0 -12
  69. package/dist/models/configuration/components/AlphaConfiguration.d.ts +0 -4
  70. package/dist/models/configuration/components/AlphaSingleConfiguration.d.ts +0 -4
  71. package/dist/models/configuration/components/BaseTextureConfiguration.d.ts +0 -4
  72. package/dist/models/configuration/components/BlendModeConfiguration.d.ts +0 -4
  73. package/dist/models/configuration/components/ComputedSizeConfiguration.d.ts +0 -4
  74. package/dist/models/configuration/components/DepthConfiguration.d.ts +0 -4
  75. package/dist/models/configuration/components/FlipConfiguration.d.ts +0 -4
  76. package/dist/models/configuration/components/MaskConfiguration.d.ts +0 -4
  77. package/dist/models/configuration/components/OriginConfiguration.d.ts +0 -5
  78. package/dist/models/configuration/components/PathFollowerComponentConfiguration.d.ts +0 -4
  79. package/dist/models/configuration/components/RenderNodesConfiguration.d.ts +0 -4
  80. package/dist/models/configuration/components/ScrollFactorConfiguration.d.ts +0 -5
  81. package/dist/models/configuration/components/SizeConfiguration.d.ts +0 -4
  82. package/dist/models/configuration/components/TextureConfiguration.d.ts +0 -6
  83. package/dist/models/configuration/components/TextureCropConfiguration.d.ts +0 -6
  84. package/dist/models/configuration/components/TintConfiguration.d.ts +0 -4
  85. package/dist/models/configuration/components/TransformConfiguration.d.ts +0 -4
  86. package/dist/models/configuration/components/VisibleConfiguration.d.ts +0 -4
  87. package/dist/models/configuration/global/GameObjectConfiguration.d.ts +0 -3
  88. package/dist/models/configuration/global/GlobalConfiguration.d.ts +0 -4
  89. package/dist/models/configuration/global/TweenConfiguration.d.ts +0 -5
  90. package/dist/models/configuration/shared/AnimationConfiguration.d.ts +0 -6
  91. package/dist/models/configuration/shared/ShapeConfiguration.d.ts +0 -19
  92. package/dist/models/configuration/shared/TweenBuilderConfiguration.d.ts +0 -3
  93. package/dist/models/emit/ArcEventEmitsOptions.d.ts +0 -4
  94. package/dist/models/emit/BitmapTextEventEmitsOptions.d.ts +0 -4
  95. package/dist/models/emit/ContainerEventEmitsOptions.d.ts +0 -4
  96. package/dist/models/emit/CurveEventEmitsOptions.d.ts +0 -4
  97. package/dist/models/emit/EllipseEventEmitsOptions.d.ts +0 -4
  98. package/dist/models/emit/GraphicsEventEmitsOptions.d.ts +0 -4
  99. package/dist/models/emit/ImageEventEmitsOptions.d.ts +0 -4
  100. package/dist/models/emit/IsoBoxEventEmitsOptions.d.ts +0 -4
  101. package/dist/models/emit/IsoTriangleEventEmitsOptions.d.ts +0 -4
  102. package/dist/models/emit/LineEventEmitsOptions.d.ts +0 -4
  103. package/dist/models/emit/NinesliceEventEmitsOptions.d.ts +0 -4
  104. package/dist/models/emit/ParticlesEventEmitsOptions.d.ts +0 -4
  105. package/dist/models/emit/PathFollowerEventEmitsOptions.d.ts +0 -4
  106. package/dist/models/emit/PolygonEventEmitsOptions.d.ts +0 -4
  107. package/dist/models/emit/RectangleEventEmitsOptions.d.ts +0 -4
  108. package/dist/models/emit/RenderTextureEventEmitsOptions.d.ts +0 -4
  109. package/dist/models/emit/SpriteEventEmitsOptions.d.ts +0 -4
  110. package/dist/models/emit/StarEventEmitsOptions.d.ts +0 -4
  111. package/dist/models/emit/TextEventEmitsOptions.d.ts +0 -4
  112. package/dist/models/emit/TileSpriteEventEmitsOptions.d.ts +0 -4
  113. package/dist/models/emit/TriangleEventEmitsOptions.d.ts +0 -4
  114. package/dist/models/emit/VideoEventEmitsOptions.d.ts +0 -4
  115. package/dist/models/emit/ZoneEventEmitsOptions.d.ts +0 -4
  116. package/dist/models/emit/components/AlphaEventEmitsOptions.d.ts +0 -3
  117. package/dist/models/emit/components/AlphaSingleEventEmitsOptions.d.ts +0 -3
  118. package/dist/models/emit/components/BaseTextureEventEmitsOptions.d.ts +0 -3
  119. package/dist/models/emit/components/BlendModeEventEmitsOptions.d.ts +0 -3
  120. package/dist/models/emit/components/ComputedSizeEventEmitsOptions.d.ts +0 -3
  121. package/dist/models/emit/components/DepthEventEmitsOptions.d.ts +0 -3
  122. package/dist/models/emit/components/FlipEventEmitsOptions.d.ts +0 -3
  123. package/dist/models/emit/components/MaskEventEmitsOptions.d.ts +0 -3
  124. package/dist/models/emit/components/OriginEventEmitsOptions.d.ts +0 -3
  125. package/dist/models/emit/components/PathFollowerComponentEventEmitsOptions.d.ts +0 -3
  126. package/dist/models/emit/components/RenderNodesEventEmitsOptions.d.ts +0 -3
  127. package/dist/models/emit/components/ScrollFactorEventEmitsOptions.d.ts +0 -3
  128. package/dist/models/emit/components/SizeEventEmitsOptions.d.ts +0 -3
  129. package/dist/models/emit/components/TextureCropEventEmitsOptions.d.ts +0 -3
  130. package/dist/models/emit/components/TextureEventEmitsOptions.d.ts +0 -3
  131. package/dist/models/emit/components/TintEventEmitsOptions.d.ts +0 -3
  132. package/dist/models/emit/components/TransformEventEmitsOptions.d.ts +0 -3
  133. package/dist/models/emit/components/VisibleEventEmitsOptions.d.ts +0 -3
  134. package/dist/models/emit/global/GameObjectEventEmitsOptions.d.ts +0 -4
  135. package/dist/models/emit/global/GlobalEventEmitsOptions.d.ts +0 -4
  136. package/dist/models/emit/global/TweenEventEmitsOptions.d.ts +0 -3
  137. package/dist/models/emit/shared/GameObjectEventMapEmitsOptions.d.ts +0 -5
  138. package/dist/models/emit/shared/ShapeEventEmitsOptions.d.ts +0 -3
  139. package/dist/models/keys/AnimationKey.d.ts +0 -2
  140. package/dist/models/lifecycle/HookArgs.d.ts +0 -2
  141. package/dist/models/lifecycle/Lifecycle.d.ts +0 -8
  142. package/dist/models/lifecycle/ListenersMap.d.ts +0 -2
  143. package/dist/models/plugins/TiledJSONExternalFile.d.ts +0 -11
  144. package/dist/models/plugins/TilemapFile.d.ts +0 -5
  145. package/dist/models/plugins/TilesetFile.d.ts +0 -7
  146. package/dist/models/scene/SceneLifecycleHooks.d.ts +0 -7
  147. package/dist/models/scene/ScenePlugins.d.ts +0 -2
  148. package/dist/models/scene/SceneProps.d.ts +0 -5
  149. package/dist/models/scene/SceneWithPlugins.d.ts +0 -4
  150. package/dist/models/setterMap/SetterMap.d.ts +0 -4
  151. package/dist/models/text/TextProps.d.ts +0 -6
  152. package/dist/plugins/registerTiledJSONExternalLoader.d.ts +0 -1
  153. package/dist/pushGameObject.d.ts +0 -2
  154. package/dist/store/camera.d.ts +0 -6
  155. package/dist/store/index.d.ts +0 -12
  156. package/dist/store/input.d.ts +0 -3
  157. package/dist/store/scene.d.ts +0 -6
  158. package/dist/store/text.d.ts +0 -4
  159. package/dist/test/setup.d.ts +0 -1
  160. package/dist/test/setupCanvas.d.ts +0 -1
  161. package/dist/util/InjectionKeyMap.d.ts +0 -6
  162. package/dist/util/constants.d.ts +0 -1
  163. package/dist/util/createSceneClass.d.ts +0 -3
  164. package/dist/util/emit/GameObjectEventMap.d.ts +0 -42
  165. package/dist/util/emit/constants.d.ts +0 -1
  166. package/dist/util/emit/getEventName.d.ts +0 -1
  167. package/dist/util/emit/getUpdateEvent.d.ts +0 -3
  168. package/dist/util/emit/isEvent.d.ts +0 -1
  169. package/dist/util/getDepthInsertIndex.d.ts +0 -2
  170. package/dist/util/getScene.d.ts +0 -2
  171. package/dist/util/hooks/getInitializeGameObjectLifecycleHook.d.ts +0 -1
  172. package/dist/util/hooks/pushListener.d.ts +0 -3
  173. package/dist/util/hooks/resetLifecycleListeners.d.ts +0 -3
  174. package/dist/util/hooks/runLifecycleListeners.d.ts +0 -3
  175. package/dist/util/setterMap/ArcSetterMap.d.ts +0 -5
  176. package/dist/util/setterMap/BitmapTextSetterMap.d.ts +0 -5
  177. package/dist/util/setterMap/ContainerSetterMap.d.ts +0 -5
  178. package/dist/util/setterMap/CurveSetterMap.d.ts +0 -5
  179. package/dist/util/setterMap/EllipseSetterMap.d.ts +0 -5
  180. package/dist/util/setterMap/GraphicsSetterMap.d.ts +0 -5
  181. package/dist/util/setterMap/ImageSetterMap.d.ts +0 -5
  182. package/dist/util/setterMap/IsoBoxSetterMap.d.ts +0 -5
  183. package/dist/util/setterMap/IsoTriangleSetterMap.d.ts +0 -5
  184. package/dist/util/setterMap/LineSetterMap.d.ts +0 -5
  185. package/dist/util/setterMap/NinesliceSetterMap.d.ts +0 -5
  186. package/dist/util/setterMap/ParticlesSetterMap.d.ts +0 -5
  187. package/dist/util/setterMap/PathFollowerSetterMap.d.ts +0 -5
  188. package/dist/util/setterMap/PolygonSetterMap.d.ts +0 -5
  189. package/dist/util/setterMap/RectangleSetterMap.d.ts +0 -5
  190. package/dist/util/setterMap/RenderTextureSetterMap.d.ts +0 -5
  191. package/dist/util/setterMap/SpriteSetterMap.d.ts +0 -5
  192. package/dist/util/setterMap/StarSetterMap.d.ts +0 -5
  193. package/dist/util/setterMap/TextSetterMap.d.ts +0 -5
  194. package/dist/util/setterMap/TileSpriteSetterMap.d.ts +0 -5
  195. package/dist/util/setterMap/TriangleSetterMap.d.ts +0 -5
  196. package/dist/util/setterMap/VideoSetterMap.d.ts +0 -5
  197. package/dist/util/setterMap/ZoneSetterMap.d.ts +0 -5
  198. package/dist/util/setterMap/components/AlphaSetterMap.d.ts +0 -8
  199. package/dist/util/setterMap/components/AlphaSingleSetterMap.d.ts +0 -4
  200. package/dist/util/setterMap/components/BaseTextureSetterMap.d.ts +0 -5
  201. package/dist/util/setterMap/components/BlendModeSetterMap.d.ts +0 -4
  202. package/dist/util/setterMap/components/ComputedSizeSetterMap.d.ts +0 -15
  203. package/dist/util/setterMap/components/DepthSetterMap.d.ts +0 -4
  204. package/dist/util/setterMap/components/DisplaySizeSetterMap.d.ts +0 -12
  205. package/dist/util/setterMap/components/FlipSetterMap.d.ts +0 -5
  206. package/dist/util/setterMap/components/MaskSetterMap.d.ts +0 -4
  207. package/dist/util/setterMap/components/OriginSetterMap.d.ts +0 -8
  208. package/dist/util/setterMap/components/PathFollowerComponentSetterMap.d.ts +0 -4
  209. package/dist/util/setterMap/components/RenderNodesSetterMap.d.ts +0 -1
  210. package/dist/util/setterMap/components/ScrollFactorSetterMap.d.ts +0 -6
  211. package/dist/util/setterMap/components/SizeSetterMap.d.ts +0 -15
  212. package/dist/util/setterMap/components/TextureCropSetterMap.d.ts +0 -5
  213. package/dist/util/setterMap/components/TextureSetterMap.d.ts +0 -5
  214. package/dist/util/setterMap/components/TintSetterMap.d.ts +0 -8
  215. package/dist/util/setterMap/components/TransformSetterMap.d.ts +0 -12
  216. package/dist/util/setterMap/components/VisibleSetterMap.d.ts +0 -4
  217. package/dist/util/setterMap/global/GameObjectSetterMap.d.ts +0 -4
  218. package/dist/util/setterMap/global/GlobalSetterMap.d.ts +0 -258
  219. package/dist/util/setterMap/global/TweenSetterMap.d.ts +0 -257
  220. package/dist/util/setterMap/shared/AnimationSetterMap.d.ts +0 -89
  221. package/dist/util/setterMap/shared/IsoSetterMap.d.ts +0 -79
  222. package/dist/util/setterMap/shared/ShapeSetterMap.d.ts +0 -39
  223. package/dist/util/sleep.d.ts +0 -2
  224. package/dist/util/types/EmitsOptionsFor.d.ts +0 -5
  225. package/dist/util/types/ExtractUpdateEvent.d.ts +0 -1
  226. package/dist/util/types/UpdateEvent.d.ts +0 -1
package/dist/index.js CHANGED
@@ -1,592 +1,937 @@
1
- import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, getCurrentInstance as o, inject as s, nextTick as c, onMounted as l, onUnmounted as u, openBlock as d, provide as f, ref as p, renderSlot as m, toValue as h, unref as g, useTemplateRef as _, watch as ee } from "vue";
2
- import { ID_SEPARATOR as v, InvalidOperationError as y, NotFoundError as te, NotInitializedError as b, Operation as x, checkIsPlainObject as ne, takeOne as re, toKebabCase as ie } from "@esposter/shared";
3
- import ae from "phaser4-rex-plugins/plugins/clickoutside.js";
4
- import { Animations as oe, Cameras as S, Game as se, Loader as C, Scene as ce, Scenes as le, Tilemaps as ue, Tweens as de, Utils as fe } from "phaser";
5
- import { defineStore as pe, storeToRefs as w } from "pinia";
6
- import { parseTileset as me, parseXmlString as he } from "parse-tmx";
1
+ import "./vue-shims-Bl66Srx_.d.ts";
2
+ import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, getCurrentInstance, inject, nextTick, onMounted, onUnmounted, openBlock, provide, ref, renderSlot, toValue, useTemplateRef, watch } from "vue";
3
+ import { ID_SEPARATOR, InvalidOperationError, NotFoundError, NotInitializedError, Operation, checkIsPlainObject, takeOne, toKebabCase } from "@esposter/shared";
4
+ import ClickOutside from "phaser4-rex-plugins/plugins/clickoutside.js";
5
+ import { Animations, Cameras, Game, Loader, Scene, Scenes, Tilemaps, Tweens, Utils } from "phaser";
6
+ import { defineStore, storeToRefs } from "pinia";
7
+ import { parseTileset, parseXmlString } from "parse-tmx";
7
8
  //#region src/util/getDepthInsertIndex.ts
8
- var ge = (e, t) => typeof t == "number" ? e.findIndex((e) => "depth" in e && typeof e.depth == "number" && e.depth > t) : -1, _e = (e, t, n) => {
9
- let r = ge(e.list, "depth" in t ? t.depth : void 0);
10
- r === -1 ? e.add(n) : e.addAt(n, r);
11
- }, ve = {
9
+ const getDepthInsertIndex = (list, depth) => typeof depth === "number" ? list.findIndex((gameObject) => "depth" in gameObject && typeof gameObject.depth === "number" && gameObject.depth > depth) : -1;
10
+ //#endregion
11
+ //#region src/pushGameObject.ts
12
+ const pushGameObject = (parentContainer, configuration, gameObject) => {
13
+ const i = getDepthInsertIndex(parentContainer.list, "depth" in configuration ? configuration.depth : void 0);
14
+ if (i === -1) parentContainer.add(gameObject);
15
+ else parentContainer.addAt(gameObject, i);
16
+ };
17
+ //#endregion
18
+ //#region src/util/emit/GameObjectEventMap.ts
19
+ const GameObjectEventMap = {
12
20
  clickoutside: {},
13
- drag: { drag: !0 },
14
- dragend: { drag: !0 },
15
- dragenter: { drag: !0 },
16
- dragleave: { drag: !0 },
17
- dragover: { drag: !0 },
18
- dragstart: { drag: !0 },
19
- drop: { drag: !0 },
21
+ drag: { drag: true },
22
+ dragend: { drag: true },
23
+ dragenter: { drag: true },
24
+ dragleave: { drag: true },
25
+ dragover: { drag: true },
26
+ dragstart: { drag: true },
27
+ drop: { drag: true },
20
28
  pointerdown: { eventIndex: 3 },
21
29
  pointermove: { eventIndex: 3 },
22
30
  pointerout: { eventIndex: 1 },
23
31
  pointerover: { eventIndex: 3 },
24
32
  pointerup: { eventIndex: 3 },
25
33
  wheel: { eventIndex: 4 }
26
- }, ye = "on", be = (e) => {
27
- if (!e.startsWith("on") || e.length <= 2) throw new y(x.Read, be.name, e);
28
- return e.slice(2).toLowerCase();
29
- }, xe = (e) => e.startsWith("on"), Se = () => {
30
- let e = o(), t = new Set(Object.keys(e?.attrs ?? {}).filter((e) => xe(e)).map((e) => be(e))), n = Object.keys(ve).filter((e) => t.has(e)), r = [];
31
- return {
32
- eventStopHandles: r,
33
- initializeGameObjectEvents: (e, t, i) => {
34
- if (n.length !== 0) {
35
- e.input || e.setInteractive(), n.some((e) => "drag" in ve[e]) && i.input.setDraggable(e);
36
- for (let i of n) {
37
- let n = ve[i], a = (...e) => {
38
- "eventIndex" in n && (re(e).stopPropagation = re(e, n.eventIndex).stopPropagation), t(i, ...e);
39
- };
40
- if (i === "clickoutside") {
41
- let t = new ae(e);
42
- t.on(i, a), r.push(() => {
43
- t.off(i, a);
44
- });
45
- continue;
46
- }
47
- e.on(i, a), r.push(() => {
48
- e.off(i, a);
49
- });
50
- }
34
+ };
35
+ //#endregion
36
+ //#region src/util/emit/constants.ts
37
+ const EVENT_PREFIX = "on";
38
+ //#endregion
39
+ //#region src/util/emit/getEventName.ts
40
+ const getEventName = (event) => {
41
+ if (!event.startsWith("on") || event.length <= 2) throw new InvalidOperationError(Operation.Read, getEventName.name, event);
42
+ return event.slice(2).toLowerCase();
43
+ };
44
+ //#endregion
45
+ //#region src/util/emit/isEvent.ts
46
+ const isEvent = (property) => property.startsWith("on");
47
+ //#endregion
48
+ //#region src/composables/useInitializeGameObjectEvents.ts
49
+ const useInitializeGameObjectEvents = () => {
50
+ const currentInstance = getCurrentInstance();
51
+ const events = new Set(Object.keys(currentInstance?.attrs ?? {}).filter((key) => isEvent(key)).map((key) => getEventName(key)));
52
+ const gameObjectEvents = Object.keys(GameObjectEventMap).filter((key) => events.has(key));
53
+ const eventStopHandles = [];
54
+ const initializeGameObjectEvents = (gameObject, emit, scene) => {
55
+ if (gameObjectEvents.length === 0) return;
56
+ if (!gameObject.input) gameObject.setInteractive();
57
+ if (gameObjectEvents.some((key) => "drag" in GameObjectEventMap[key])) scene.input.setDraggable(gameObject);
58
+ for (const gameObjectEvent of gameObjectEvents) {
59
+ const context = GameObjectEventMap[gameObjectEvent];
60
+ const eventListener = (...args) => {
61
+ if ("eventIndex" in context) takeOne(args).stopPropagation = takeOne(args, context.eventIndex).stopPropagation;
62
+ emit(gameObjectEvent, ...args);
63
+ };
64
+ if (gameObjectEvent === "clickoutside") {
65
+ const clickOutside = new ClickOutside(gameObject);
66
+ clickOutside.on(gameObjectEvent, eventListener);
67
+ eventStopHandles.push(() => {
68
+ clickOutside.off(gameObjectEvent, eventListener);
69
+ });
70
+ continue;
51
71
  }
72
+ gameObject.on(gameObjectEvent, eventListener);
73
+ eventStopHandles.push(() => {
74
+ gameObject.off(gameObjectEvent, eventListener);
75
+ });
52
76
  }
53
77
  };
54
- }, T = {
78
+ return {
79
+ eventStopHandles,
80
+ initializeGameObjectEvents
81
+ };
82
+ };
83
+ //#endregion
84
+ //#region src/util/InjectionKeyMap.ts
85
+ const InjectionKeyMap = {
55
86
  ParentContainer: Symbol("ParentContainer"),
56
87
  SceneKey: Symbol("SceneKey")
57
- }, E = () => {
58
- let e = s(T.SceneKey);
59
- if (!e) throw new b(T.SceneKey.description ?? "");
60
- return e;
61
- }, D = /* @__PURE__ */ function(e) {
62
- return e.Create = "Create", e.Init = "Init", e.NextTick = "NextTick", e.Preload = "Preload", e.Shutdown = "Shutdown", e.Update = "Update", e;
63
- }({}), O = {
88
+ };
89
+ //#endregion
90
+ //#region src/composables/useInjectSceneKey.ts
91
+ const useInjectSceneKey = () => {
92
+ const sceneKey = inject(InjectionKeyMap.SceneKey);
93
+ if (!sceneKey) throw new NotInitializedError(InjectionKeyMap.SceneKey.description ?? "");
94
+ return sceneKey;
95
+ };
96
+ //#endregion
97
+ //#region src/models/lifecycle/Lifecycle.ts
98
+ let Lifecycle = /* @__PURE__ */ function(Lifecycle) {
99
+ Lifecycle["Create"] = "Create";
100
+ Lifecycle["Init"] = "Init";
101
+ Lifecycle["NextTick"] = "NextTick";
102
+ Lifecycle["Preload"] = "Preload";
103
+ Lifecycle["Shutdown"] = "Shutdown";
104
+ Lifecycle["Update"] = "Update";
105
+ return Lifecycle;
106
+ }({});
107
+ //#endregion
108
+ //#region src/store/scene.ts
109
+ const ExternalSceneStore = {
64
110
  lifecycleListenersMap: /* @__PURE__ */ new Map(),
65
111
  sceneReadyMap: /* @__PURE__ */ new Map()
66
- }, k = (e, t, n) => {
67
- let r = n ?? E(), i = O.lifecycleListenersMap.get(e);
68
- if (!i) {
69
- O.lifecycleListenersMap.set(e, /* @__PURE__ */ new Map([[r, [t]]]));
112
+ };
113
+ //#endregion
114
+ //#region src/util/hooks/pushListener.ts
115
+ const pushListener = (lifecycle, listener, key) => {
116
+ const sceneKey = key ?? useInjectSceneKey();
117
+ const listenersMap = ExternalSceneStore.lifecycleListenersMap.get(lifecycle);
118
+ if (!listenersMap) {
119
+ ExternalSceneStore.lifecycleListenersMap.set(lifecycle, /* @__PURE__ */ new Map([[sceneKey, [listener]]]));
70
120
  return;
71
121
  }
72
- let a = i.get(r);
73
- a ? a.push(t) : i.set(r, [t]);
74
- }, A = (...e) => {
75
- k(D.NextTick, ...e);
76
- }, Ce = (e) => `update:${ie(e)}`, we = (e, t, n, r, i) => {
77
- let a = E(), o = [], s = [];
78
- for (let [c, l] of Object.entries(h(t))) {
79
- let u = r[c];
80
- if (!u) continue;
81
- let d = Ce(c);
82
- o.push((e) => {
83
- u(e, n)(l), l === void 0 ? c in e && n(d, e[c]) : n(d, l);
84
- }), s.push(ee(() => h(t)[c], (t) => {
85
- let r = () => {
86
- u(h(e), n)(t), n(d, t);
122
+ const listeners = listenersMap.get(sceneKey);
123
+ if (listeners) listeners.push(listener);
124
+ else listenersMap.set(sceneKey, [listener]);
125
+ };
126
+ //#endregion
127
+ //#region src/hooks/onNextTick.ts
128
+ const onNextTick = (...args) => {
129
+ pushListener("NextTick", ...args);
130
+ };
131
+ //#endregion
132
+ //#region src/util/emit/getUpdateEvent.ts
133
+ const getUpdateEvent = (property) => `update:${toKebabCase(property)}`;
134
+ //#endregion
135
+ //#region src/composables/useInitializeGameObjectSetters.ts
136
+ const useInitializeGameObjectSetters = (gameObject, configuration, emit, setterMap, immediate) => {
137
+ const sceneKey = useInjectSceneKey();
138
+ const setters = [];
139
+ const setterWatchHandles = [];
140
+ for (const [key, value] of Object.entries(toValue(configuration))) {
141
+ const setter = setterMap[key];
142
+ if (!setter) continue;
143
+ const updateEvent = getUpdateEvent(key);
144
+ setters.push((targetGameObject) => {
145
+ setter(targetGameObject, emit)(value);
146
+ if (value !== void 0) emit(updateEvent, value);
147
+ else if (key in targetGameObject) emit(updateEvent, targetGameObject[key]);
148
+ });
149
+ setterWatchHandles.push(watch(() => toValue(configuration)[key], (newValue) => {
150
+ const updater = () => {
151
+ setter(toValue(gameObject), emit)(newValue);
152
+ emit(updateEvent, newValue);
87
153
  };
88
- i ? r() : A(() => {
89
- r();
90
- }, a);
91
- }, { deep: !0 }));
154
+ if (immediate) updater();
155
+ else onNextTick(() => {
156
+ updater();
157
+ }, sceneKey);
158
+ }, { deep: true }));
92
159
  }
160
+ const initializeGameObjectSetters = (targetGameObject) => {
161
+ for (const setter of setters) setter(targetGameObject);
162
+ };
93
163
  return {
94
- initializeGameObjectSetters: (e) => {
95
- for (let t of o) t(e);
96
- },
97
- setterWatchHandles: s
164
+ initializeGameObjectSetters,
165
+ setterWatchHandles
98
166
  };
99
- }, j = pe("phaser", () => {
100
- let e, n = t({
101
- get: () => e,
102
- set: (t) => {
103
- e = t;
167
+ };
168
+ //#endregion
169
+ //#region src/store/index.ts
170
+ const usePhaserStore = defineStore("phaser", () => {
171
+ let baseGame;
172
+ const game = computed({
173
+ get: () => baseGame,
174
+ set: (newGame) => {
175
+ baseGame = newGame;
104
176
  }
105
- }), r = p(), i = r, a = (e) => e === r.value, o = async (e) => {
106
- if (a(e)) return;
107
- let t = n.value;
108
- if (!t) throw new b(se.name);
109
- let i = r.value;
110
- r.value = e, await c(), i && t.scene.isActive(i) && t.scene.stop(i), t.scene.start(e);
111
- }, s = p([]), l = p([]);
177
+ });
178
+ const sceneKey = ref();
179
+ const rootSceneKey = sceneKey;
180
+ const isSameScene = (newSceneKey) => newSceneKey === sceneKey.value;
181
+ const switchToScene = async (newSceneKey) => {
182
+ if (isSameScene(newSceneKey)) return;
183
+ const activeGame = game.value;
184
+ if (!activeGame) throw new NotInitializedError(Game.name);
185
+ const oldSceneKey = sceneKey.value;
186
+ sceneKey.value = newSceneKey;
187
+ await nextTick();
188
+ if (oldSceneKey && activeGame.scene.isActive(oldSceneKey)) activeGame.scene.stop(oldSceneKey);
189
+ activeGame.scene.start(newSceneKey);
190
+ };
191
+ const parallelSceneKeys = ref([]);
192
+ const prioritizedParallelSceneKeys = ref([]);
193
+ const launchParallelScene = (scene, targetSceneKey) => {
194
+ if (parallelSceneKeys.value.includes(targetSceneKey)) return;
195
+ scene.scene.bringToTop(targetSceneKey);
196
+ for (const prioritizedParallelSceneKey of prioritizedParallelSceneKeys.value) if (parallelSceneKeys.value.includes(prioritizedParallelSceneKey)) scene.scene.bringToTop(prioritizedParallelSceneKey);
197
+ scene.scene.launch(targetSceneKey);
198
+ parallelSceneKeys.value.push(targetSceneKey);
199
+ };
200
+ const removeParallelScene = (scene, targetSceneKey) => {
201
+ const index = parallelSceneKeys.value.indexOf(targetSceneKey);
202
+ if (index === -1) return;
203
+ const parallelSceneKey = parallelSceneKeys.value[index];
204
+ parallelSceneKeys.value = parallelSceneKeys.value.toSpliced(index, 1);
205
+ scene.scene.stop(parallelSceneKey);
206
+ };
112
207
  return {
113
- game: n,
114
- isSameScene: a,
115
- launchParallelScene: (e, t) => {
116
- if (!s.value.includes(t)) {
117
- e.scene.bringToTop(t);
118
- for (let t of l.value) s.value.includes(t) && e.scene.bringToTop(t);
119
- e.scene.launch(t), s.value.push(t);
120
- }
121
- },
122
- parallelSceneKeys: s,
123
- prioritizedParallelSceneKeys: l,
124
- removeParallelScene: (e, t) => {
125
- let n = s.value.indexOf(t);
126
- if (n === -1) return;
127
- let r = s.value[n];
128
- s.value = s.value.toSpliced(n, 1), e.scene.stop(r);
129
- },
130
- rootSceneKey: i,
131
- switchToScene: o
208
+ game,
209
+ isSameScene,
210
+ launchParallelScene,
211
+ parallelSceneKeys,
212
+ prioritizedParallelSceneKeys,
213
+ removeParallelScene,
214
+ rootSceneKey,
215
+ switchToScene
132
216
  };
133
- }), M = () => {
134
- let e = j(), { game: t } = w(e);
135
- if (!t.value) throw new b(se.name);
136
- return t.value;
137
- }, N = (e) => M().scene.getScene(e), Te = (...e) => {
138
- k(D.Create, ...e);
139
- }, Ee = (e) => O.sceneReadyMap.get(e) ? A : Te, P = (e, t, n, r, i) => {
140
- let a, { initializeGameObjectSetters: o, setterWatchHandles: c } = we(() => a, t, n, r, i), { eventStopHandles: l, initializeGameObjectEvents: d } = Se(), f = s(T.ParentContainer, void 0), p = E(), m = Ee(p), g = (t) => {
141
- a = e(t), o(a), d(a, n, t);
142
- }, _ = () => {
143
- f?.value && _e(f.value, h(t), a);
217
+ });
218
+ //#endregion
219
+ //#region src/composables/useGame.ts
220
+ const useGame = () => {
221
+ const phaserStore = usePhaserStore();
222
+ const { game } = storeToRefs(phaserStore);
223
+ if (!game.value) throw new NotInitializedError(Game.name);
224
+ return game.value;
225
+ };
226
+ //#endregion
227
+ //#region src/util/getScene.ts
228
+ const getScene = (sceneKey) => {
229
+ return useGame().scene.getScene(sceneKey);
230
+ };
231
+ //#endregion
232
+ //#region src/hooks/onCreate.ts
233
+ const onCreate = (...args) => {
234
+ pushListener("Create", ...args);
235
+ };
236
+ //#endregion
237
+ //#region src/util/hooks/getInitializeGameObjectLifecycleHook.ts
238
+ const getInitializeGameObjectLifecycleHook = (sceneKey) => ExternalSceneStore.sceneReadyMap.get(sceneKey) ? onNextTick : onCreate;
239
+ //#endregion
240
+ //#region src/composables/useInitializeGameObject.ts
241
+ const useInitializeGameObject = (create, configuration, emit, setterMap, immediate) => {
242
+ let gameObject;
243
+ const { initializeGameObjectSetters, setterWatchHandles } = useInitializeGameObjectSetters(() => gameObject, configuration, emit, setterMap, immediate);
244
+ const { eventStopHandles, initializeGameObjectEvents } = useInitializeGameObjectEvents();
245
+ const parentContainer = inject(InjectionKeyMap.ParentContainer, void 0);
246
+ const sceneKey = useInjectSceneKey();
247
+ const lifecycleHook = getInitializeGameObjectLifecycleHook(sceneKey);
248
+ const initializeGameObject = (scene) => {
249
+ gameObject = create(scene);
250
+ initializeGameObjectSetters(gameObject);
251
+ initializeGameObjectEvents(gameObject, emit, scene);
144
252
  };
145
- i ? (g(N(p)), m(() => {
146
- _();
147
- })) : m((e) => {
148
- g(e), _();
149
- }), u(() => {
150
- for (let e of c) e();
151
- for (let e of l) e();
152
- a.destroy();
253
+ const pushToParentContainer = () => {
254
+ if (!parentContainer?.value) return;
255
+ pushGameObject(parentContainer.value, toValue(configuration), gameObject);
256
+ };
257
+ if (immediate) {
258
+ initializeGameObject(getScene(sceneKey));
259
+ lifecycleHook(() => {
260
+ pushToParentContainer();
261
+ });
262
+ } else lifecycleHook((scene) => {
263
+ initializeGameObject(scene);
264
+ pushToParentContainer();
153
265
  });
154
- }, De = {
155
- displayHeight: (e) => (t) => {
156
- t !== void 0 && e.setDisplaySize(e.displayWidth, t);
157
- },
158
- displayWidth: (e) => (t) => {
159
- t !== void 0 && e.setDisplaySize(t, e.displayHeight);
266
+ onUnmounted(() => {
267
+ for (const setterWatchHandle of setterWatchHandles) setterWatchHandle();
268
+ for (const eventStopHandle of eventStopHandles) eventStopHandle();
269
+ gameObject.destroy();
270
+ });
271
+ };
272
+ //#endregion
273
+ //#region src/util/setterMap/components/DisplaySizeSetterMap.ts
274
+ const DisplaySizeSetterMap = {
275
+ displayHeight: (gameObject) => (value) => {
276
+ if (value === void 0) return;
277
+ gameObject.setDisplaySize(gameObject.displayWidth, value);
278
+ },
279
+ displayWidth: (gameObject) => (value) => {
280
+ if (value === void 0) return;
281
+ gameObject.setDisplaySize(value, gameObject.displayHeight);
160
282
  }
161
- }, F = {
162
- ...De,
163
- height: (e) => (t) => {
164
- t !== void 0 && e.setSize(e.width, t);
165
- },
166
- width: (e) => (t) => {
167
- t !== void 0 && e.setSize(t, e.height);
283
+ };
284
+ //#endregion
285
+ //#region src/util/setterMap/components/ComputedSizeSetterMap.ts
286
+ const ComputedSizeSetterMap = {
287
+ ...DisplaySizeSetterMap,
288
+ height: (gameObject) => (value) => {
289
+ if (value === void 0) return;
290
+ gameObject.setSize(gameObject.width, value);
291
+ },
292
+ width: (gameObject) => (value) => {
293
+ if (value === void 0) return;
294
+ gameObject.setSize(value, gameObject.height);
168
295
  }
169
- }, I = { depth: (e) => (t) => {
170
- if (t === void 0 || (e.setDepth(t), !e.parentContainer)) return;
171
- let n = ge(e.parentContainer.list, e.depth);
172
- n === -1 ? e.parentContainer.bringToTop(e) : e.parentContainer.moveTo(e, Math.max(n - 1, 0));
173
- } }, L = {
174
- displayOriginX: (e) => (t) => {
175
- e.setDisplayOrigin(t, e.displayOriginY);
296
+ };
297
+ //#endregion
298
+ //#region src/util/setterMap/components/DepthSetterMap.ts
299
+ const DepthSetterMap = { depth: (gameObject) => (value) => {
300
+ if (value === void 0) return;
301
+ gameObject.setDepth(value);
302
+ if (!gameObject.parentContainer) return;
303
+ const i = getDepthInsertIndex(gameObject.parentContainer.list, gameObject.depth);
304
+ if (i === -1) gameObject.parentContainer.bringToTop(gameObject);
305
+ else gameObject.parentContainer.moveTo(gameObject, Math.max(i - 1, 0));
306
+ } };
307
+ //#endregion
308
+ //#region src/util/setterMap/components/OriginSetterMap.ts
309
+ const OriginSetterMap = {
310
+ displayOriginX: (gameObject) => (value) => {
311
+ gameObject.setDisplayOrigin(value, gameObject.displayOriginY);
176
312
  },
177
- displayOriginY: (e) => (t) => {
178
- e.setDisplayOrigin(e.displayOriginX, t);
313
+ displayOriginY: (gameObject) => (value) => {
314
+ gameObject.setDisplayOrigin(gameObject.displayOriginX, value);
179
315
  },
180
- origin: (e) => (t) => {
181
- e.setOrigin(t, t);
316
+ origin: (gameObject) => (value) => {
317
+ gameObject.setOrigin(value, value);
182
318
  },
183
- originX: (e) => (t) => {
184
- e.setOrigin(t, e.originY);
319
+ originX: (gameObject) => (value) => {
320
+ gameObject.setOrigin(value, gameObject.originY);
185
321
  },
186
- originY: (e) => (t) => {
187
- e.setOrigin(e.originX, t);
322
+ originY: (gameObject) => (value) => {
323
+ gameObject.setOrigin(gameObject.originX, value);
188
324
  }
189
- }, R = {
190
- scrollFactor: (e) => (t) => {
191
- t !== void 0 && e.setScrollFactor(t, t);
192
- },
193
- scrollFactorX: (e) => (t) => {
194
- t !== void 0 && e.setScrollFactor(t, e.scrollFactorY);
195
- },
196
- scrollFactorY: (e) => (t) => {
197
- t !== void 0 && e.setScrollFactor(e.scrollFactorX, t);
325
+ };
326
+ //#endregion
327
+ //#region src/util/setterMap/components/ScrollFactorSetterMap.ts
328
+ const ScrollFactorSetterMap = {
329
+ scrollFactor: (gameObject) => (value) => {
330
+ if (value === void 0) return;
331
+ gameObject.setScrollFactor(value, value);
332
+ },
333
+ scrollFactorX: (gameObject) => (value) => {
334
+ if (value === void 0) return;
335
+ gameObject.setScrollFactor(value, gameObject.scrollFactorY);
336
+ },
337
+ scrollFactorY: (gameObject) => (value) => {
338
+ if (value === void 0) return;
339
+ gameObject.setScrollFactor(gameObject.scrollFactorX, value);
198
340
  }
199
- }, z = {
200
- angle: (e) => (t) => {
201
- e.setAngle(t);
341
+ };
342
+ //#endregion
343
+ //#region src/util/setterMap/components/TransformSetterMap.ts
344
+ const TransformSetterMap = {
345
+ angle: (gameObject) => (value) => {
346
+ gameObject.setAngle(value);
202
347
  },
203
- rotation: (e) => (t) => {
204
- e.setRotation(t);
348
+ rotation: (gameObject) => (value) => {
349
+ gameObject.setRotation(value);
205
350
  },
206
- scale: (e) => (t) => {
207
- e.setScale(t, t);
351
+ scale: (gameObject) => (value) => {
352
+ gameObject.setScale(value, value);
208
353
  },
209
- scaleX: (e) => (t) => {
210
- e.setScale(t, e.scaleY);
354
+ scaleX: (gameObject) => (value) => {
355
+ gameObject.setScale(value, gameObject.scaleY);
211
356
  },
212
- scaleY: (e) => (t) => {
213
- e.setScale(e.scaleX, t);
357
+ scaleY: (gameObject) => (value) => {
358
+ gameObject.setScale(gameObject.scaleX, value);
214
359
  },
215
- w: (e) => (t) => {
216
- e.setW(t);
360
+ w: (gameObject) => (value) => {
361
+ gameObject.setW(value);
217
362
  },
218
- x: (e) => (t) => {
219
- e.setX(t);
363
+ x: (gameObject) => (value) => {
364
+ gameObject.setX(value);
220
365
  },
221
- y: (e) => (t) => {
222
- e.setY(t);
366
+ y: (gameObject) => (value) => {
367
+ gameObject.setY(value);
223
368
  },
224
- z: (e) => (t) => {
225
- e.setZ(t);
369
+ z: (gameObject) => (value) => {
370
+ gameObject.setZ(value);
226
371
  }
227
- }, B = { visible: (e) => (t) => {
228
- t !== void 0 && e.setVisible(t);
229
- } }, Oe = { active: (e) => (t) => {
230
- t !== void 0 && e.setActive(t);
231
- } }, ke = {
232
- tween: (e, t) => (n) => {
233
- n && e.scene.add.tween({
234
- ...n,
235
- targets: e
236
- }).on(de.Events.TWEEN_COMPLETE, () => {
237
- t("update:tween", void 0);
372
+ };
373
+ //#endregion
374
+ //#region src/util/setterMap/components/VisibleSetterMap.ts
375
+ const VisibleSetterMap = { visible: (gameObject) => (value) => {
376
+ if (value === void 0) return;
377
+ gameObject.setVisible(value);
378
+ } };
379
+ //#endregion
380
+ //#region src/util/setterMap/global/GameObjectSetterMap.ts
381
+ const GameObjectSetterMap = { active: (gameObject) => (value) => {
382
+ if (value === void 0) return;
383
+ gameObject.setActive(value);
384
+ } };
385
+ //#endregion
386
+ //#region src/util/setterMap/global/TweenSetterMap.ts
387
+ const TweenSetterMap = {
388
+ tween: (gameObject, emit) => (value) => {
389
+ if (!value) return;
390
+ gameObject.scene.add.tween({
391
+ ...value,
392
+ targets: gameObject
393
+ }).on(Tweens.Events.TWEEN_COMPLETE, () => {
394
+ emit("update:tween", void 0);
238
395
  });
239
396
  },
240
- tweenchain: (e, t) => (n) => {
241
- n && e.scene.add.tweenchain(n.map((t) => ({
242
- ...t,
243
- targets: e
244
- }))).on(de.Events.TWEEN_COMPLETE, () => {
245
- t("update:tweenchain", void 0);
397
+ tweenchain: (gameObject, emit) => (value) => {
398
+ if (!value) return;
399
+ gameObject.scene.add.tweenchain(value.map((c) => ({
400
+ ...c,
401
+ targets: gameObject
402
+ }))).on(Tweens.Events.TWEEN_COMPLETE, () => {
403
+ emit("update:tweenchain", void 0);
246
404
  });
247
405
  }
248
- }, V = {
249
- ...ke,
250
- ...Oe
251
- }, Ae = {
252
- ...F,
253
- ...I,
254
- ...L,
255
- ...z,
256
- ...R,
257
- ...B,
258
- ...V
259
- }, je = /* @__PURE__ */ a({
406
+ };
407
+ //#endregion
408
+ //#region src/util/setterMap/global/GlobalSetterMap.ts
409
+ const GlobalSetterMap = {
410
+ ...TweenSetterMap,
411
+ ...GameObjectSetterMap
412
+ };
413
+ //#endregion
414
+ //#region src/util/setterMap/ZoneSetterMap.ts
415
+ const ZoneSetterMap = {
416
+ ...ComputedSizeSetterMap,
417
+ ...DepthSetterMap,
418
+ ...OriginSetterMap,
419
+ ...TransformSetterMap,
420
+ ...ScrollFactorSetterMap,
421
+ ...VisibleSetterMap,
422
+ ...GlobalSetterMap
423
+ };
424
+ //#endregion
425
+ //#region src/components/Zone.vue
426
+ const _sfc_main$26 = /*@__PURE__*/ defineComponent({
260
427
  __name: "Zone",
261
428
  props: { configuration: {} },
262
- setup(e, { emit: t }) {
263
- return P((t) => {
264
- let { height: n, width: r, x: i, y: a } = e.configuration;
265
- return t.add.zone(i, a, r, n);
266
- }, () => e.configuration, t, Ae), (e, t) => null;
429
+ setup(__props, { emit: __emit }) {
430
+ useInitializeGameObject((scene) => {
431
+ const { height, width, x, y } = __props.configuration;
432
+ return scene.add.zone(x, y, width, height);
433
+ }, () => __props.configuration, __emit, ZoneSetterMap);
434
+ return (_ctx, _cache) => {
435
+ return null;
436
+ };
267
437
  }
268
- }), H = {
269
- alpha: (e) => (t) => {
270
- e.setAlpha(t, t, t, t);
438
+ });
439
+ //#endregion
440
+ //#region src/util/setterMap/components/AlphaSetterMap.ts
441
+ const AlphaSetterMap = {
442
+ alpha: (gameObject) => (value) => {
443
+ gameObject.setAlpha(value, value, value, value);
271
444
  },
272
- alphaBottomLeft: (e) => (t) => {
273
- e.setAlpha(e.alphaTopLeft, e.alphaTopRight, t, e.alphaBottomRight);
445
+ alphaBottomLeft: (gameObject) => (value) => {
446
+ gameObject.setAlpha(gameObject.alphaTopLeft, gameObject.alphaTopRight, value, gameObject.alphaBottomRight);
274
447
  },
275
- alphaBottomRight: (e) => (t) => {
276
- e.setAlpha(e.alphaTopLeft, e.alphaTopRight, e.alphaBottomLeft, t);
448
+ alphaBottomRight: (gameObject) => (value) => {
449
+ gameObject.setAlpha(gameObject.alphaTopLeft, gameObject.alphaTopRight, gameObject.alphaBottomLeft, value);
277
450
  },
278
- alphaTopLeft: (e) => (t) => {
279
- e.setAlpha(t, e.alphaTopRight, e.alphaBottomLeft, e.alphaBottomRight);
451
+ alphaTopLeft: (gameObject) => (value) => {
452
+ gameObject.setAlpha(value, gameObject.alphaTopRight, gameObject.alphaBottomLeft, gameObject.alphaBottomRight);
280
453
  },
281
- alphaTopRight: (e) => (t) => {
282
- e.setAlpha(e.alphaTopLeft, t, e.alphaBottomLeft, e.alphaBottomRight);
454
+ alphaTopRight: (gameObject) => (value) => {
455
+ gameObject.setAlpha(gameObject.alphaTopLeft, value, gameObject.alphaBottomLeft, gameObject.alphaBottomRight);
283
456
  }
284
- }, U = { blendMode: (e) => (t) => {
285
- t !== void 0 && e.setBlendMode(t);
286
- } }, W = {
287
- flipX: (e) => (t) => {
288
- t !== void 0 && e.setFlipX(t);
289
- },
290
- flipY: (e) => (t) => {
291
- t !== void 0 && e.setFlipY(t);
457
+ };
458
+ //#endregion
459
+ //#region src/util/setterMap/components/BlendModeSetterMap.ts
460
+ const BlendModeSetterMap = { blendMode: (gameObject) => (value) => {
461
+ if (value === void 0) return;
462
+ gameObject.setBlendMode(value);
463
+ } };
464
+ //#endregion
465
+ //#region src/util/setterMap/components/FlipSetterMap.ts
466
+ const FlipSetterMap = {
467
+ flipX: (gameObject) => (value) => {
468
+ if (value === void 0) return;
469
+ gameObject.setFlipX(value);
470
+ },
471
+ flipY: (gameObject) => (value) => {
472
+ if (value === void 0) return;
473
+ gameObject.setFlipY(value);
292
474
  }
293
- }, G = { mask: (e) => (t) => {
294
- t && e.setMask(t);
295
- } }, K = {}, Me = {
296
- frame: (e) => (t) => {
297
- t !== void 0 && e.setFrame(t);
298
- },
299
- texture: (e) => (t) => {
300
- t && e.setTexture(t);
475
+ };
476
+ //#endregion
477
+ //#region src/util/setterMap/components/MaskSetterMap.ts
478
+ const MaskSetterMap = { mask: (gameObject) => (value) => {
479
+ if (!value) return;
480
+ gameObject.setMask(value);
481
+ } };
482
+ //#endregion
483
+ //#region src/util/setterMap/components/RenderNodesSetterMap.ts
484
+ const RenderNodesSetterMap = {};
485
+ //#endregion
486
+ //#region src/util/setterMap/components/BaseTextureSetterMap.ts
487
+ const BaseTextureSetterMap = {
488
+ frame: (gameObject) => (value) => {
489
+ if (value === void 0) return;
490
+ gameObject.setFrame(value);
491
+ },
492
+ texture: (gameObject) => (value) => {
493
+ if (!value) return;
494
+ gameObject.setTexture(value);
301
495
  }
302
- }, Ne = { ...Me }, q = {
303
- tint: (e) => (t) => {
304
- e.setTint(t, t, t, t);
496
+ };
497
+ //#endregion
498
+ //#region src/util/setterMap/components/TextureCropSetterMap.ts
499
+ const TextureCropSetterMap = { ...BaseTextureSetterMap };
500
+ //#endregion
501
+ //#region src/util/setterMap/components/TintSetterMap.ts
502
+ const TintSetterMap = {
503
+ tint: (gameObject) => (value) => {
504
+ gameObject.setTint(value, value, value, value);
305
505
  },
306
- tintBottomLeft: (e) => (t) => {
307
- e.setTint(e.tintTopLeft, e.tintTopRight, t, e.tintBottomRight);
506
+ tintBottomLeft: (gameObject) => (value) => {
507
+ gameObject.setTint(gameObject.tintTopLeft, gameObject.tintTopRight, value, gameObject.tintBottomRight);
308
508
  },
309
- tintBottomRight: (e) => (t) => {
310
- e.setTint(e.tintTopLeft, e.tintTopRight, e.tintBottomLeft, t);
509
+ tintBottomRight: (gameObject) => (value) => {
510
+ gameObject.setTint(gameObject.tintTopLeft, gameObject.tintTopRight, gameObject.tintBottomLeft, value);
311
511
  },
312
- tintTopLeft: (e) => (t) => {
313
- e.setTint(t, e.tintTopRight, e.tintBottomLeft, e.tintBottomRight);
512
+ tintTopLeft: (gameObject) => (value) => {
513
+ gameObject.setTint(value, gameObject.tintTopRight, gameObject.tintBottomLeft, gameObject.tintBottomRight);
314
514
  },
315
- tintTopRight: (e) => (t) => {
316
- e.setTint(e.tintTopLeft, t, e.tintBottomLeft, e.tintBottomRight);
515
+ tintTopRight: (gameObject) => (value) => {
516
+ gameObject.setTint(gameObject.tintTopLeft, value, gameObject.tintBottomLeft, gameObject.tintBottomRight);
317
517
  }
318
- }, Pe = {
319
- ...H,
320
- ...U,
321
- ...I,
322
- ...W,
323
- ...G,
324
- ...L,
325
- ...K,
326
- ...R,
327
- ...Ne,
328
- ...q,
329
- ...z,
330
- ...B,
331
- ...V,
332
- key: (e) => (t) => {
333
- t && e.changeSource(t);
334
- },
335
- muted: (e) => (t) => {
336
- e.setMute(t);
337
- },
338
- volume: (e) => (t) => {
339
- e.setVolume(t);
518
+ };
519
+ //#endregion
520
+ //#region src/util/setterMap/VideoSetterMap.ts
521
+ const VideoSetterMap = {
522
+ ...AlphaSetterMap,
523
+ ...BlendModeSetterMap,
524
+ ...DepthSetterMap,
525
+ ...FlipSetterMap,
526
+ ...MaskSetterMap,
527
+ ...OriginSetterMap,
528
+ ...RenderNodesSetterMap,
529
+ ...ScrollFactorSetterMap,
530
+ ...TextureCropSetterMap,
531
+ ...TintSetterMap,
532
+ ...TransformSetterMap,
533
+ ...VisibleSetterMap,
534
+ ...GlobalSetterMap,
535
+ key: (gameObject) => (value) => {
536
+ if (!value) return;
537
+ gameObject.changeSource(value);
538
+ },
539
+ muted: (gameObject) => (value) => {
540
+ gameObject.setMute(value);
541
+ },
542
+ volume: (gameObject) => (value) => {
543
+ gameObject.setVolume(value);
340
544
  }
341
- }, Fe = /* @__PURE__ */ a({
545
+ };
546
+ //#endregion
547
+ //#region src/components/Video.vue
548
+ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
342
549
  __name: "Video",
343
550
  props: {
344
551
  configuration: {},
345
552
  immediate: { type: Boolean },
346
553
  onComplete: { type: Function }
347
554
  },
348
- setup(e, { emit: t }) {
349
- return P((t) => {
350
- let { key: n, x: r, y: i } = e.configuration, a = t.add.video(r ?? 0, i ?? 0, n);
351
- return e.onComplete?.(t, a), a;
352
- }, () => e.configuration, t, Pe, e.immediate), (e, t) => null;
555
+ setup(__props, { emit: __emit }) {
556
+ useInitializeGameObject((scene) => {
557
+ const { key, x, y } = __props.configuration;
558
+ const video = scene.add.video(x ?? 0, y ?? 0, key);
559
+ __props.onComplete?.(scene, video);
560
+ return video;
561
+ }, () => __props.configuration, __emit, VideoSetterMap, __props.immediate);
562
+ return (_ctx, _cache) => {
563
+ return null;
564
+ };
353
565
  }
354
- }), J = { alpha: (e) => (t) => {
355
- e.setAlpha(t);
356
- } }, Y = {
357
- ...J,
358
- ...U,
359
- ...I,
360
- ...De,
361
- ...Oe,
362
- ...G,
363
- ...L,
364
- ...K,
365
- ...R,
366
- ...z,
367
- ...B,
368
- fillAlpha: (e) => (t) => {
369
- e.setFillStyle(e.fillColor, t);
370
- },
371
- fillColor: (e) => (t) => {
372
- e.setFillStyle(t, e.fillAlpha);
373
- },
374
- strokeStyle: (e) => (t) => {
375
- t && e.setStrokeStyle(...t);
566
+ });
567
+ //#endregion
568
+ //#region src/util/setterMap/components/AlphaSingleSetterMap.ts
569
+ const AlphaSingleSetterMap = { alpha: (gameObject) => (value) => {
570
+ gameObject.setAlpha(value);
571
+ } };
572
+ //#endregion
573
+ //#region src/util/setterMap/shared/ShapeSetterMap.ts
574
+ const ShapeSetterMap = {
575
+ ...AlphaSingleSetterMap,
576
+ ...BlendModeSetterMap,
577
+ ...DepthSetterMap,
578
+ ...DisplaySizeSetterMap,
579
+ ...GameObjectSetterMap,
580
+ ...MaskSetterMap,
581
+ ...OriginSetterMap,
582
+ ...RenderNodesSetterMap,
583
+ ...ScrollFactorSetterMap,
584
+ ...TransformSetterMap,
585
+ ...VisibleSetterMap,
586
+ fillAlpha: (gameObject) => (value) => {
587
+ gameObject.setFillStyle(gameObject.fillColor, value);
588
+ },
589
+ fillColor: (gameObject) => (value) => {
590
+ gameObject.setFillStyle(value, gameObject.fillAlpha);
591
+ },
592
+ strokeStyle: (gameObject) => (value) => {
593
+ if (!value) return;
594
+ gameObject.setStrokeStyle(...value);
376
595
  }
377
- }, Ie = {
378
- to: (e) => (t) => {
379
- t && e.setTo(...t);
380
- },
381
- ...Y,
382
- ...V
383
- }, Le = /* @__PURE__ */ a({
596
+ };
597
+ //#endregion
598
+ //#region src/util/setterMap/TriangleSetterMap.ts
599
+ const TriangleSetterMap = {
600
+ to: (gameObject) => (value) => {
601
+ if (!value) return;
602
+ gameObject.setTo(...value);
603
+ },
604
+ ...ShapeSetterMap,
605
+ ...GlobalSetterMap
606
+ };
607
+ //#endregion
608
+ //#region src/components/Triangle.vue
609
+ const _sfc_main$24 = /*@__PURE__*/ defineComponent({
384
610
  __name: "Triangle",
385
611
  props: {
386
612
  configuration: {},
387
613
  immediate: { type: Boolean },
388
614
  onComplete: { type: Function }
389
615
  },
390
- setup(e, { emit: t }) {
391
- return P((t) => {
392
- let { alpha: n, fillColor: r, to: i, x: a, y: o } = e.configuration, s = t.add.triangle(a, o, i?.[0], i?.[1], i?.[2], i?.[3], i?.[4], i?.[5], r, n);
393
- return e.onComplete?.(t, s), s;
394
- }, () => e.configuration, t, Ie, e.immediate), (e, t) => null;
616
+ setup(__props, { emit: __emit }) {
617
+ useInitializeGameObject((scene) => {
618
+ const { alpha, fillColor, to, x, y } = __props.configuration;
619
+ const triangle = scene.add.triangle(x, y, to?.[0], to?.[1], to?.[2], to?.[3], to?.[4], to?.[5], fillColor, alpha);
620
+ __props.onComplete?.(scene, triangle);
621
+ return triangle;
622
+ }, () => __props.configuration, __emit, TriangleSetterMap, __props.immediate);
623
+ return (_ctx, _cache) => {
624
+ return null;
625
+ };
395
626
  }
396
- }), X = { ...Me }, Re = {
397
- ...H,
398
- ...U,
399
- ...F,
400
- ...I,
401
- ...W,
402
- ...G,
403
- ...L,
404
- ...K,
405
- ...R,
406
- ...X,
407
- ...q,
408
- ...z,
409
- ...B,
410
- ...V
411
- }, ze = /* @__PURE__ */ a({
627
+ });
628
+ //#endregion
629
+ //#region src/util/setterMap/components/TextureSetterMap.ts
630
+ const TextureSetterMap = { ...BaseTextureSetterMap };
631
+ //#endregion
632
+ //#region src/util/setterMap/TileSpriteSetterMap.ts
633
+ const TileSpriteSetterMap = {
634
+ ...AlphaSetterMap,
635
+ ...BlendModeSetterMap,
636
+ ...ComputedSizeSetterMap,
637
+ ...DepthSetterMap,
638
+ ...FlipSetterMap,
639
+ ...MaskSetterMap,
640
+ ...OriginSetterMap,
641
+ ...RenderNodesSetterMap,
642
+ ...ScrollFactorSetterMap,
643
+ ...TextureSetterMap,
644
+ ...TintSetterMap,
645
+ ...TransformSetterMap,
646
+ ...VisibleSetterMap,
647
+ ...GlobalSetterMap
648
+ };
649
+ //#endregion
650
+ //#region src/components/TileSprite.vue
651
+ const _sfc_main$22 = /*@__PURE__*/ defineComponent({
412
652
  __name: "TileSprite",
413
653
  props: {
414
654
  configuration: {},
415
655
  immediate: { type: Boolean },
416
656
  onComplete: { type: Function }
417
657
  },
418
- setup(e, { emit: t }) {
419
- return P((t) => {
420
- let { frame: n, height: r, texture: i, width: a, x: o, y: s } = e.configuration, c = t.add.tileSprite(o ?? 0, s ?? 0, a ?? 0, r ?? 0, i, n);
421
- return e.onComplete?.(t, c), c;
422
- }, () => e.configuration, t, Re, e.immediate), (e, t) => null;
658
+ setup(__props, { emit: __emit }) {
659
+ useInitializeGameObject((scene) => {
660
+ const { frame, height, texture, width, x, y } = __props.configuration;
661
+ const tileSprite = scene.add.tileSprite(x ?? 0, y ?? 0, width ?? 0, height ?? 0, texture, frame);
662
+ __props.onComplete?.(scene, tileSprite);
663
+ return tileSprite;
664
+ }, () => __props.configuration, __emit, TileSpriteSetterMap, __props.immediate);
665
+ return (_ctx, _cache) => {
666
+ return null;
667
+ };
423
668
  }
424
- }), Be = /* @__PURE__ */ a({
669
+ });
670
+ //#endregion
671
+ //#region src/components/Tilemap.vue
672
+ const _sfc_main$23 = /*@__PURE__*/ defineComponent({
425
673
  __name: "Tilemap",
426
674
  props: {
427
675
  configuration: {},
428
676
  onComplete: { type: Function }
429
677
  },
430
- setup(e) {
431
- let t = E(), n = p();
432
- return Te((t) => {
433
- n.value = t.make.tilemap(e.configuration), e.onComplete?.(t, n.value);
434
- }), ee(() => e.configuration.key, (r) => {
435
- let i = N(t), a = n.value;
436
- r ? (n.value = i.make.tilemap(e.configuration), e.onComplete?.(i, n.value)) : n.value = void 0, a && a.destroy();
437
- }), u(() => {
438
- n.value && n.value.destroy();
439
- }), (e, t) => m(e.$slots, "default");
678
+ setup(__props) {
679
+ const sceneKey = useInjectSceneKey();
680
+ const tilemap = ref();
681
+ onCreate((newScene) => {
682
+ tilemap.value = newScene.make.tilemap(__props.configuration);
683
+ __props.onComplete?.(newScene, tilemap.value);
684
+ });
685
+ watch(() => __props.configuration.key, (newKey) => {
686
+ const scene = getScene(sceneKey);
687
+ const oldTilemap = tilemap.value;
688
+ if (newKey) {
689
+ tilemap.value = scene.make.tilemap(__props.configuration);
690
+ __props.onComplete?.(scene, tilemap.value);
691
+ } else tilemap.value = void 0;
692
+ if (oldTilemap) oldTilemap.destroy();
693
+ });
694
+ onUnmounted(() => {
695
+ if (!tilemap.value) return;
696
+ tilemap.value.destroy();
697
+ });
698
+ return (_ctx, _cache) => {
699
+ return renderSlot(_ctx.$slots, "default");
700
+ };
440
701
  }
441
- }), Ve = pe("phaser/text", () => ({ defaultTextStyle: p() })), He = {
442
- padding: (e) => (t) => {
443
- t && e.setPadding(t);
444
- },
445
- style: (e) => (t) => {
446
- t && e.setStyle(t);
447
- },
448
- text: (e, t) => (n) => {
449
- n !== void 0 && (e.setText(n), t("update:width", e.width), t("update:displayWidth", e.displayWidth));
450
- },
451
- ...H,
452
- ...U,
453
- ...F,
454
- ...I,
455
- ...W,
456
- ...G,
457
- ...L,
458
- ...K,
459
- ...R,
460
- ...q,
461
- ...z,
462
- ...B,
463
- ...V
464
- }, Ue = /* @__PURE__ */ a({
702
+ });
703
+ //#endregion
704
+ //#region src/store/text.ts
705
+ const useTextStore = defineStore("phaser/text", () => {
706
+ return { defaultTextStyle: ref() };
707
+ });
708
+ //#endregion
709
+ //#region src/util/setterMap/TextSetterMap.ts
710
+ const TextSetterMap = {
711
+ padding: (gameObject) => (value) => {
712
+ if (!value) return;
713
+ gameObject.setPadding(value);
714
+ },
715
+ style: (gameObject) => (value) => {
716
+ if (!value) return;
717
+ gameObject.setStyle(value);
718
+ },
719
+ text: (gameObject, emit) => (value) => {
720
+ if (value === void 0) return;
721
+ gameObject.setText(value);
722
+ emit("update:width", gameObject.width);
723
+ emit("update:displayWidth", gameObject.displayWidth);
724
+ },
725
+ ...AlphaSetterMap,
726
+ ...BlendModeSetterMap,
727
+ ...ComputedSizeSetterMap,
728
+ ...DepthSetterMap,
729
+ ...FlipSetterMap,
730
+ ...MaskSetterMap,
731
+ ...OriginSetterMap,
732
+ ...RenderNodesSetterMap,
733
+ ...ScrollFactorSetterMap,
734
+ ...TintSetterMap,
735
+ ...TransformSetterMap,
736
+ ...VisibleSetterMap,
737
+ ...GlobalSetterMap
738
+ };
739
+ //#endregion
740
+ //#region src/components/Text.vue
741
+ const _sfc_main$21 = /*@__PURE__*/ defineComponent({
465
742
  __name: "Text",
466
743
  props: {
467
744
  configuration: {},
468
745
  immediate: { type: Boolean }
469
746
  },
470
- setup(e, { emit: t }) {
471
- let n = t, r = Ve(), { defaultTextStyle: i } = w(r);
472
- return P((t) => {
473
- let { style: n, text: r, x: a, y: o } = e.configuration;
474
- return t.add.text(a ?? 0, o ?? 0, r, {
475
- ...i.value,
476
- ...n
747
+ setup(__props, { emit: __emit }) {
748
+ const emit = __emit;
749
+ const textStore = useTextStore();
750
+ const { defaultTextStyle } = storeToRefs(textStore);
751
+ useInitializeGameObject((scene) => {
752
+ const { style, text, x, y } = __props.configuration;
753
+ return scene.add.text(x ?? 0, y ?? 0, text, {
754
+ ...defaultTextStyle.value,
755
+ ...style
477
756
  });
478
- }, () => e.configuration, n, He, e.immediate), (e, t) => null;
757
+ }, () => __props.configuration, emit, TextSetterMap, __props.immediate);
758
+ return (_ctx, _cache) => {
759
+ return null;
760
+ };
479
761
  }
480
- }), We = {
481
- innerRadius: (e) => (t) => {
482
- t !== void 0 && e.setInnerRadius(t);
483
- },
484
- outerRadius: (e) => (t) => {
485
- t !== void 0 && e.setOuterRadius(t);
486
- },
487
- points: (e) => (t) => {
488
- t !== void 0 && e.setPoints(t);
489
- },
490
- ...Y,
491
- ...V
492
- }, Ge = /* @__PURE__ */ a({
762
+ });
763
+ //#endregion
764
+ //#region src/util/setterMap/StarSetterMap.ts
765
+ const StarSetterMap = {
766
+ innerRadius: (gameObject) => (value) => {
767
+ if (value === void 0) return;
768
+ gameObject.setInnerRadius(value);
769
+ },
770
+ outerRadius: (gameObject) => (value) => {
771
+ if (value === void 0) return;
772
+ gameObject.setOuterRadius(value);
773
+ },
774
+ points: (gameObject) => (value) => {
775
+ if (value === void 0) return;
776
+ gameObject.setPoints(value);
777
+ },
778
+ ...ShapeSetterMap,
779
+ ...GlobalSetterMap
780
+ };
781
+ //#endregion
782
+ //#region src/components/Star.vue
783
+ const _sfc_main$20 = /*@__PURE__*/ defineComponent({
493
784
  __name: "Star",
494
785
  props: {
495
786
  configuration: {},
496
787
  immediate: { type: Boolean },
497
788
  onComplete: { type: Function }
498
789
  },
499
- setup(e, { emit: t }) {
500
- return P((t) => {
501
- let { alpha: n, fillColor: r, innerRadius: i, outerRadius: a, points: o, x: s, y: c } = e.configuration, l = t.add.star(s, c, o, i, a, r, n);
502
- return e.onComplete?.(t, l), l;
503
- }, () => e.configuration, t, We, e.immediate), (e, t) => null;
790
+ setup(__props, { emit: __emit }) {
791
+ useInitializeGameObject((scene) => {
792
+ const { alpha, fillColor, innerRadius, outerRadius, points, x, y } = __props.configuration;
793
+ const star = scene.add.star(x, y, points, innerRadius, outerRadius, fillColor, alpha);
794
+ __props.onComplete?.(scene, star);
795
+ return star;
796
+ }, () => __props.configuration, __emit, StarSetterMap, __props.immediate);
797
+ return (_ctx, _cache) => {
798
+ return null;
799
+ };
504
800
  }
505
- }), Z = { ...F }, Ke = {
506
- animations: (e, t) => (n) => {
507
- if (n && n.length > 0) for (let r of n) {
508
- if (!r.key) continue;
509
- let n = `${oe.Events.ANIMATION_COMPLETE_KEY}${r.key}`;
510
- if (e.once(n, () => {
511
- t(n);
512
- }), !e.scene.anims.exists(r.key) && !e.scene.anims.create(r)) throw new y(x.Create, "Animation", r.key);
801
+ });
802
+ //#endregion
803
+ //#region src/util/setterMap/components/SizeSetterMap.ts
804
+ const SizeSetterMap = { ...ComputedSizeSetterMap };
805
+ //#endregion
806
+ //#region src/util/setterMap/shared/AnimationSetterMap.ts
807
+ const AnimationSetterMap = {
808
+ animations: (gameObject, emit) => (configurations) => {
809
+ if (!(configurations && configurations.length > 0)) return;
810
+ for (const configuration of configurations) {
811
+ if (!configuration.key) continue;
812
+ const event = `${Animations.Events.ANIMATION_COMPLETE_KEY}${configuration.key}`;
813
+ gameObject.once(event, () => {
814
+ emit(event);
815
+ });
816
+ if (gameObject.scene.anims.exists(configuration.key)) continue;
817
+ else if (!gameObject.scene.anims.create(configuration)) throw new InvalidOperationError(Operation.Create, "Animation", configuration.key);
513
818
  }
514
819
  },
515
- playAnimationKey: (e) => (t) => {
516
- if (t === void 0) {
517
- e.stop();
820
+ playAnimationKey: (gameObject) => (value) => {
821
+ if (value === void 0) {
822
+ gameObject.stop();
518
823
  return;
519
824
  }
520
- e.play(t);
825
+ gameObject.play(value);
521
826
  }
522
- }, qe = {
523
- ...H,
524
- ...U,
525
- ...I,
526
- ...W,
527
- ...G,
528
- ...L,
529
- ...K,
530
- ...R,
531
- ...Z,
532
- ...X,
533
- ...q,
534
- ...z,
535
- ...B,
536
- ...Ke,
537
- ...V
538
- }, Je = /* @__PURE__ */ a({
827
+ };
828
+ //#endregion
829
+ //#region src/util/setterMap/SpriteSetterMap.ts
830
+ const SpriteSetterMap = {
831
+ ...AlphaSetterMap,
832
+ ...BlendModeSetterMap,
833
+ ...DepthSetterMap,
834
+ ...FlipSetterMap,
835
+ ...MaskSetterMap,
836
+ ...OriginSetterMap,
837
+ ...RenderNodesSetterMap,
838
+ ...ScrollFactorSetterMap,
839
+ ...SizeSetterMap,
840
+ ...TextureSetterMap,
841
+ ...TintSetterMap,
842
+ ...TransformSetterMap,
843
+ ...VisibleSetterMap,
844
+ ...AnimationSetterMap,
845
+ ...GlobalSetterMap
846
+ };
847
+ //#endregion
848
+ //#region src/components/Sprite.vue
849
+ const _sfc_main$19 = /*@__PURE__*/ defineComponent({
539
850
  __name: "Sprite",
540
851
  props: {
541
852
  configuration: {},
542
853
  immediate: { type: Boolean },
543
854
  onComplete: { type: Function }
544
855
  },
545
- setup(e, { emit: t }) {
546
- return P((t) => {
547
- let { frame: n, texture: r, x: i, y: a } = e.configuration, o = t.add.sprite(i ?? 0, a ?? 0, r, n);
548
- return e.onComplete?.(t, o), o;
549
- }, () => e.configuration, t, qe, e.immediate), (e, t) => null;
856
+ setup(__props, { emit: __emit }) {
857
+ useInitializeGameObject((scene) => {
858
+ const { frame, texture, x, y } = __props.configuration;
859
+ const sprite = scene.add.sprite(x ?? 0, y ?? 0, texture, frame);
860
+ __props.onComplete?.(scene, sprite);
861
+ return sprite;
862
+ }, () => __props.configuration, __emit, SpriteSetterMap, __props.immediate);
863
+ return (_ctx, _cache) => {
864
+ return null;
865
+ };
550
866
  }
551
- }), Ye = pe("phaser/camera", () => {
552
- let e = p(!1);
867
+ });
868
+ //#endregion
869
+ //#region src/store/camera.ts
870
+ const useCameraStore = defineStore("phaser/camera", () => {
871
+ const isFading = ref(false);
872
+ const fadeIn = (scene, ...args) => {
873
+ isFading.value = true;
874
+ scene.cameras.main.fadeIn(...args);
875
+ };
876
+ const fadeOut = (scene, ...args) => {
877
+ isFading.value = true;
878
+ scene.cameras.main.fadeOut(...args);
879
+ };
553
880
  return {
554
- fadeIn: (t, ...n) => {
555
- e.value = !0, t.cameras.main.fadeIn(...n);
556
- },
557
- fadeOut: (t, ...n) => {
558
- e.value = !0, t.cameras.main.fadeOut(...n);
559
- },
560
- isFading: e
881
+ fadeIn,
882
+ fadeOut,
883
+ isFading
561
884
  };
562
- }), Xe = pe("phaser/input", () => ({ isInputActive: p(!1) })), Ze = (e, t) => {
563
- let n = O.lifecycleListenersMap.get(t);
564
- n?.has(e.scene.key) && n.set(e.scene.key, []);
565
- }, Q = (e, t, n = !0) => {
566
- let r = O.lifecycleListenersMap.get(t);
567
- if (!r) return;
568
- let i = r.get(e.scene.key);
569
- if (i) {
570
- for (let t of i) t(e);
571
- n && Ze(e, t);
572
- }
573
- }, Qe = (e, t = {}) => class extends ce {
885
+ });
886
+ //#endregion
887
+ //#region src/store/input.ts
888
+ const useInputStore = defineStore("phaser/input", () => {
889
+ return { isInputActive: ref(false) };
890
+ });
891
+ //#endregion
892
+ //#region src/util/hooks/resetLifecycleListeners.ts
893
+ const resetLifecycleListeners = (scene, lifecycle) => {
894
+ const listenersMap = ExternalSceneStore.lifecycleListenersMap.get(lifecycle);
895
+ if (!listenersMap?.has(scene.scene.key)) return;
896
+ listenersMap.set(scene.scene.key, []);
897
+ };
898
+ //#endregion
899
+ //#region src/util/hooks/runLifecycleListeners.ts
900
+ const runLifecycleListeners = (scene, lifecycle, isReset = true) => {
901
+ const listenersMap = ExternalSceneStore.lifecycleListenersMap.get(lifecycle);
902
+ if (!listenersMap) return;
903
+ const listeners = listenersMap.get(scene.scene.key);
904
+ if (!listeners) return;
905
+ for (const listener of listeners) listener(scene);
906
+ if (isReset) resetLifecycleListeners(scene, lifecycle);
907
+ };
908
+ //#endregion
909
+ //#region src/util/createSceneClass.ts
910
+ const createSceneClass = (key, hooks = {}) => class extends Scene {
574
911
  constructor() {
575
- super({ key: e });
912
+ super({ key });
576
913
  }
577
914
  create() {
578
- t.onCreate?.(this), Q(this, D.Create);
915
+ hooks.onCreate?.(this);
916
+ runLifecycleListeners(this, "Create");
579
917
  }
580
918
  init() {
581
- t.onInit?.(this), Q(this, D.Init);
919
+ hooks.onInit?.(this);
920
+ runLifecycleListeners(this, "Init");
582
921
  }
583
922
  preload() {
584
- t.onPreload?.(this), Q(this, D.Preload);
923
+ hooks.onPreload?.(this);
924
+ runLifecycleListeners(this, "Preload");
585
925
  }
586
- update(e, n) {
587
- t.onUpdate?.(this, e, n), Q(this, D.Update, !1), Q(this, D.NextTick);
926
+ update(time, delta) {
927
+ hooks.onUpdate?.(this, time, delta);
928
+ runLifecycleListeners(this, "Update", false);
929
+ runLifecycleListeners(this, "NextTick");
588
930
  }
589
- }, $e = /* @__PURE__ */ a({
931
+ };
932
+ //#endregion
933
+ //#region src/components/Scene.vue
934
+ const _sfc_main$18 = /*@__PURE__*/ defineComponent({
590
935
  __name: "Scene",
591
936
  props: {
592
937
  autoStart: { type: Boolean },
@@ -599,581 +944,936 @@ var ge = (e, t) => typeof t == "number" ? e.findIndex((e) => "depth" in e && typ
599
944
  "shutdown",
600
945
  "update"
601
946
  ],
602
- setup(e, { emit: r }) {
603
- let i = r, a = j(), { isSameScene: o, switchToScene: s } = a, c = Ye(), { isFading: d } = w(c), p = Xe(), { isInputActive: h } = w(p), { parallelSceneKeys: _ } = w(a), ee = t(() => o(e.sceneKey) || _.value.includes(e.sceneKey)), v = () => {
604
- h.value = !1;
605
- }, y = () => {
606
- d.value = !1, h.value = !0;
607
- }, te = () => {
608
- d.value = !1;
609
- }, b = Qe(e.sceneKey, {
610
- onCreate: (e) => {
611
- i("create", e), e.cameras.main.on(S.Scene2D.Events.FADE_IN_START, v), e.cameras.main.on(S.Scene2D.Events.FADE_IN_COMPLETE, y), e.cameras.main.on(S.Scene2D.Events.FADE_OUT_START, v), e.cameras.main.on(S.Scene2D.Events.FADE_OUT_COMPLETE, te), h.value = !0;
947
+ setup(__props, { emit: __emit }) {
948
+ const emit = __emit;
949
+ const phaserStore = usePhaserStore();
950
+ const { isSameScene, switchToScene } = phaserStore;
951
+ const cameraStore = useCameraStore();
952
+ const { isFading } = storeToRefs(cameraStore);
953
+ const inputStore = useInputStore();
954
+ const { isInputActive } = storeToRefs(inputStore);
955
+ const { parallelSceneKeys } = storeToRefs(phaserStore);
956
+ const isActive = computed(() => isSameScene(__props.sceneKey) || parallelSceneKeys.value.includes(__props.sceneKey));
957
+ const fadeStartListener = () => {
958
+ isInputActive.value = false;
959
+ };
960
+ const fadeInCompleteListener = () => {
961
+ isFading.value = false;
962
+ isInputActive.value = true;
963
+ };
964
+ const fadeOutCompleteListener = () => {
965
+ isFading.value = false;
966
+ };
967
+ const NewScene = createSceneClass(__props.sceneKey, {
968
+ onCreate: (scene) => {
969
+ emit("create", scene);
970
+ scene.cameras.main.on(Cameras.Scene2D.Events.FADE_IN_START, fadeStartListener);
971
+ scene.cameras.main.on(Cameras.Scene2D.Events.FADE_IN_COMPLETE, fadeInCompleteListener);
972
+ scene.cameras.main.on(Cameras.Scene2D.Events.FADE_OUT_START, fadeStartListener);
973
+ scene.cameras.main.on(Cameras.Scene2D.Events.FADE_OUT_COMPLETE, fadeOutCompleteListener);
974
+ isInputActive.value = true;
612
975
  },
613
- onInit: (e) => i("init", e),
614
- onPreload: (e) => i("preload", e),
615
- onUpdate: (e, t, n) => i("update", e, t, n)
616
- }), x = () => {
617
- O.sceneReadyMap.set(e.sceneKey, !0);
618
- }, ne = () => {
619
- let t = N(e.sceneKey);
620
- Ze(t, D.Update), Ze(t, D.NextTick), Q(t, D.Shutdown), t.cameras.main.off(S.Scene2D.Events.FADE_IN_START, v), t.cameras.main.off(S.Scene2D.Events.FADE_IN_COMPLETE, y), t.cameras.main.off(S.Scene2D.Events.FADE_OUT_START, v), t.cameras.main.off(S.Scene2D.Events.FADE_OUT_COMPLETE, te), O.sceneReadyMap.set(e.sceneKey, !1), i("shutdown", t);
976
+ onInit: (scene) => emit("init", scene),
977
+ onPreload: (scene) => emit("preload", scene),
978
+ onUpdate: (scene, time, delta) => emit("update", scene, time, delta)
979
+ });
980
+ const readyListener = () => {
981
+ ExternalSceneStore.sceneReadyMap.set(__props.sceneKey, true);
982
+ };
983
+ const shutdownListener = () => {
984
+ const scene = getScene(__props.sceneKey);
985
+ resetLifecycleListeners(scene, "Update");
986
+ resetLifecycleListeners(scene, "NextTick");
987
+ runLifecycleListeners(scene, "Shutdown");
988
+ scene.cameras.main.off(Cameras.Scene2D.Events.FADE_IN_START, fadeStartListener);
989
+ scene.cameras.main.off(Cameras.Scene2D.Events.FADE_IN_COMPLETE, fadeInCompleteListener);
990
+ scene.cameras.main.off(Cameras.Scene2D.Events.FADE_OUT_START, fadeStartListener);
991
+ scene.cameras.main.off(Cameras.Scene2D.Events.FADE_OUT_COMPLETE, fadeOutCompleteListener);
992
+ ExternalSceneStore.sceneReadyMap.set(__props.sceneKey, false);
993
+ emit("shutdown", scene);
621
994
  };
622
- return l(async () => {
623
- let t = M().scene.add(e.sceneKey, b);
624
- if (!t) {
625
- console.error(`Failed to add scene: ${e.sceneKey}`);
995
+ onMounted(async () => {
996
+ const scene = useGame().scene.add(__props.sceneKey, NewScene);
997
+ if (!scene) {
998
+ console.error(`Failed to add scene: ${__props.sceneKey}`);
626
999
  return;
627
1000
  }
628
- t.events.on(le.Events.READY, x), t.events.on(le.Events.SHUTDOWN, ne), e.autoStart && await s(e.sceneKey);
629
- }), u(() => {
630
- let t = M(), n = N(e.sceneKey);
631
- n.events.off(le.Events.READY, x), n.events.off(le.Events.SHUTDOWN, ne), t.scene.remove(e.sceneKey);
632
- }), f(T.SceneKey, e.sceneKey), (e, t) => g(ee) ? m(e.$slots, "default", {}, void 0, void 0, 0) : n("", !0);
1001
+ scene.events.on(Scenes.Events.READY, readyListener);
1002
+ scene.events.on(Scenes.Events.SHUTDOWN, shutdownListener);
1003
+ if (__props.autoStart) await switchToScene(__props.sceneKey);
1004
+ });
1005
+ onUnmounted(() => {
1006
+ const game = useGame();
1007
+ const scene = getScene(__props.sceneKey);
1008
+ scene.events.off(Scenes.Events.READY, readyListener);
1009
+ scene.events.off(Scenes.Events.SHUTDOWN, shutdownListener);
1010
+ game.scene.remove(__props.sceneKey);
1011
+ });
1012
+ provide(InjectionKeyMap.SceneKey, __props.sceneKey);
1013
+ return (_ctx, _cache) => {
1014
+ return isActive.value ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : createCommentVNode("v-if", true);
1015
+ };
633
1016
  }
634
- }), et = {
635
- ...H,
636
- ...U,
637
- ...I,
638
- ...W,
639
- ...G,
640
- ...L,
641
- ...K,
642
- ...R,
643
- ...Z,
644
- ...q,
645
- ...z,
646
- ...B,
647
- ...V
648
- }, tt = /* @__PURE__ */ a({
1017
+ });
1018
+ //#endregion
1019
+ //#region src/util/setterMap/RenderTextureSetterMap.ts
1020
+ const RenderTextureSetterMap = {
1021
+ ...AlphaSetterMap,
1022
+ ...BlendModeSetterMap,
1023
+ ...DepthSetterMap,
1024
+ ...FlipSetterMap,
1025
+ ...MaskSetterMap,
1026
+ ...OriginSetterMap,
1027
+ ...RenderNodesSetterMap,
1028
+ ...ScrollFactorSetterMap,
1029
+ ...SizeSetterMap,
1030
+ ...TintSetterMap,
1031
+ ...TransformSetterMap,
1032
+ ...VisibleSetterMap,
1033
+ ...GlobalSetterMap
1034
+ };
1035
+ //#endregion
1036
+ //#region src/components/RenderTexture.vue
1037
+ const _sfc_main$17 = /*@__PURE__*/ defineComponent({
649
1038
  __name: "RenderTexture",
650
1039
  props: {
651
1040
  configuration: {},
652
1041
  immediate: { type: Boolean },
653
1042
  onComplete: { type: Function }
654
1043
  },
655
- setup(e, { emit: t }) {
656
- return P((t) => {
657
- let { height: n, width: r, x: i, y: a } = e.configuration, o = t.add.renderTexture(i ?? 0, a ?? 0, r, n);
658
- return e.onComplete?.(t, o), o;
659
- }, () => e.configuration, t, et, e.immediate), (e, t) => null;
1044
+ setup(__props, { emit: __emit }) {
1045
+ useInitializeGameObject((scene) => {
1046
+ const { height, width, x, y } = __props.configuration;
1047
+ const renderTexture = scene.add.renderTexture(x ?? 0, y ?? 0, width, height);
1048
+ __props.onComplete?.(scene, renderTexture);
1049
+ return renderTexture;
1050
+ }, () => __props.configuration, __emit, RenderTextureSetterMap, __props.immediate);
1051
+ return (_ctx, _cache) => {
1052
+ return null;
1053
+ };
660
1054
  }
661
- }), nt = {
662
- height: F.height,
663
- width: F.width,
664
- ...Y,
665
- ...V
666
- }, rt = /* @__PURE__ */ a({
1055
+ });
1056
+ //#endregion
1057
+ //#region src/util/setterMap/RectangleSetterMap.ts
1058
+ const RectangleSetterMap = {
1059
+ height: ComputedSizeSetterMap.height,
1060
+ width: ComputedSizeSetterMap.width,
1061
+ ...ShapeSetterMap,
1062
+ ...GlobalSetterMap
1063
+ };
1064
+ //#endregion
1065
+ //#region src/components/Rectangle.vue
1066
+ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
667
1067
  __name: "Rectangle",
668
1068
  props: {
669
1069
  configuration: {},
670
1070
  immediate: { type: Boolean },
671
1071
  onComplete: { type: Function }
672
1072
  },
673
- setup(e, { emit: t }) {
674
- return P((t) => {
675
- let { alpha: n, fillColor: r, height: i, width: a, x: o, y: s } = e.configuration, c = t.add.rectangle(o, s, a, i, r, n);
676
- return e.onComplete?.(t, c), c;
677
- }, () => e.configuration, t, nt, e.immediate), (e, t) => null;
1073
+ setup(__props, { emit: __emit }) {
1074
+ useInitializeGameObject((scene) => {
1075
+ const { alpha, fillColor, height, width, x, y } = __props.configuration;
1076
+ const rectangle = scene.add.rectangle(x, y, width, height, fillColor, alpha);
1077
+ __props.onComplete?.(scene, rectangle);
1078
+ return rectangle;
1079
+ }, () => __props.configuration, __emit, RectangleSetterMap, __props.immediate);
1080
+ return (_ctx, _cache) => {
1081
+ return null;
1082
+ };
678
1083
  }
679
- }), it = {
680
- points: (e) => (t) => {
681
- t && e.setTo(t);
682
- },
683
- ...Y,
684
- ...V
685
- }, at = /* @__PURE__ */ a({
1084
+ });
1085
+ //#endregion
1086
+ //#region src/util/setterMap/PolygonSetterMap.ts
1087
+ const PolygonSetterMap = {
1088
+ points: (gameObject) => (value) => {
1089
+ if (!value) return;
1090
+ gameObject.setTo(value);
1091
+ },
1092
+ ...ShapeSetterMap,
1093
+ ...GlobalSetterMap
1094
+ };
1095
+ //#endregion
1096
+ //#region src/components/Polygon.vue
1097
+ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
686
1098
  __name: "Polygon",
687
1099
  props: {
688
1100
  configuration: {},
689
1101
  immediate: { type: Boolean },
690
1102
  onComplete: { type: Function }
691
1103
  },
692
- setup(e, { emit: t }) {
693
- return P((t) => {
694
- let { alpha: n, fillColor: r, points: i, x: a, y: o } = e.configuration, s = t.add.polygon(a, o, i, r, n);
695
- return e.onComplete?.(t, s), s;
696
- }, () => e.configuration, t, it, e.immediate), (e, t) => null;
1104
+ setup(__props, { emit: __emit }) {
1105
+ useInitializeGameObject((scene) => {
1106
+ const { alpha, fillColor, points, x, y } = __props.configuration;
1107
+ const polygon = scene.add.polygon(x, y, points, fillColor, alpha);
1108
+ __props.onComplete?.(scene, polygon);
1109
+ return polygon;
1110
+ }, () => __props.configuration, __emit, PolygonSetterMap, __props.immediate);
1111
+ return (_ctx, _cache) => {
1112
+ return null;
1113
+ };
697
1114
  }
698
- }), ot = { path: (e) => (t) => {
699
- t && e.setPath(t);
700
- } }, st = {
701
- ...H,
702
- ...U,
703
- ...I,
704
- ...W,
705
- ...G,
706
- ...L,
707
- ...ot,
708
- ...K,
709
- ...R,
710
- ...Z,
711
- ...X,
712
- ...q,
713
- ...z,
714
- ...B,
715
- ...V
716
- }, ct = /* @__PURE__ */ a({
1115
+ });
1116
+ //#endregion
1117
+ //#region src/util/setterMap/components/PathFollowerComponentSetterMap.ts
1118
+ const PathFollowerComponentSetterMap = { path: (gameObject) => (value) => {
1119
+ if (!value) return;
1120
+ gameObject.setPath(value);
1121
+ } };
1122
+ //#endregion
1123
+ //#region src/util/setterMap/PathFollowerSetterMap.ts
1124
+ const PathFollowerSetterMap = {
1125
+ ...AlphaSetterMap,
1126
+ ...BlendModeSetterMap,
1127
+ ...DepthSetterMap,
1128
+ ...FlipSetterMap,
1129
+ ...MaskSetterMap,
1130
+ ...OriginSetterMap,
1131
+ ...PathFollowerComponentSetterMap,
1132
+ ...RenderNodesSetterMap,
1133
+ ...ScrollFactorSetterMap,
1134
+ ...SizeSetterMap,
1135
+ ...TextureSetterMap,
1136
+ ...TintSetterMap,
1137
+ ...TransformSetterMap,
1138
+ ...VisibleSetterMap,
1139
+ ...GlobalSetterMap
1140
+ };
1141
+ //#endregion
1142
+ //#region src/components/PathFollower.vue
1143
+ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
717
1144
  __name: "PathFollower",
718
1145
  props: {
719
1146
  configuration: {},
720
1147
  onComplete: { type: Function }
721
1148
  },
722
- setup(e, { emit: t }) {
723
- return P((t) => {
724
- let { frame: n, path: r, texture: i, x: a, y: o } = e.configuration, s = t.add.follower(r, a ?? 0, o ?? 0, i, n);
725
- return e.onComplete?.(t, s), s;
726
- }, () => e.configuration, t, st), (e, t) => null;
1149
+ setup(__props, { emit: __emit }) {
1150
+ useInitializeGameObject((scene) => {
1151
+ const { frame, path, texture, x, y } = __props.configuration;
1152
+ const pathFollower = scene.add.follower(path, x ?? 0, y ?? 0, texture, frame);
1153
+ __props.onComplete?.(scene, pathFollower);
1154
+ return pathFollower;
1155
+ }, () => __props.configuration, __emit, PathFollowerSetterMap);
1156
+ return (_ctx, _cache) => {
1157
+ return null;
1158
+ };
727
1159
  }
728
- }), lt = {
729
- ...J,
730
- ...U,
731
- ...I,
732
- ...G,
733
- ...K,
734
- ...R,
735
- ...X,
736
- ...z,
737
- ...B,
738
- ...V,
739
- config: (e) => (t) => {
740
- t && e.setConfig(t);
1160
+ });
1161
+ //#endregion
1162
+ //#region src/util/setterMap/ParticlesSetterMap.ts
1163
+ const ParticlesSetterMap = {
1164
+ ...AlphaSingleSetterMap,
1165
+ ...BlendModeSetterMap,
1166
+ ...DepthSetterMap,
1167
+ ...MaskSetterMap,
1168
+ ...RenderNodesSetterMap,
1169
+ ...ScrollFactorSetterMap,
1170
+ ...TextureSetterMap,
1171
+ ...TransformSetterMap,
1172
+ ...VisibleSetterMap,
1173
+ ...GlobalSetterMap,
1174
+ config: (gameObject) => (value) => {
1175
+ if (!value) return;
1176
+ gameObject.setConfig(value);
741
1177
  }
742
- }, ut = /* @__PURE__ */ a({
1178
+ };
1179
+ //#endregion
1180
+ //#region src/components/Particles.vue
1181
+ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
743
1182
  __name: "Particles",
744
1183
  props: {
745
1184
  configuration: {},
746
1185
  immediate: { type: Boolean },
747
1186
  onComplete: { type: Function }
748
1187
  },
749
- setup(e, { emit: t }) {
750
- return P((t) => {
751
- let { config: n, texture: r, x: i, y: a } = e.configuration, o = t.add.particles(i ?? 0, a ?? 0, r, n);
752
- return e.onComplete?.(t, o), o;
753
- }, () => e.configuration, t, lt, e.immediate), (e, t) => null;
1188
+ setup(__props, { emit: __emit }) {
1189
+ useInitializeGameObject((scene) => {
1190
+ const { config, texture, x, y } = __props.configuration;
1191
+ const particles = scene.add.particles(x ?? 0, y ?? 0, texture, config);
1192
+ __props.onComplete?.(scene, particles);
1193
+ return particles;
1194
+ }, () => __props.configuration, __emit, ParticlesSetterMap, __props.immediate);
1195
+ return (_ctx, _cache) => {
1196
+ return null;
1197
+ };
754
1198
  }
755
- }), dt = {
756
- height: F.height,
757
- width: F.width,
758
- ...J,
759
- ...U,
760
- ...I,
761
- ...G,
762
- ...L,
763
- ...K,
764
- ...R,
765
- ...X,
766
- ...z,
767
- ...B,
768
- ...V
769
- }, ft = /* @__PURE__ */ a({
1199
+ });
1200
+ //#endregion
1201
+ //#region src/util/setterMap/NinesliceSetterMap.ts
1202
+ const NinesliceSetterMap = {
1203
+ height: ComputedSizeSetterMap.height,
1204
+ width: ComputedSizeSetterMap.width,
1205
+ ...AlphaSingleSetterMap,
1206
+ ...BlendModeSetterMap,
1207
+ ...DepthSetterMap,
1208
+ ...MaskSetterMap,
1209
+ ...OriginSetterMap,
1210
+ ...RenderNodesSetterMap,
1211
+ ...ScrollFactorSetterMap,
1212
+ ...TextureSetterMap,
1213
+ ...TransformSetterMap,
1214
+ ...VisibleSetterMap,
1215
+ ...GlobalSetterMap
1216
+ };
1217
+ //#endregion
1218
+ //#region src/components/Nineslice.vue
1219
+ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
770
1220
  __name: "Nineslice",
771
1221
  props: {
772
1222
  configuration: {},
773
1223
  immediate: { type: Boolean },
774
1224
  onComplete: { type: Function }
775
1225
  },
776
- setup(e, { emit: t }) {
777
- return P((t) => {
778
- let { bottomHeight: n, frame: r, height: i, leftWidth: a, rightWidth: o, texture: s, topHeight: c, width: l, x: u, y: d } = e.configuration, f = t.add.nineslice(u ?? 0, d ?? 0, s, r, l, i, a, o, c, n);
779
- return e.onComplete?.(t, f), f;
780
- }, () => e.configuration, t, dt, e.immediate), (e, t) => null;
1226
+ setup(__props, { emit: __emit }) {
1227
+ useInitializeGameObject((scene) => {
1228
+ const { bottomHeight, frame, height, leftWidth, rightWidth, texture, topHeight, width, x, y } = __props.configuration;
1229
+ const nineSlice = scene.add.nineslice(x ?? 0, y ?? 0, texture, frame, width, height, leftWidth, rightWidth, topHeight, bottomHeight);
1230
+ __props.onComplete?.(scene, nineSlice);
1231
+ return nineSlice;
1232
+ }, () => __props.configuration, __emit, NinesliceSetterMap, __props.immediate);
1233
+ return (_ctx, _cache) => {
1234
+ return null;
1235
+ };
781
1236
  }
782
- }), pt = {
783
- lineWidth: (e) => (t) => {
784
- t !== void 0 && e.setLineWidth(t);
785
- },
786
- to: (e) => (t) => {
787
- t && e.setTo(...t);
788
- },
789
- ...Y,
790
- ...V
791
- }, mt = /* @__PURE__ */ a({
1237
+ });
1238
+ //#endregion
1239
+ //#region src/util/setterMap/LineSetterMap.ts
1240
+ const LineSetterMap = {
1241
+ lineWidth: (gameObject) => (value) => {
1242
+ if (value === void 0) return;
1243
+ gameObject.setLineWidth(value);
1244
+ },
1245
+ to: (gameObject) => (value) => {
1246
+ if (!value) return;
1247
+ gameObject.setTo(...value);
1248
+ },
1249
+ ...ShapeSetterMap,
1250
+ ...GlobalSetterMap
1251
+ };
1252
+ //#endregion
1253
+ //#region src/components/Line.vue
1254
+ const _sfc_main$11 = /*@__PURE__*/ defineComponent({
792
1255
  __name: "Line",
793
1256
  props: {
794
1257
  configuration: {},
795
1258
  immediate: { type: Boolean },
796
1259
  onComplete: { type: Function }
797
1260
  },
798
- setup(e, { emit: t }) {
799
- return P((t) => {
800
- let { to: n, x: r, y: i } = e.configuration, a = t.add.line(r, i, n?.[0], n?.[1], n?.[2], n?.[3]);
801
- return e.onComplete?.(t, a), a;
802
- }, () => e.configuration, t, pt, e.immediate), (e, t) => null;
1261
+ setup(__props, { emit: __emit }) {
1262
+ useInitializeGameObject((scene) => {
1263
+ const { to, x, y } = __props.configuration;
1264
+ const line = scene.add.line(x, y, to?.[0], to?.[1], to?.[2], to?.[3]);
1265
+ __props.onComplete?.(scene, line);
1266
+ return line;
1267
+ }, () => __props.configuration, __emit, LineSetterMap, __props.immediate);
1268
+ return (_ctx, _cache) => {
1269
+ return null;
1270
+ };
803
1271
  }
804
- }), ht = {
805
- fillLeft: (e) => (t) => {
806
- t !== void 0 && e.setFillStyle(e.fillTop, t, e.fillRight);
807
- },
808
- fillRight: (e) => (t) => {
809
- t !== void 0 && e.setFillStyle(e.fillTop, e.fillLeft, t);
810
- },
811
- fillTop: (e) => (t) => {
812
- t !== void 0 && e.setFillStyle(t, e.fillLeft, e.fillRight);
813
- },
814
- projection: (e) => (t) => {
815
- t !== void 0 && e.setProjection(t);
816
- },
817
- showLeft: (e) => (t) => {
818
- t !== void 0 && e.setFaces(e.showTop, t, e.showRight);
819
- },
820
- showRight: (e) => (t) => {
821
- t !== void 0 && e.setFaces(e.showTop, e.showLeft, t);
822
- },
823
- showTop: (e) => (t) => {
824
- t !== void 0 && e.setFaces(t, e.showLeft, e.showRight);
1272
+ });
1273
+ //#endregion
1274
+ //#region src/util/setterMap/shared/IsoSetterMap.ts
1275
+ const IsoSetterMap = {
1276
+ fillLeft: (gameObject) => (value) => {
1277
+ if (value === void 0) return;
1278
+ gameObject.setFillStyle(gameObject.fillTop, value, gameObject.fillRight);
1279
+ },
1280
+ fillRight: (gameObject) => (value) => {
1281
+ if (value === void 0) return;
1282
+ gameObject.setFillStyle(gameObject.fillTop, gameObject.fillLeft, value);
1283
+ },
1284
+ fillTop: (gameObject) => (value) => {
1285
+ if (value === void 0) return;
1286
+ gameObject.setFillStyle(value, gameObject.fillLeft, gameObject.fillRight);
1287
+ },
1288
+ projection: (gameObject) => (value) => {
1289
+ if (value === void 0) return;
1290
+ gameObject.setProjection(value);
1291
+ },
1292
+ showLeft: (gameObject) => (value) => {
1293
+ if (value === void 0) return;
1294
+ gameObject.setFaces(gameObject.showTop, value, gameObject.showRight);
1295
+ },
1296
+ showRight: (gameObject) => (value) => {
1297
+ if (value === void 0) return;
1298
+ gameObject.setFaces(gameObject.showTop, gameObject.showLeft, value);
1299
+ },
1300
+ showTop: (gameObject) => (value) => {
1301
+ if (value === void 0) return;
1302
+ gameObject.setFaces(value, gameObject.showLeft, gameObject.showRight);
825
1303
  }
826
- }, gt = {
827
- isReversed: (e) => (t) => {
828
- t !== void 0 && e.setReversed(t);
829
- },
830
- ...ht,
831
- ...Y,
832
- ...V
833
- }, _t = /* @__PURE__ */ a({
1304
+ };
1305
+ //#endregion
1306
+ //#region src/util/setterMap/IsoTriangleSetterMap.ts
1307
+ const IsoTriangleSetterMap = {
1308
+ isReversed: (gameObject) => (value) => {
1309
+ if (value === void 0) return;
1310
+ gameObject.setReversed(value);
1311
+ },
1312
+ ...IsoSetterMap,
1313
+ ...ShapeSetterMap,
1314
+ ...GlobalSetterMap
1315
+ };
1316
+ //#endregion
1317
+ //#region src/components/IsoTriangle.vue
1318
+ const _sfc_main$10 = /*@__PURE__*/ defineComponent({
834
1319
  __name: "IsoTriangle",
835
1320
  props: {
836
1321
  configuration: {},
837
1322
  immediate: { type: Boolean },
838
1323
  onComplete: { type: Function }
839
1324
  },
840
- setup(e, { emit: t }) {
841
- return P((t) => {
842
- let { fillLeft: n, fillRight: r, fillTop: i, height: a, isReversed: o, size: s, x: c, y: l } = e.configuration, u = t.add.isotriangle(c, l, s, a, o, i, n, r);
843
- return e.onComplete?.(t, u), u;
844
- }, () => e.configuration, t, gt, e.immediate), (e, t) => null;
1325
+ setup(__props, { emit: __emit }) {
1326
+ useInitializeGameObject((scene) => {
1327
+ const { fillLeft, fillRight, fillTop, height, isReversed, size, x, y } = __props.configuration;
1328
+ const isoTriangle = scene.add.isotriangle(x, y, size, height, isReversed, fillTop, fillLeft, fillRight);
1329
+ __props.onComplete?.(scene, isoTriangle);
1330
+ return isoTriangle;
1331
+ }, () => __props.configuration, __emit, IsoTriangleSetterMap, __props.immediate);
1332
+ return (_ctx, _cache) => {
1333
+ return null;
1334
+ };
845
1335
  }
846
- }), vt = {
847
- ...ht,
848
- ...Y,
849
- ...V
850
- }, yt = /* @__PURE__ */ a({
1336
+ });
1337
+ //#endregion
1338
+ //#region src/util/setterMap/IsoBoxSetterMap.ts
1339
+ const IsoBoxSetterMap = {
1340
+ ...IsoSetterMap,
1341
+ ...ShapeSetterMap,
1342
+ ...GlobalSetterMap
1343
+ };
1344
+ //#endregion
1345
+ //#region src/components/IsoBox.vue
1346
+ const _sfc_main$9 = /*@__PURE__*/ defineComponent({
851
1347
  __name: "IsoBox",
852
1348
  props: {
853
1349
  configuration: {},
854
1350
  immediate: { type: Boolean },
855
1351
  onComplete: { type: Function }
856
1352
  },
857
- setup(e, { emit: t }) {
858
- return P((t) => {
859
- let { fillLeft: n, fillRight: r, fillTop: i, height: a, size: o, x: s, y: c } = e.configuration, l = t.add.isobox(s, c, o, a, i, n, r);
860
- return e.onComplete?.(t, l), l;
861
- }, () => e.configuration, t, vt, e.immediate), (e, t) => null;
1353
+ setup(__props, { emit: __emit }) {
1354
+ useInitializeGameObject((scene) => {
1355
+ const { fillLeft, fillRight, fillTop, height, size, x, y } = __props.configuration;
1356
+ const isoBox = scene.add.isobox(x, y, size, height, fillTop, fillLeft, fillRight);
1357
+ __props.onComplete?.(scene, isoBox);
1358
+ return isoBox;
1359
+ }, () => __props.configuration, __emit, IsoBoxSetterMap, __props.immediate);
1360
+ return (_ctx, _cache) => {
1361
+ return null;
1362
+ };
862
1363
  }
863
- }), bt = {
864
- ...H,
865
- ...U,
866
- ...I,
867
- ...W,
868
- ...G,
869
- ...L,
870
- ...K,
871
- ...R,
872
- ...Z,
873
- ...Ne,
874
- ...q,
875
- ...z,
876
- ...B,
877
- ...V
878
- }, xt = /* @__PURE__ */ a({
1364
+ });
1365
+ //#endregion
1366
+ //#region src/util/setterMap/ImageSetterMap.ts
1367
+ const ImageSetterMap = {
1368
+ ...AlphaSetterMap,
1369
+ ...BlendModeSetterMap,
1370
+ ...DepthSetterMap,
1371
+ ...FlipSetterMap,
1372
+ ...MaskSetterMap,
1373
+ ...OriginSetterMap,
1374
+ ...RenderNodesSetterMap,
1375
+ ...ScrollFactorSetterMap,
1376
+ ...SizeSetterMap,
1377
+ ...TextureCropSetterMap,
1378
+ ...TintSetterMap,
1379
+ ...TransformSetterMap,
1380
+ ...VisibleSetterMap,
1381
+ ...GlobalSetterMap
1382
+ };
1383
+ //#endregion
1384
+ //#region src/components/Image.vue
1385
+ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
879
1386
  __name: "Image",
880
1387
  props: {
881
1388
  configuration: {},
882
1389
  onComplete: { type: Function }
883
1390
  },
884
- setup(e, { emit: t }) {
885
- return P((t) => {
886
- let { frame: n, texture: r, x: i, y: a } = e.configuration, o = t.add.image(i ?? 0, a ?? 0, r, n);
887
- return e.onComplete?.(t, o), o;
888
- }, () => e.configuration, t, bt), (e, t) => null;
1391
+ setup(__props, { emit: __emit }) {
1392
+ useInitializeGameObject((scene) => {
1393
+ const { frame, texture, x, y } = __props.configuration;
1394
+ const image = scene.add.image(x ?? 0, y ?? 0, texture, frame);
1395
+ __props.onComplete?.(scene, image);
1396
+ return image;
1397
+ }, () => __props.configuration, __emit, ImageSetterMap);
1398
+ return (_ctx, _cache) => {
1399
+ return null;
1400
+ };
889
1401
  }
890
- }), St = {
891
- ...J,
892
- ...U,
893
- ...I,
894
- ...G,
895
- ...K,
896
- ...R,
897
- ...z,
898
- ...B,
899
- ...V
900
- }, Ct = /* @__PURE__ */ a({
1402
+ });
1403
+ //#endregion
1404
+ //#region src/util/setterMap/GraphicsSetterMap.ts
1405
+ const GraphicsSetterMap = {
1406
+ ...AlphaSingleSetterMap,
1407
+ ...BlendModeSetterMap,
1408
+ ...DepthSetterMap,
1409
+ ...MaskSetterMap,
1410
+ ...RenderNodesSetterMap,
1411
+ ...ScrollFactorSetterMap,
1412
+ ...TransformSetterMap,
1413
+ ...VisibleSetterMap,
1414
+ ...GlobalSetterMap
1415
+ };
1416
+ //#endregion
1417
+ //#region src/components/Graphics.vue
1418
+ const _sfc_main$7 = /*@__PURE__*/ defineComponent({
901
1419
  __name: "Graphics",
902
1420
  props: {
903
1421
  configuration: { default: () => ({}) },
904
1422
  immediate: { type: Boolean },
905
1423
  onComplete: { type: Function }
906
1424
  },
907
- setup(e, { emit: t }) {
908
- return P((t) => {
909
- let { x: n, y: r } = e.configuration, i = t.add.graphics({
910
- x: n,
911
- y: r
1425
+ setup(__props, { emit: __emit }) {
1426
+ useInitializeGameObject((scene) => {
1427
+ const { x, y } = __props.configuration;
1428
+ const graphics = scene.add.graphics({
1429
+ x,
1430
+ y
912
1431
  });
913
- return e.onComplete?.(t, i), i;
914
- }, () => e.configuration, t, St, e.immediate), (e, t) => null;
1432
+ __props.onComplete?.(scene, graphics);
1433
+ return graphics;
1434
+ }, () => __props.configuration, __emit, GraphicsSetterMap, __props.immediate);
1435
+ return (_ctx, _cache) => {
1436
+ return null;
1437
+ };
915
1438
  }
916
- }), wt = C.FileTypes.XMLFile, Tt = class extends wt {
1439
+ });
1440
+ //#endregion
1441
+ //#region src/models/plugins/TilesetFile.ts
1442
+ const XMLFile = Loader.FileTypes.XMLFile;
1443
+ var TilesetFile = class extends XMLFile {
917
1444
  tilesetIndex;
918
- constructor(e, ...t) {
919
- super(...t), this.tilesetIndex = e;
1445
+ constructor(tilesetIndex, ...args) {
1446
+ super(...args);
1447
+ this.tilesetIndex = tilesetIndex;
920
1448
  }
921
- }, $ = fe.Objects.GetFastValue, Et = C.FileTypes.JSONFile, Dt = C.MultiFile, Ot = class extends Dt {
922
- constructor(e, t, n, r, i, a, o) {
923
- if (ne(t)) {
924
- let e = t;
925
- t = $(e, "key"), n = $(e, "url"), a = $(e, "xhrSettings"), r = $(e, "path"), i = $(e, "baseURL"), o = $(e, "tilesetXhrSettings");
1449
+ };
1450
+ //#endregion
1451
+ //#region src/models/plugins/TiledJSONExternalFile.ts
1452
+ const GetFastValue = Utils.Objects.GetFastValue;
1453
+ const JSONFile$1 = Loader.FileTypes.JSONFile;
1454
+ const MultiFile = Loader.MultiFile;
1455
+ var TiledJSONExternalFile = class extends MultiFile {
1456
+ constructor(loader, key, tilemapURL, path, baseURL, tilemapXhrSettings, tilesetXhrSettings) {
1457
+ if (checkIsPlainObject(key)) {
1458
+ const configuration = key;
1459
+ key = GetFastValue(configuration, "key");
1460
+ tilemapURL = GetFastValue(configuration, "url");
1461
+ tilemapXhrSettings = GetFastValue(configuration, "xhrSettings");
1462
+ path = GetFastValue(configuration, "path");
1463
+ baseURL = GetFastValue(configuration, "baseURL");
1464
+ tilesetXhrSettings = GetFastValue(configuration, "tilesetXhrSettings");
926
1465
  }
927
- let s = new Et(e, t, n, a);
928
- super(e, "tilemapJSON", t, [s]), this.config.path = r, this.config.baseURL = i, this.config.tilesetXhrSettings = o;
1466
+ const tilemapFile = new JSONFile$1(loader, key, tilemapURL, tilemapXhrSettings);
1467
+ super(loader, "tilemapJSON", key, [tilemapFile]);
1468
+ this.config.path = path;
1469
+ this.config.baseURL = baseURL;
1470
+ this.config.tilesetXhrSettings = tilesetXhrSettings;
929
1471
  }
930
1472
  async addToCache() {
931
1473
  if (!this.isReadyToProcess()) return;
932
- let [e, ...t] = this.files;
933
- if (!(e.type === "json" && Object.hasOwn(e.data, "tilesets"))) return;
934
- let n = e.data, r = e.key, i = this.loader, a = this.files;
935
- this.complete = !0;
936
- for (let e of t) {
937
- let t = e.xhrLoader?.responseText;
938
- if (!t) throw new y(x.Read, this.addToCache.name, e.key);
939
- let r = await he(t), i = me(r.tileset), a = e.tilesetIndex;
940
- Object.assign(n.tilesets[a], i, {
941
- imageheight: i.image.height,
942
- imagewidth: i.image.width,
1474
+ const [tilemapFile, ...tilesetFiles] = this.files;
1475
+ if (!(tilemapFile.type === "json" && Object.hasOwn(tilemapFile.data, "tilesets"))) return;
1476
+ const tilemapData = tilemapFile.data;
1477
+ const tilemapKey = tilemapFile.key;
1478
+ const loader = this.loader;
1479
+ const files = this.files;
1480
+ this.complete = true;
1481
+ for (const tilesetFile of tilesetFiles) {
1482
+ const responseText = tilesetFile.xhrLoader?.responseText;
1483
+ if (!responseText) throw new InvalidOperationError(Operation.Read, this.addToCache.name, tilesetFile.key);
1484
+ const responseData = await parseXmlString(responseText);
1485
+ const tilesetData = parseTileset(responseData.tileset);
1486
+ const index = tilesetFile.tilesetIndex;
1487
+ Object.assign(tilemapData.tilesets[index], tilesetData, {
1488
+ imageheight: tilesetData.image.height,
1489
+ imagewidth: tilesetData.image.width,
943
1490
  source: void 0
944
1491
  });
945
1492
  }
946
- i.cacheManager.tilemap.add(r, {
947
- data: n,
948
- format: ue.Formats.TILED_JSON
1493
+ loader.cacheManager.tilemap.add(tilemapKey, {
1494
+ data: tilemapData,
1495
+ format: Tilemaps.Formats.TILED_JSON
949
1496
  });
950
- for (let e of a) e.pendingDestroy();
1497
+ for (const file of files) file.pendingDestroy();
951
1498
  }
952
- onFileComplete(e) {
953
- if (this.files.indexOf(e) === -1 || (this.pending--, !(e.type === "json" && Object.hasOwn(e.data, "tilesets")))) return;
954
- let t = e.data.tilesets, n = this.config, r = this.loader, i = r.baseURL, a = r.path, o = r.prefix, s = $(n, "baseURL", i), c = $(n, "path", a), l = $(n, "prefix", o), u = $(n, "tilesetXhrSettings");
955
- r.setBaseURL(s), r.setPath(c), r.setPrefix(l);
956
- for (let [n, i] of t.entries()) {
957
- let t = i.source.indexOf("public");
958
- if (t === -1) throw new te(this.onFileComplete.name, i.source);
959
- let a = i.source.slice(t + 6), o = new Tt(n, r, `${e.key}${v}Tileset${v}${a}`, a, u);
960
- this.addToMultiFile(o), r.addFile(o);
1499
+ onFileComplete(file) {
1500
+ if (this.files.indexOf(file) === -1) return;
1501
+ this.pending--;
1502
+ if (!(file.type === "json" && Object.hasOwn(file.data, "tilesets"))) return;
1503
+ const tilesets = file.data.tilesets;
1504
+ const config = this.config;
1505
+ const loader = this.loader;
1506
+ const currentBaseURL = loader.baseURL;
1507
+ const currentPath = loader.path;
1508
+ const currentPrefix = loader.prefix;
1509
+ const baseURL = GetFastValue(config, "baseURL", currentBaseURL);
1510
+ const path = GetFastValue(config, "path", currentPath);
1511
+ const prefix = GetFastValue(config, "prefix", currentPrefix);
1512
+ const tilesetXhrSettings = GetFastValue(config, "tilesetXhrSettings");
1513
+ loader.setBaseURL(baseURL);
1514
+ loader.setPath(path);
1515
+ loader.setPrefix(prefix);
1516
+ for (const [tilesetIndex, tileset] of tilesets.entries()) {
1517
+ const pathIndex = tileset.source.indexOf("public");
1518
+ if (pathIndex === -1) throw new NotFoundError(this.onFileComplete.name, tileset.source);
1519
+ const relativePath = tileset.source.slice(pathIndex + 6);
1520
+ const tilesetFile = new TilesetFile(tilesetIndex, loader, `${file.key}${ID_SEPARATOR}Tileset${ID_SEPARATOR}${relativePath}`, relativePath, tilesetXhrSettings);
1521
+ this.addToMultiFile(tilesetFile);
1522
+ loader.addFile(tilesetFile);
961
1523
  }
962
- r.setBaseURL(i), r.setPath(a), r.setPrefix(o);
1524
+ loader.setBaseURL(currentBaseURL);
1525
+ loader.setPath(currentPath);
1526
+ loader.setPrefix(currentPrefix);
963
1527
  }
964
- }, kt = "tilemapTiledJSONExternal", At = C.FileTypesManager, jt = () => {
965
- At.register(kt, function(...[e, t, n, r, i, a]) {
966
- if (Array.isArray(e)) for (let t of e) {
967
- let e = new Ot(this, t);
968
- this.addFile(e.files);
1528
+ };
1529
+ //#endregion
1530
+ //#region src/util/constants.ts
1531
+ const TILEMAP_TILED_JSON_EXTERNAL_KEY = "tilemapTiledJSONExternal";
1532
+ //#endregion
1533
+ //#region src/plugins/registerTiledJSONExternalLoader.ts
1534
+ const FileTypesManager = Loader.FileTypesManager;
1535
+ const registerTiledJSONExternalLoader = () => {
1536
+ FileTypesManager.register(TILEMAP_TILED_JSON_EXTERNAL_KEY, function(...[key, tilemapURL, path, baseURL, tilemapXhrSettings, tilesetXhrSettings]) {
1537
+ if (Array.isArray(key)) for (const keyElement of key) {
1538
+ const multifile = new TiledJSONExternalFile(this, keyElement);
1539
+ this.addFile(multifile.files);
969
1540
  }
970
1541
  else {
971
- let o = new Ot(this, e, t, n, r, i, a);
972
- this.addFile(o.files);
1542
+ const multifile = new TiledJSONExternalFile(this, key, tilemapURL, path, baseURL, tilemapXhrSettings, tilesetXhrSettings);
1543
+ this.addFile(multifile.files);
973
1544
  }
974
1545
  return this;
975
1546
  });
976
- }, Mt = /* @__PURE__ */ a({
1547
+ };
1548
+ //#endregion
1549
+ //#region src/components/Game.vue
1550
+ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
977
1551
  __name: "Game",
978
1552
  props: { configuration: {} },
979
- setup(t) {
980
- let a = j(), { game: o } = w(a), s = _("canvasRoot"), c = p(!1), f = () => {
981
- c.value = !0;
1553
+ setup(__props) {
1554
+ const phaserStore = usePhaserStore();
1555
+ const { game: storeGame } = storeToRefs(phaserStore);
1556
+ const canvasRoot = useTemplateRef("canvasRoot");
1557
+ const isReady = ref(false);
1558
+ const readyListener = () => {
1559
+ isReady.value = true;
1560
+ };
1561
+ onMounted(() => {
1562
+ registerTiledJSONExternalLoader();
1563
+ storeGame.value = new Game({
1564
+ ...__props.configuration,
1565
+ parent: canvasRoot.value
1566
+ });
1567
+ storeGame.value.events.on("ready", readyListener);
1568
+ });
1569
+ onUnmounted(() => {
1570
+ const game = useGame();
1571
+ game.events.off("ready", readyListener);
1572
+ game.destroy(true);
1573
+ storeGame.value = void 0;
1574
+ });
1575
+ return (_ctx, _cache) => {
1576
+ return openBlock(), createElementBlock(Fragment, null, [createElementVNode("div", {
1577
+ ref_key: "canvasRoot",
1578
+ ref: canvasRoot
1579
+ }, null, 512), isReady.value ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : createCommentVNode("v-if", true)], 64);
982
1580
  };
983
- return l(() => {
984
- jt(), o.value = new se({
985
- ...t.configuration,
986
- parent: s.value
987
- }), o.value.events.on("ready", f);
988
- }), u(() => {
989
- let e = M();
990
- e.events.off("ready", f), e.destroy(!0), o.value = void 0;
991
- }), (t, a) => (d(), r(e, null, [i("div", {
992
- ref_key: "canvasRoot",
993
- ref: s
994
- }, null, 512), g(c) ? m(t.$slots, "default", {}, void 0, void 0, 0) : n("", !0)], 64));
995
1581
  }
996
- }), Nt = {
997
- height: F.height,
998
- smoothness: (e) => (t) => {
999
- t !== void 0 && e.setSmoothness(t);
1000
- },
1001
- width: F.width,
1002
- ...Y,
1003
- ...V
1004
- }, Pt = /* @__PURE__ */ a({
1582
+ });
1583
+ //#endregion
1584
+ //#region src/util/setterMap/EllipseSetterMap.ts
1585
+ const EllipseSetterMap = {
1586
+ height: ComputedSizeSetterMap.height,
1587
+ smoothness: (gameObject) => (value) => {
1588
+ if (value === void 0) return;
1589
+ gameObject.setSmoothness(value);
1590
+ },
1591
+ width: ComputedSizeSetterMap.width,
1592
+ ...ShapeSetterMap,
1593
+ ...GlobalSetterMap
1594
+ };
1595
+ //#endregion
1596
+ //#region src/components/Ellipse.vue
1597
+ const _sfc_main$5 = /*@__PURE__*/ defineComponent({
1005
1598
  __name: "Ellipse",
1006
1599
  props: {
1007
1600
  configuration: {},
1008
1601
  immediate: { type: Boolean },
1009
1602
  onComplete: { type: Function }
1010
1603
  },
1011
- setup(e, { emit: t }) {
1012
- return P((t) => {
1013
- let { alpha: n, fillColor: r, height: i, width: a, x: o, y: s } = e.configuration, c = t.add.ellipse(o, s, a, i, r, n);
1014
- return e.onComplete?.(t, c), c;
1015
- }, () => e.configuration, t, Nt, e.immediate), (e, t) => null;
1604
+ setup(__props, { emit: __emit }) {
1605
+ useInitializeGameObject((scene) => {
1606
+ const { alpha, fillColor, height, width, x, y } = __props.configuration;
1607
+ const ellipse = scene.add.ellipse(x, y, width, height, fillColor, alpha);
1608
+ __props.onComplete?.(scene, ellipse);
1609
+ return ellipse;
1610
+ }, () => __props.configuration, __emit, EllipseSetterMap, __props.immediate);
1611
+ return (_ctx, _cache) => {
1612
+ return null;
1613
+ };
1016
1614
  }
1017
- }), Ft = {
1018
- smoothness: (e) => (t) => {
1019
- t !== void 0 && e.setSmoothness(t);
1020
- },
1021
- ...Y,
1022
- ...V
1023
- }, It = /* @__PURE__ */ a({
1615
+ });
1616
+ //#endregion
1617
+ //#region src/util/setterMap/CurveSetterMap.ts
1618
+ const CurveSetterMap = {
1619
+ smoothness: (gameObject) => (value) => {
1620
+ if (value === void 0) return;
1621
+ gameObject.setSmoothness(value);
1622
+ },
1623
+ ...ShapeSetterMap,
1624
+ ...GlobalSetterMap
1625
+ };
1626
+ //#endregion
1627
+ //#region src/components/Curve.vue
1628
+ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
1024
1629
  __name: "Curve",
1025
1630
  props: {
1026
1631
  configuration: {},
1027
1632
  immediate: { type: Boolean },
1028
1633
  onComplete: { type: Function }
1029
1634
  },
1030
- setup(e, { emit: t }) {
1031
- return P((t) => {
1032
- let { alpha: n, curve: r, fillColor: i, x: a, y: o } = e.configuration, s = t.add.curve(a, o, r, i, n);
1033
- return e.onComplete?.(t, s), s;
1034
- }, () => e.configuration, t, Ft, e.immediate), (e, t) => null;
1635
+ setup(__props, { emit: __emit }) {
1636
+ useInitializeGameObject((scene) => {
1637
+ const { alpha, curve, fillColor, x, y } = __props.configuration;
1638
+ const curveObject = scene.add.curve(x, y, curve, fillColor, alpha);
1639
+ __props.onComplete?.(scene, curveObject);
1640
+ return curveObject;
1641
+ }, () => __props.configuration, __emit, CurveSetterMap, __props.immediate);
1642
+ return (_ctx, _cache) => {
1643
+ return null;
1644
+ };
1035
1645
  }
1036
- }), Lt = {
1037
- ...J,
1038
- ...U,
1039
- ...I,
1040
- ...R,
1041
- ...G,
1042
- ...z,
1043
- ...B,
1044
- ...V
1045
- }, Rt = /* @__PURE__ */ a({
1646
+ });
1647
+ //#endregion
1648
+ //#region src/util/setterMap/ContainerSetterMap.ts
1649
+ const ContainerSetterMap = {
1650
+ ...AlphaSingleSetterMap,
1651
+ ...BlendModeSetterMap,
1652
+ ...DepthSetterMap,
1653
+ ...ScrollFactorSetterMap,
1654
+ ...MaskSetterMap,
1655
+ ...TransformSetterMap,
1656
+ ...VisibleSetterMap,
1657
+ ...GlobalSetterMap
1658
+ };
1659
+ //#endregion
1660
+ //#region src/components/Container.vue
1661
+ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
1046
1662
  __name: "Container",
1047
1663
  props: {
1048
1664
  configuration: { default: () => ({}) },
1049
1665
  onComplete: { type: Function }
1050
1666
  },
1051
- setup(e, { emit: t }) {
1052
- let n = t, r = p();
1053
- return P((t) => {
1054
- let { children: n, x: i, y: a } = e.configuration;
1055
- return r.value = t.add.container(i, a, n), e.onComplete?.(t, r.value), r.value;
1056
- }, () => e.configuration, n, Lt), f(T.ParentContainer, r), (e, t) => m(e.$slots, "default");
1667
+ setup(__props, { emit: __emit }) {
1668
+ const emit = __emit;
1669
+ const container = ref();
1670
+ useInitializeGameObject((scene) => {
1671
+ const { children, x, y } = __props.configuration;
1672
+ container.value = scene.add.container(x, y, children);
1673
+ __props.onComplete?.(scene, container.value);
1674
+ return container.value;
1675
+ }, () => __props.configuration, emit, ContainerSetterMap);
1676
+ provide(InjectionKeyMap.ParentContainer, container);
1677
+ return (_ctx, _cache) => {
1678
+ return renderSlot(_ctx.$slots, "default");
1679
+ };
1057
1680
  }
1058
- }), zt = {
1059
- closePath: (e) => (t) => {
1060
- t !== void 0 && e.setClosePath(t);
1061
- },
1062
- endAngle: (e) => (t) => {
1063
- t !== void 0 && e.setEndAngle(t);
1064
- },
1065
- radius: (e) => (t) => {
1066
- t !== void 0 && e.setRadius(t);
1067
- },
1068
- startAngle: (e) => (t) => {
1069
- t !== void 0 && e.setStartAngle(t);
1070
- },
1071
- ...Y,
1072
- ...V
1073
- }, Bt = /* @__PURE__ */ a({
1681
+ });
1682
+ //#endregion
1683
+ //#region src/util/setterMap/ArcSetterMap.ts
1684
+ const ArcSetterMap = {
1685
+ closePath: (gameObject) => (value) => {
1686
+ if (value === void 0) return;
1687
+ gameObject.setClosePath(value);
1688
+ },
1689
+ endAngle: (gameObject) => (value) => {
1690
+ if (value === void 0) return;
1691
+ gameObject.setEndAngle(value);
1692
+ },
1693
+ radius: (gameObject) => (value) => {
1694
+ if (value === void 0) return;
1695
+ gameObject.setRadius(value);
1696
+ },
1697
+ startAngle: (gameObject) => (value) => {
1698
+ if (value === void 0) return;
1699
+ gameObject.setStartAngle(value);
1700
+ },
1701
+ ...ShapeSetterMap,
1702
+ ...GlobalSetterMap
1703
+ };
1704
+ //#endregion
1705
+ //#region src/components/Circle.vue
1706
+ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
1074
1707
  __name: "Circle",
1075
1708
  props: {
1076
1709
  configuration: {},
1077
1710
  immediate: { type: Boolean },
1078
1711
  onComplete: { type: Function }
1079
1712
  },
1080
- setup(e, { emit: t }) {
1081
- return P((t) => {
1082
- let { alpha: n, fillColor: r, radius: i, x: a, y: o } = e.configuration, s = t.add.circle(a, o, i, r, n);
1083
- return e.onComplete?.(t, s), s;
1084
- }, () => e.configuration, t, zt, e.immediate), (e, t) => null;
1713
+ setup(__props, { emit: __emit }) {
1714
+ useInitializeGameObject((scene) => {
1715
+ const { alpha, fillColor, radius, x, y } = __props.configuration;
1716
+ const circle = scene.add.circle(x, y, radius, fillColor, alpha);
1717
+ __props.onComplete?.(scene, circle);
1718
+ return circle;
1719
+ }, () => __props.configuration, __emit, ArcSetterMap, __props.immediate);
1720
+ return (_ctx, _cache) => {
1721
+ return null;
1722
+ };
1085
1723
  }
1086
- }), Vt = {
1087
- align: (e) => (t) => {
1088
- t !== void 0 && (e.align = t);
1089
- },
1090
- dropShadow: (e) => (t) => {
1091
- t && e.setDropShadow(...t);
1092
- },
1093
- font: (e) => (t) => {
1094
- t && e.setFont(t);
1095
- },
1096
- fontSize: (e) => (t) => {
1097
- t !== void 0 && e.setFontSize(t);
1098
- },
1099
- letterSpacing: (e) => (t) => {
1100
- t !== void 0 && e.setLetterSpacing(t);
1101
- },
1102
- lineSpacing: (e) => (t) => {
1103
- t !== void 0 && e.setLineSpacing(t);
1104
- },
1105
- maxWidth: (e) => (t) => {
1106
- t !== void 0 && e.setMaxWidth(t);
1107
- },
1108
- text: (e) => (t) => {
1109
- t !== void 0 && e.setText(t);
1110
- },
1111
- wordWrapCharCode: (e) => (t) => {
1112
- t !== void 0 && (e.wordWrapCharCode = t);
1113
- },
1114
- ...H,
1115
- ...U,
1116
- ...I,
1117
- ...G,
1118
- ...L,
1119
- ...K,
1120
- ...R,
1121
- ...q,
1122
- ...z,
1123
- ...B,
1124
- ...V
1125
- }, Ht = /* @__PURE__ */ a({
1724
+ });
1725
+ //#endregion
1726
+ //#region src/util/setterMap/BitmapTextSetterMap.ts
1727
+ const BitmapTextSetterMap = {
1728
+ align: (gameObject) => (value) => {
1729
+ if (value === void 0) return;
1730
+ gameObject.align = value;
1731
+ },
1732
+ dropShadow: (gameObject) => (value) => {
1733
+ if (!value) return;
1734
+ gameObject.setDropShadow(...value);
1735
+ },
1736
+ font: (gameObject) => (value) => {
1737
+ if (!value) return;
1738
+ gameObject.setFont(value);
1739
+ },
1740
+ fontSize: (gameObject) => (value) => {
1741
+ if (value === void 0) return;
1742
+ gameObject.setFontSize(value);
1743
+ },
1744
+ letterSpacing: (gameObject) => (value) => {
1745
+ if (value === void 0) return;
1746
+ gameObject.setLetterSpacing(value);
1747
+ },
1748
+ lineSpacing: (gameObject) => (value) => {
1749
+ if (value === void 0) return;
1750
+ gameObject.setLineSpacing(value);
1751
+ },
1752
+ maxWidth: (gameObject) => (value) => {
1753
+ if (value === void 0) return;
1754
+ gameObject.setMaxWidth(value);
1755
+ },
1756
+ text: (gameObject) => (value) => {
1757
+ if (value === void 0) return;
1758
+ gameObject.setText(value);
1759
+ },
1760
+ wordWrapCharCode: (gameObject) => (value) => {
1761
+ if (value === void 0) return;
1762
+ gameObject.wordWrapCharCode = value;
1763
+ },
1764
+ ...AlphaSetterMap,
1765
+ ...BlendModeSetterMap,
1766
+ ...DepthSetterMap,
1767
+ ...MaskSetterMap,
1768
+ ...OriginSetterMap,
1769
+ ...RenderNodesSetterMap,
1770
+ ...ScrollFactorSetterMap,
1771
+ ...TintSetterMap,
1772
+ ...TransformSetterMap,
1773
+ ...VisibleSetterMap,
1774
+ ...GlobalSetterMap
1775
+ };
1776
+ //#endregion
1777
+ //#region src/components/BitmapText.vue
1778
+ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
1126
1779
  __name: "BitmapText",
1127
1780
  props: {
1128
1781
  configuration: {},
1129
1782
  immediate: { type: Boolean },
1130
1783
  onComplete: { type: Function }
1131
1784
  },
1132
- setup(e, { emit: t }) {
1133
- return P((t) => {
1134
- let { align: n, font: r, fontSize: i, text: a, x: o, y: s } = e.configuration, c = t.add.bitmapText(o ?? 0, s ?? 0, r, a, i, n);
1135
- return e.onComplete?.(t, c), c;
1136
- }, () => e.configuration, t, Vt, e.immediate), (e, t) => null;
1785
+ setup(__props, { emit: __emit }) {
1786
+ useInitializeGameObject((scene) => {
1787
+ const { align, font, fontSize, text, x, y } = __props.configuration;
1788
+ const bitmapText = scene.add.bitmapText(x ?? 0, y ?? 0, font, text, fontSize, align);
1789
+ __props.onComplete?.(scene, bitmapText);
1790
+ return bitmapText;
1791
+ }, () => __props.configuration, __emit, BitmapTextSetterMap, __props.immediate);
1792
+ return (_ctx, _cache) => {
1793
+ return null;
1794
+ };
1137
1795
  }
1138
- }), Ut = /* @__PURE__ */ a({
1796
+ });
1797
+ //#endregion
1798
+ //#region src/components/Arc.vue
1799
+ const _sfc_main = /*@__PURE__*/ defineComponent({
1139
1800
  __name: "Arc",
1140
1801
  props: {
1141
1802
  configuration: {},
1142
1803
  immediate: { type: Boolean },
1143
1804
  onComplete: { type: Function }
1144
1805
  },
1145
- setup(e, { emit: t }) {
1146
- return P((t) => {
1147
- let { alpha: n, endAngle: r, fillColor: i, radius: a, startAngle: o, x: s, y: c } = e.configuration, l = t.add.arc(s, c, a, o, r, void 0, i, n);
1148
- return e.onComplete?.(t, l), l;
1149
- }, () => e.configuration, t, zt, e.immediate), (e, t) => null;
1806
+ setup(__props, { emit: __emit }) {
1807
+ useInitializeGameObject((scene) => {
1808
+ const { alpha, endAngle, fillColor, radius, startAngle, x, y } = __props.configuration;
1809
+ const arc = scene.add.arc(x, y, radius, startAngle, endAngle, void 0, fillColor, alpha);
1810
+ __props.onComplete?.(scene, arc);
1811
+ return arc;
1812
+ }, () => __props.configuration, __emit, ArcSetterMap, __props.immediate);
1813
+ return (_ctx, _cache) => {
1814
+ return null;
1815
+ };
1150
1816
  }
1151
- }), Wt = (...e) => {
1152
- k(D.Shutdown, ...e);
1153
- }, Gt = (e, t) => {
1154
- let n = p([]);
1155
- return t ? n.value = e(N(E())) : A((t) => {
1156
- n.value = e(t);
1157
- }), Wt((e) => {
1158
- for (let { key: t } of n.value) t && e.anims.remove(t);
1159
- }), n;
1160
- }, Kt = (e, t) => {
1161
- e.value = {
1162
- ...t,
1163
- onComplete: (...n) => {
1164
- e.value = void 0, t.onComplete?.(...n);
1817
+ });
1818
+ //#endregion
1819
+ //#region src/hooks/onShutdown.ts
1820
+ const onShutdown = (...args) => {
1821
+ pushListener("Shutdown", ...args);
1822
+ };
1823
+ //#endregion
1824
+ //#region src/composables/useAnimations.ts
1825
+ const useAnimations = (createConfigurations, immediate) => {
1826
+ const animations = ref([]);
1827
+ if (immediate) {
1828
+ const sceneKey = useInjectSceneKey();
1829
+ animations.value = createConfigurations(getScene(sceneKey));
1830
+ } else onNextTick((scene) => {
1831
+ animations.value = createConfigurations(scene);
1832
+ });
1833
+ onShutdown((scene) => {
1834
+ for (const { key } of animations.value) {
1835
+ if (!key) continue;
1836
+ scene.anims.remove(key);
1837
+ }
1838
+ });
1839
+ return animations;
1840
+ };
1841
+ //#endregion
1842
+ //#region src/composables/useTween.ts
1843
+ const useTween = (tween, newTween) => {
1844
+ tween.value = {
1845
+ ...newTween,
1846
+ onComplete: (...args) => {
1847
+ tween.value = void 0;
1848
+ newTween.onComplete?.(...args);
1165
1849
  }
1166
1850
  };
1167
- }, qt = (...e) => {
1168
- k(D.Init, ...e);
1169
- }, Jt = (...e) => {
1170
- k(D.Preload, ...e);
1171
- }, Yt = (...e) => {
1172
- k(D.Update, ...e);
1173
- }, Xt = (e, t) => new Promise((n) => {
1174
- e.time.delayedCall(t, () => {
1175
- n();
1851
+ };
1852
+ //#endregion
1853
+ //#region src/hooks/onInit.ts
1854
+ const onInit = (...args) => {
1855
+ pushListener("Init", ...args);
1856
+ };
1857
+ //#endregion
1858
+ //#region src/hooks/onPreload.ts
1859
+ const onPreload = (...args) => {
1860
+ pushListener("Preload", ...args);
1861
+ };
1862
+ //#endregion
1863
+ //#region src/hooks/onUpdate.ts
1864
+ const onUpdate = (...args) => {
1865
+ pushListener("Update", ...args);
1866
+ };
1867
+ //#endregion
1868
+ //#region src/util/sleep.ts
1869
+ const sleep = (scene, ms) => new Promise((resolve) => {
1870
+ scene.time.delayedCall(ms, () => {
1871
+ resolve();
1176
1872
  });
1177
- }), Zt = C.FileTypes.JSONFile, Qt = class extends Zt {};
1873
+ });
1874
+ //#endregion
1875
+ //#region src/models/plugins/TilemapFile.ts
1876
+ const JSONFile = Loader.FileTypes.JSONFile;
1877
+ var TilemapFile = class extends JSONFile {};
1178
1878
  //#endregion
1179
- export { H as AlphaSetterMap, J as AlphaSingleSetterMap, Ke as AnimationSetterMap, Ut as Arc, zt as ArcSetterMap, Me as BaseTextureSetterMap, Ht as BitmapText, Vt as BitmapTextSetterMap, U as BlendModeSetterMap, Bt as Circle, F as ComputedSizeSetterMap, Rt as Container, Lt as ContainerSetterMap, It as Curve, Ft as CurveSetterMap, I as DepthSetterMap, De as DisplaySizeSetterMap, ye as EVENT_PREFIX, Pt as Ellipse, Nt as EllipseSetterMap, O as ExternalSceneStore, W as FlipSetterMap, Mt as Game, ve as GameObjectEventMap, Oe as GameObjectSetterMap, V as GlobalSetterMap, Ct as Graphics, St as GraphicsSetterMap, xt as Image, bt as ImageSetterMap, T as InjectionKeyMap, yt as IsoBox, vt as IsoBoxSetterMap, ht as IsoSetterMap, _t as IsoTriangle, gt as IsoTriangleSetterMap, D as Lifecycle, mt as Line, pt as LineSetterMap, G as MaskSetterMap, ft as Nineslice, dt as NinesliceSetterMap, L as OriginSetterMap, ut as Particles, lt as ParticlesSetterMap, ct as PathFollower, ot as PathFollowerComponentSetterMap, st as PathFollowerSetterMap, at as Polygon, it as PolygonSetterMap, rt as Rectangle, nt as RectangleSetterMap, K as RenderNodesSetterMap, tt as RenderTexture, et as RenderTextureSetterMap, $e as Scene, R as ScrollFactorSetterMap, Y as ShapeSetterMap, Z as SizeSetterMap, Je as Sprite, qe as SpriteSetterMap, Ge as Star, We as StarSetterMap, kt as TILEMAP_TILED_JSON_EXTERNAL_KEY, Ue as Text, He as TextSetterMap, Ne as TextureCropSetterMap, X as TextureSetterMap, ze as TileSprite, Re as TileSpriteSetterMap, Ot as TiledJSONExternalFile, Be as Tilemap, Qt as TilemapFile, Tt as TilesetFile, q as TintSetterMap, z as TransformSetterMap, Le as Triangle, Ie as TriangleSetterMap, ke as TweenSetterMap, Fe as Video, Pe as VideoSetterMap, B as VisibleSetterMap, je as Zone, Ae as ZoneSetterMap, Qe as createSceneClass, ge as getDepthInsertIndex, be as getEventName, Ee as getInitializeGameObjectLifecycleHook, N as getScene, Ce as getUpdateEvent, xe as isEvent, Te as onCreate, qt as onInit, A as onNextTick, Jt as onPreload, Wt as onShutdown, Yt as onUpdate, _e as pushGameObject, k as pushListener, jt as registerTiledJSONExternalLoader, Ze as resetLifecycleListeners, Q as runLifecycleListeners, Xt as sleep, Gt as useAnimations, Ye as useCameraStore, M as useGame, P as useInitializeGameObject, Se as useInitializeGameObjectEvents, we as useInitializeGameObjectSetters, E as useInjectSceneKey, Xe as useInputStore, j as usePhaserStore, Ve as useTextStore, Kt as useTween };
1879
+ export { AlphaSetterMap, AlphaSingleSetterMap, AnimationSetterMap, _sfc_main as Arc, ArcSetterMap, BaseTextureSetterMap, _sfc_main$1 as BitmapText, BitmapTextSetterMap, BlendModeSetterMap, _sfc_main$2 as Circle, ComputedSizeSetterMap, _sfc_main$3 as Container, ContainerSetterMap, _sfc_main$4 as Curve, CurveSetterMap, DepthSetterMap, DisplaySizeSetterMap, EVENT_PREFIX, _sfc_main$5 as Ellipse, EllipseSetterMap, ExternalSceneStore, FlipSetterMap, _sfc_main$6 as Game, GameObjectEventMap, GameObjectSetterMap, GlobalSetterMap, _sfc_main$7 as Graphics, GraphicsSetterMap, _sfc_main$8 as Image, ImageSetterMap, InjectionKeyMap, _sfc_main$9 as IsoBox, IsoBoxSetterMap, IsoSetterMap, _sfc_main$10 as IsoTriangle, IsoTriangleSetterMap, Lifecycle, _sfc_main$11 as Line, LineSetterMap, MaskSetterMap, _sfc_main$12 as Nineslice, NinesliceSetterMap, OriginSetterMap, _sfc_main$13 as Particles, ParticlesSetterMap, _sfc_main$14 as PathFollower, PathFollowerComponentSetterMap, PathFollowerSetterMap, _sfc_main$15 as Polygon, PolygonSetterMap, _sfc_main$16 as Rectangle, RectangleSetterMap, RenderNodesSetterMap, _sfc_main$17 as RenderTexture, RenderTextureSetterMap, _sfc_main$18 as Scene, ScrollFactorSetterMap, ShapeSetterMap, SizeSetterMap, _sfc_main$19 as Sprite, SpriteSetterMap, _sfc_main$20 as Star, StarSetterMap, TILEMAP_TILED_JSON_EXTERNAL_KEY, _sfc_main$21 as Text, TextSetterMap, TextureCropSetterMap, TextureSetterMap, _sfc_main$22 as TileSprite, TileSpriteSetterMap, TiledJSONExternalFile, _sfc_main$23 as Tilemap, TilemapFile, TilesetFile, TintSetterMap, TransformSetterMap, _sfc_main$24 as Triangle, TriangleSetterMap, TweenSetterMap, _sfc_main$25 as Video, VideoSetterMap, VisibleSetterMap, _sfc_main$26 as Zone, ZoneSetterMap, createSceneClass, getDepthInsertIndex, getEventName, getInitializeGameObjectLifecycleHook, getScene, getUpdateEvent, isEvent, onCreate, onInit, onNextTick, onPreload, onShutdown, onUpdate, pushGameObject, pushListener, registerTiledJSONExternalLoader, resetLifecycleListeners, runLifecycleListeners, sleep, useAnimations, useCameraStore, useGame, useInitializeGameObject, useInitializeGameObjectEvents, useInitializeGameObjectSetters, useInjectSceneKey, useInputStore, usePhaserStore, useTextStore, useTween };