@rb-games/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (388) hide show
  1. package/README.md +488 -0
  2. package/dist/devtools/DraggableController.d.ts +10 -0
  3. package/dist/devtools/DraggableController.d.ts.map +1 -0
  4. package/dist/devtools/ResizableController.d.ts +19 -0
  5. package/dist/devtools/ResizableController.d.ts.map +1 -0
  6. package/dist/devtools/index.d.ts +7 -0
  7. package/dist/devtools/index.d.ts.map +1 -0
  8. package/dist/devtools/index.js +884 -0
  9. package/dist/devtools/index.js.map +1 -0
  10. package/dist/devtools/overlayPlugin.d.ts +3 -0
  11. package/dist/devtools/overlayPlugin.d.ts.map +1 -0
  12. package/dist/devtools/spinePropertiesPlugin.d.ts +3 -0
  13. package/dist/devtools/spinePropertiesPlugin.d.ts.map +1 -0
  14. package/dist/devtools/spriteTextPropertiesPlugin.d.ts +3 -0
  15. package/dist/devtools/spriteTextPropertiesPlugin.d.ts.map +1 -0
  16. package/dist/devtools/treePlugin.d.ts +7 -0
  17. package/dist/devtools/treePlugin.d.ts.map +1 -0
  18. package/dist/engine/PixiEngine.d.ts +404 -0
  19. package/dist/engine/PixiEngine.d.ts.map +1 -0
  20. package/dist/engine/index.d.ts +2 -0
  21. package/dist/engine/index.d.ts.map +1 -0
  22. package/dist/engine/index.js +1818 -0
  23. package/dist/engine/index.js.map +1 -0
  24. package/dist/filters/ChromaKeyFilter.d.ts +64 -0
  25. package/dist/filters/ChromaKeyFilter.d.ts.map +1 -0
  26. package/dist/filters/index.d.ts +2 -0
  27. package/dist/filters/index.d.ts.map +1 -0
  28. package/dist/filters/index.js +248 -0
  29. package/dist/filters/index.js.map +1 -0
  30. package/dist/helpers/AssetHelper.d.ts +117 -0
  31. package/dist/helpers/AssetHelper.d.ts.map +1 -0
  32. package/dist/helpers/SVGAssetHelper.d.ts +397 -0
  33. package/dist/helpers/SVGAssetHelper.d.ts.map +1 -0
  34. package/dist/helpers/SVGLoader.d.ts +46 -0
  35. package/dist/helpers/SVGLoader.d.ts.map +1 -0
  36. package/dist/helpers/SVGParser.d.ts +121 -0
  37. package/dist/helpers/SVGParser.d.ts.map +1 -0
  38. package/dist/helpers/eventBridge.d.ts +150 -0
  39. package/dist/helpers/eventBridge.d.ts.map +1 -0
  40. package/dist/helpers/index.d.ts +8 -0
  41. package/dist/helpers/index.d.ts.map +1 -0
  42. package/dist/helpers/index.js +702 -0
  43. package/dist/helpers/index.js.map +1 -0
  44. package/dist/helpers/mergeUtils.d.ts +21 -0
  45. package/dist/helpers/mergeUtils.d.ts.map +1 -0
  46. package/dist/helpers/resolvePublicPath.d.ts +6 -0
  47. package/dist/helpers/resolvePublicPath.d.ts.map +1 -0
  48. package/dist/i18n/index.d.ts +2 -0
  49. package/dist/i18n/index.d.ts.map +1 -0
  50. package/dist/i18n/index.js +527 -0
  51. package/dist/i18n/index.js.map +1 -0
  52. package/dist/i18n/sharedI18n.d.ts +11 -0
  53. package/dist/i18n/sharedI18n.d.ts.map +1 -0
  54. package/dist/layout/Align.d.ts +126 -0
  55. package/dist/layout/Align.d.ts.map +1 -0
  56. package/dist/layout/Bounds.d.ts +120 -0
  57. package/dist/layout/Bounds.d.ts.map +1 -0
  58. package/dist/layout/Distribute.d.ts +103 -0
  59. package/dist/layout/Distribute.d.ts.map +1 -0
  60. package/dist/layout/Flow.d.ts +213 -0
  61. package/dist/layout/Flow.d.ts.map +1 -0
  62. package/dist/layout/PositionUtils.d.ts +57 -0
  63. package/dist/layout/PositionUtils.d.ts.map +1 -0
  64. package/dist/layout/index.d.ts +6 -0
  65. package/dist/layout/index.d.ts.map +1 -0
  66. package/dist/layout/index.js +673 -0
  67. package/dist/layout/index.js.map +1 -0
  68. package/dist/particle/Emitter.d.ts +290 -0
  69. package/dist/particle/Emitter.d.ts.map +1 -0
  70. package/dist/particle/EmitterConfig.d.ts +228 -0
  71. package/dist/particle/EmitterConfig.d.ts.map +1 -0
  72. package/dist/particle/LinkedListContainer.d.ts +7 -0
  73. package/dist/particle/LinkedListContainer.d.ts.map +1 -0
  74. package/dist/particle/Particle.d.ts +63 -0
  75. package/dist/particle/Particle.d.ts.map +1 -0
  76. package/dist/particle/ParticleUtils.d.ts +97 -0
  77. package/dist/particle/ParticleUtils.d.ts.map +1 -0
  78. package/dist/particle/PropertyList.d.ts +40 -0
  79. package/dist/particle/PropertyList.d.ts.map +1 -0
  80. package/dist/particle/PropertyNode.d.ts +74 -0
  81. package/dist/particle/PropertyNode.d.ts.map +1 -0
  82. package/dist/particle/SpineEmitter.d.ts +55 -0
  83. package/dist/particle/SpineEmitter.d.ts.map +1 -0
  84. package/dist/particle/SpineParticle.d.ts +74 -0
  85. package/dist/particle/SpineParticle.d.ts.map +1 -0
  86. package/dist/particle/behaviors/AccelerationMovement.d.ts +62 -0
  87. package/dist/particle/behaviors/AccelerationMovement.d.ts.map +1 -0
  88. package/dist/particle/behaviors/Alpha.d.ts +60 -0
  89. package/dist/particle/behaviors/Alpha.d.ts.map +1 -0
  90. package/dist/particle/behaviors/AnimatedTexture.d.ts +111 -0
  91. package/dist/particle/behaviors/AnimatedTexture.d.ts.map +1 -0
  92. package/dist/particle/behaviors/Behaviors.d.ts +71 -0
  93. package/dist/particle/behaviors/Behaviors.d.ts.map +1 -0
  94. package/dist/particle/behaviors/BlendMode.d.ts +31 -0
  95. package/dist/particle/behaviors/BlendMode.d.ts.map +1 -0
  96. package/dist/particle/behaviors/BurstSpawn.d.ts +43 -0
  97. package/dist/particle/behaviors/BurstSpawn.d.ts.map +1 -0
  98. package/dist/particle/behaviors/Color.d.ts +60 -0
  99. package/dist/particle/behaviors/Color.d.ts.map +1 -0
  100. package/dist/particle/behaviors/MultiStateAnimatedTexture.d.ts +99 -0
  101. package/dist/particle/behaviors/MultiStateAnimatedTexture.d.ts.map +1 -0
  102. package/dist/particle/behaviors/OrderedTexture.d.ts +33 -0
  103. package/dist/particle/behaviors/OrderedTexture.d.ts.map +1 -0
  104. package/dist/particle/behaviors/PathMovement.d.ts +68 -0
  105. package/dist/particle/behaviors/PathMovement.d.ts.map +1 -0
  106. package/dist/particle/behaviors/PointSpawn.d.ts +21 -0
  107. package/dist/particle/behaviors/PointSpawn.d.ts.map +1 -0
  108. package/dist/particle/behaviors/RandomColor.d.ts +17 -0
  109. package/dist/particle/behaviors/RandomColor.d.ts.map +1 -0
  110. package/dist/particle/behaviors/RandomTexture.d.ts +32 -0
  111. package/dist/particle/behaviors/RandomTexture.d.ts.map +1 -0
  112. package/dist/particle/behaviors/Rotation.d.ts +114 -0
  113. package/dist/particle/behaviors/Rotation.d.ts.map +1 -0
  114. package/dist/particle/behaviors/Scale.d.ts +74 -0
  115. package/dist/particle/behaviors/Scale.d.ts.map +1 -0
  116. package/dist/particle/behaviors/ShapeSpawn.d.ts +58 -0
  117. package/dist/particle/behaviors/ShapeSpawn.d.ts.map +1 -0
  118. package/dist/particle/behaviors/SingleTexture.d.ts +32 -0
  119. package/dist/particle/behaviors/SingleTexture.d.ts.map +1 -0
  120. package/dist/particle/behaviors/SpeedMovement.d.ts +76 -0
  121. package/dist/particle/behaviors/SpeedMovement.d.ts.map +1 -0
  122. package/dist/particle/behaviors/SpineTexture.d.ts +173 -0
  123. package/dist/particle/behaviors/SpineTexture.d.ts.map +1 -0
  124. package/dist/particle/behaviors/ZindexBehavior.d.ts +16 -0
  125. package/dist/particle/behaviors/ZindexBehavior.d.ts.map +1 -0
  126. package/dist/particle/behaviors/editor/Types.d.ts +104 -0
  127. package/dist/particle/behaviors/editor/Types.d.ts.map +1 -0
  128. package/dist/particle/behaviors/editor/behaviors/AccelerationMovement.d.ts +2 -0
  129. package/dist/particle/behaviors/editor/behaviors/AccelerationMovement.d.ts.map +1 -0
  130. package/dist/particle/behaviors/editor/behaviors/Alpha.d.ts +2 -0
  131. package/dist/particle/behaviors/editor/behaviors/Alpha.d.ts.map +1 -0
  132. package/dist/particle/behaviors/editor/behaviors/AnimatedTexture.d.ts +2 -0
  133. package/dist/particle/behaviors/editor/behaviors/AnimatedTexture.d.ts.map +1 -0
  134. package/dist/particle/behaviors/editor/behaviors/BlendMode.d.ts +2 -0
  135. package/dist/particle/behaviors/editor/behaviors/BlendMode.d.ts.map +1 -0
  136. package/dist/particle/behaviors/editor/behaviors/BurstSpawn.d.ts +2 -0
  137. package/dist/particle/behaviors/editor/behaviors/BurstSpawn.d.ts.map +1 -0
  138. package/dist/particle/behaviors/editor/behaviors/Color.d.ts +2 -0
  139. package/dist/particle/behaviors/editor/behaviors/Color.d.ts.map +1 -0
  140. package/dist/particle/behaviors/editor/behaviors/OrderedTexture.d.ts +2 -0
  141. package/dist/particle/behaviors/editor/behaviors/OrderedTexture.d.ts.map +1 -0
  142. package/dist/particle/behaviors/editor/behaviors/PathMovement.d.ts +2 -0
  143. package/dist/particle/behaviors/editor/behaviors/PathMovement.d.ts.map +1 -0
  144. package/dist/particle/behaviors/editor/behaviors/PointSpawn.d.ts +2 -0
  145. package/dist/particle/behaviors/editor/behaviors/PointSpawn.d.ts.map +1 -0
  146. package/dist/particle/behaviors/editor/behaviors/RandomTexture.d.ts +2 -0
  147. package/dist/particle/behaviors/editor/behaviors/RandomTexture.d.ts.map +1 -0
  148. package/dist/particle/behaviors/editor/behaviors/Rotation.d.ts +2 -0
  149. package/dist/particle/behaviors/editor/behaviors/Rotation.d.ts.map +1 -0
  150. package/dist/particle/behaviors/editor/behaviors/Scale.d.ts +2 -0
  151. package/dist/particle/behaviors/editor/behaviors/Scale.d.ts.map +1 -0
  152. package/dist/particle/behaviors/editor/behaviors/ShapeSpawn.d.ts +2 -0
  153. package/dist/particle/behaviors/editor/behaviors/ShapeSpawn.d.ts.map +1 -0
  154. package/dist/particle/behaviors/editor/behaviors/SingleTexture.d.ts +2 -0
  155. package/dist/particle/behaviors/editor/behaviors/SingleTexture.d.ts.map +1 -0
  156. package/dist/particle/behaviors/editor/behaviors/SpeedMovement.d.ts +2 -0
  157. package/dist/particle/behaviors/editor/behaviors/SpeedMovement.d.ts.map +1 -0
  158. package/dist/particle/behaviors/editor/behaviors/index.d.ts +15 -0
  159. package/dist/particle/behaviors/editor/behaviors/index.d.ts.map +1 -0
  160. package/dist/particle/behaviors/editor/index.d.ts +5 -0
  161. package/dist/particle/behaviors/editor/index.d.ts.map +1 -0
  162. package/dist/particle/behaviors/editor/shapes/PolygonalChain.d.ts +2 -0
  163. package/dist/particle/behaviors/editor/shapes/PolygonalChain.d.ts.map +1 -0
  164. package/dist/particle/behaviors/editor/shapes/Rectangle.d.ts +2 -0
  165. package/dist/particle/behaviors/editor/shapes/Rectangle.d.ts.map +1 -0
  166. package/dist/particle/behaviors/editor/shapes/Torus.d.ts +2 -0
  167. package/dist/particle/behaviors/editor/shapes/Torus.d.ts.map +1 -0
  168. package/dist/particle/behaviors/index.d.ts +25 -0
  169. package/dist/particle/behaviors/index.d.ts.map +1 -0
  170. package/dist/particle/behaviors/shapes/PolygonalChain.d.ts +57 -0
  171. package/dist/particle/behaviors/shapes/PolygonalChain.d.ts.map +1 -0
  172. package/dist/particle/behaviors/shapes/Rectangle.d.ts +59 -0
  173. package/dist/particle/behaviors/shapes/Rectangle.d.ts.map +1 -0
  174. package/dist/particle/behaviors/shapes/SpawnShape.d.ts +32 -0
  175. package/dist/particle/behaviors/shapes/SpawnShape.d.ts.map +1 -0
  176. package/dist/particle/behaviors/shapes/Torus.d.ts +71 -0
  177. package/dist/particle/behaviors/shapes/Torus.d.ts.map +1 -0
  178. package/dist/particle/behaviors/shapes/index.d.ts +5 -0
  179. package/dist/particle/behaviors/shapes/index.d.ts.map +1 -0
  180. package/dist/particle/index.d.ts +11 -0
  181. package/dist/particle/index.d.ts.map +1 -0
  182. package/dist/particle/index.js +2845 -0
  183. package/dist/particle/index.js.map +1 -0
  184. package/dist/plugins/Plugin.types.d.ts +80 -0
  185. package/dist/plugins/Plugin.types.d.ts.map +1 -0
  186. package/dist/plugins/device/DeviceOptimizerPlugin.d.ts +187 -0
  187. package/dist/plugins/device/DeviceOptimizerPlugin.d.ts.map +1 -0
  188. package/dist/plugins/device/DeviceOptimizerPlugin.types.d.ts +134 -0
  189. package/dist/plugins/device/DeviceOptimizerPlugin.types.d.ts.map +1 -0
  190. package/dist/plugins/device/index.d.ts +3 -0
  191. package/dist/plugins/device/index.d.ts.map +1 -0
  192. package/dist/plugins/display/DisplayPlugin.d.ts +208 -0
  193. package/dist/plugins/display/DisplayPlugin.d.ts.map +1 -0
  194. package/dist/plugins/display/DisplayPlugin.types.d.ts +174 -0
  195. package/dist/plugins/display/DisplayPlugin.types.d.ts.map +1 -0
  196. package/dist/plugins/display/displayViewport.d.ts +10 -0
  197. package/dist/plugins/display/displayViewport.d.ts.map +1 -0
  198. package/dist/plugins/display/index.d.ts +4 -0
  199. package/dist/plugins/display/index.d.ts.map +1 -0
  200. package/dist/plugins/eventbus/EventBusPlugin.d.ts +21 -0
  201. package/dist/plugins/eventbus/EventBusPlugin.d.ts.map +1 -0
  202. package/dist/plugins/eventbus/EventBusPlugin.types.d.ts +24 -0
  203. package/dist/plugins/eventbus/EventBusPlugin.types.d.ts.map +1 -0
  204. package/dist/plugins/eventbus/index.d.ts +3 -0
  205. package/dist/plugins/eventbus/index.d.ts.map +1 -0
  206. package/dist/plugins/gsap/GsapPlugin.d.ts +307 -0
  207. package/dist/plugins/gsap/GsapPlugin.d.ts.map +1 -0
  208. package/dist/plugins/gsap/index.d.ts +2 -0
  209. package/dist/plugins/gsap/index.d.ts.map +1 -0
  210. package/dist/plugins/index.d.ts +13 -0
  211. package/dist/plugins/index.d.ts.map +1 -0
  212. package/dist/plugins/index.js +12806 -0
  213. package/dist/plugins/index.js.map +1 -0
  214. package/dist/plugins/input/InputPlugin.const.d.ts +80 -0
  215. package/dist/plugins/input/InputPlugin.const.d.ts.map +1 -0
  216. package/dist/plugins/input/InputPlugin.d.ts +141 -0
  217. package/dist/plugins/input/InputPlugin.d.ts.map +1 -0
  218. package/dist/plugins/input/InputPlugin.types.d.ts +41 -0
  219. package/dist/plugins/input/InputPlugin.types.d.ts.map +1 -0
  220. package/dist/plugins/input/KeyboardManager.d.ts +139 -0
  221. package/dist/plugins/input/KeyboardManager.d.ts.map +1 -0
  222. package/dist/plugins/input/KeyboardManager.types.d.ts +27 -0
  223. package/dist/plugins/input/KeyboardManager.types.d.ts.map +1 -0
  224. package/dist/plugins/input/index.d.ts +4 -0
  225. package/dist/plugins/input/index.d.ts.map +1 -0
  226. package/dist/plugins/language/I18NextPlugin.d.ts +30 -0
  227. package/dist/plugins/language/I18NextPlugin.d.ts.map +1 -0
  228. package/dist/plugins/language/I18NextPlugin.types.d.ts +29 -0
  229. package/dist/plugins/language/I18NextPlugin.types.d.ts.map +1 -0
  230. package/dist/plugins/language/index.d.ts +3 -0
  231. package/dist/plugins/language/index.d.ts.map +1 -0
  232. package/dist/plugins/resource/ResourcePlugin.d.ts +189 -0
  233. package/dist/plugins/resource/ResourcePlugin.d.ts.map +1 -0
  234. package/dist/plugins/resource/ResourcePlugin.types.d.ts +153 -0
  235. package/dist/plugins/resource/ResourcePlugin.types.d.ts.map +1 -0
  236. package/dist/plugins/resource/index.d.ts +3 -0
  237. package/dist/plugins/resource/index.d.ts.map +1 -0
  238. package/dist/plugins/scene/Scene.d.ts +203 -0
  239. package/dist/plugins/scene/Scene.d.ts.map +1 -0
  240. package/dist/plugins/scene/ScenePlugin.d.ts +162 -0
  241. package/dist/plugins/scene/ScenePlugin.d.ts.map +1 -0
  242. package/dist/plugins/scene/ScenePlugin.types.d.ts +35 -0
  243. package/dist/plugins/scene/ScenePlugin.types.d.ts.map +1 -0
  244. package/dist/plugins/scene/index.d.ts +4 -0
  245. package/dist/plugins/scene/index.d.ts.map +1 -0
  246. package/dist/plugins/sentry/SentryPlugin.d.ts +66 -0
  247. package/dist/plugins/sentry/SentryPlugin.d.ts.map +1 -0
  248. package/dist/plugins/sentry/SentryPlugin.types.d.ts +8 -0
  249. package/dist/plugins/sentry/SentryPlugin.types.d.ts.map +1 -0
  250. package/dist/plugins/sentry/index.d.ts +3 -0
  251. package/dist/plugins/sentry/index.d.ts.map +1 -0
  252. package/dist/plugins/service/ServiceAdapter.d.ts +88 -0
  253. package/dist/plugins/service/ServiceAdapter.d.ts.map +1 -0
  254. package/dist/plugins/service/ServiceEventHelper.d.ts +6 -0
  255. package/dist/plugins/service/ServiceEventHelper.d.ts.map +1 -0
  256. package/dist/plugins/service/ServicePlugin.d.ts +135 -0
  257. package/dist/plugins/service/ServicePlugin.d.ts.map +1 -0
  258. package/dist/plugins/service/ServicePlugin.types.d.ts +14 -0
  259. package/dist/plugins/service/ServicePlugin.types.d.ts.map +1 -0
  260. package/dist/plugins/service/adapters/DevAuthAdapter.d.ts +56 -0
  261. package/dist/plugins/service/adapters/DevAuthAdapter.d.ts.map +1 -0
  262. package/dist/plugins/service/adapters/RGSAdapter.d.ts +82 -0
  263. package/dist/plugins/service/adapters/RGSAdapter.d.ts.map +1 -0
  264. package/dist/plugins/service/adapters/index.d.ts +7 -0
  265. package/dist/plugins/service/adapters/index.d.ts.map +1 -0
  266. package/dist/plugins/service/adapters/resolvePublicIp.d.ts +10 -0
  267. package/dist/plugins/service/adapters/resolvePublicIp.d.ts.map +1 -0
  268. package/dist/plugins/service/index.d.ts +10 -0
  269. package/dist/plugins/service/index.d.ts.map +1 -0
  270. package/dist/plugins/service/types/api.types.d.ts +299 -0
  271. package/dist/plugins/service/types/api.types.d.ts.map +1 -0
  272. package/dist/plugins/service/types/index.d.ts +6 -0
  273. package/dist/plugins/service/types/index.d.ts.map +1 -0
  274. package/dist/plugins/skin/ISkin.d.ts +62 -0
  275. package/dist/plugins/skin/ISkin.d.ts.map +1 -0
  276. package/dist/plugins/skin/Skin.d.ts +155 -0
  277. package/dist/plugins/skin/Skin.d.ts.map +1 -0
  278. package/dist/plugins/skin/SkinPlugin.d.ts +285 -0
  279. package/dist/plugins/skin/SkinPlugin.d.ts.map +1 -0
  280. package/dist/plugins/skin/SkinPlugin.types.d.ts +56 -0
  281. package/dist/plugins/skin/SkinPlugin.types.d.ts.map +1 -0
  282. package/dist/plugins/skin/index.d.ts +5 -0
  283. package/dist/plugins/skin/index.d.ts.map +1 -0
  284. package/dist/plugins/sound/SoundPlugin.d.ts +319 -0
  285. package/dist/plugins/sound/SoundPlugin.d.ts.map +1 -0
  286. package/dist/plugins/sound/SoundPlugin.types.d.ts +102 -0
  287. package/dist/plugins/sound/SoundPlugin.types.d.ts.map +1 -0
  288. package/dist/plugins/sound/SoundTestGUI.d.ts +42 -0
  289. package/dist/plugins/sound/SoundTestGUI.d.ts.map +1 -0
  290. package/dist/plugins/sound/index.d.ts +4 -0
  291. package/dist/plugins/sound/index.d.ts.map +1 -0
  292. package/dist/state-machine/ConfigBuilder.d.ts +239 -0
  293. package/dist/state-machine/ConfigBuilder.d.ts.map +1 -0
  294. package/dist/state-machine/StateMachine.d.ts +251 -0
  295. package/dist/state-machine/StateMachine.d.ts.map +1 -0
  296. package/dist/state-machine/guards.d.ts +151 -0
  297. package/dist/state-machine/guards.d.ts.map +1 -0
  298. package/dist/state-machine/index.d.ts +5 -0
  299. package/dist/state-machine/index.d.ts.map +1 -0
  300. package/dist/state-machine/index.js +954 -0
  301. package/dist/state-machine/index.js.map +1 -0
  302. package/dist/state-machine/types.d.ts +65 -0
  303. package/dist/state-machine/types.d.ts.map +1 -0
  304. package/dist/store/DataStore.d.ts +167 -0
  305. package/dist/store/DataStore.d.ts.map +1 -0
  306. package/dist/store/index.d.ts +3 -0
  307. package/dist/store/index.d.ts.map +1 -0
  308. package/dist/store/index.js +197 -0
  309. package/dist/store/index.js.map +1 -0
  310. package/dist/ui/behaviors/ButtonBehavior.d.ts +245 -0
  311. package/dist/ui/behaviors/ButtonBehavior.d.ts.map +1 -0
  312. package/dist/ui/behaviors/InputBehavior.d.ts +169 -0
  313. package/dist/ui/behaviors/InputBehavior.d.ts.map +1 -0
  314. package/dist/ui/behaviors/ScrollbarBehavior.d.ts +371 -0
  315. package/dist/ui/behaviors/ScrollbarBehavior.d.ts.map +1 -0
  316. package/dist/ui/behaviors/index.d.ts +4 -0
  317. package/dist/ui/behaviors/index.d.ts.map +1 -0
  318. package/dist/ui/components/ButtonComp.d.ts +138 -0
  319. package/dist/ui/components/ButtonComp.d.ts.map +1 -0
  320. package/dist/ui/components/Comp.utils.d.ts +390 -0
  321. package/dist/ui/components/Comp.utils.d.ts.map +1 -0
  322. package/dist/ui/components/Component.types.d.ts +41 -0
  323. package/dist/ui/components/Component.types.d.ts.map +1 -0
  324. package/dist/ui/components/InputComp.d.ts +43 -0
  325. package/dist/ui/components/InputComp.d.ts.map +1 -0
  326. package/dist/ui/components/LabelBox.d.ts +49 -0
  327. package/dist/ui/components/LabelBox.d.ts.map +1 -0
  328. package/dist/ui/components/ListTableComp.d.ts +106 -0
  329. package/dist/ui/components/ListTableComp.d.ts.map +1 -0
  330. package/dist/ui/components/Skinable.d.ts +261 -0
  331. package/dist/ui/components/Skinable.d.ts.map +1 -0
  332. package/dist/ui/components/SliderComp.d.ts +60 -0
  333. package/dist/ui/components/SliderComp.d.ts.map +1 -0
  334. package/dist/ui/components/SpriteTextBBCode.d.ts +16 -0
  335. package/dist/ui/components/SpriteTextBBCode.d.ts.map +1 -0
  336. package/dist/ui/components/StepperComp.d.ts +89 -0
  337. package/dist/ui/components/StepperComp.d.ts.map +1 -0
  338. package/dist/ui/components/index.d.ts +12 -0
  339. package/dist/ui/components/index.d.ts.map +1 -0
  340. package/dist/ui/components/spriteText/SpriteText.d.ts +114 -0
  341. package/dist/ui/components/spriteText/SpriteText.d.ts.map +1 -0
  342. package/dist/ui/components/spriteText/SpriteText.types.d.ts +109 -0
  343. package/dist/ui/components/spriteText/SpriteText.types.d.ts.map +1 -0
  344. package/dist/ui/components/spriteText/SpriteTextAlignment.d.ts +25 -0
  345. package/dist/ui/components/spriteText/SpriteTextAlignment.d.ts.map +1 -0
  346. package/dist/ui/components/spriteText/SpriteTextBezier.d.ts +20 -0
  347. package/dist/ui/components/spriteText/SpriteTextBezier.d.ts.map +1 -0
  348. package/dist/ui/components/spriteText/SpriteTextCurve.d.ts +4 -0
  349. package/dist/ui/components/spriteText/SpriteTextCurve.d.ts.map +1 -0
  350. package/dist/ui/components/spriteText/SpriteTextKerning.d.ts +7 -0
  351. package/dist/ui/components/spriteText/SpriteTextKerning.d.ts.map +1 -0
  352. package/dist/ui/components/spriteText/SpriteTextTexture.d.ts +16 -0
  353. package/dist/ui/components/spriteText/SpriteTextTexture.d.ts.map +1 -0
  354. package/dist/ui/components/spriteText/SpriteTextWrap.d.ts +19 -0
  355. package/dist/ui/components/spriteText/SpriteTextWrap.d.ts.map +1 -0
  356. package/dist/ui/components/spriteText/index.d.ts +3 -0
  357. package/dist/ui/components/spriteText/index.d.ts.map +1 -0
  358. package/dist/ui/index.d.ts +3 -0
  359. package/dist/ui/index.d.ts.map +1 -0
  360. package/dist/ui/index.js +4778 -0
  361. package/dist/ui/index.js.map +1 -0
  362. package/dist/utils/ArrayUtils.d.ts +24 -0
  363. package/dist/utils/ArrayUtils.d.ts.map +1 -0
  364. package/dist/utils/ColorUtils.d.ts +34 -0
  365. package/dist/utils/ColorUtils.d.ts.map +1 -0
  366. package/dist/utils/DataInjector.d.ts +67 -0
  367. package/dist/utils/DataInjector.d.ts.map +1 -0
  368. package/dist/utils/Logger.d.ts +332 -0
  369. package/dist/utils/Logger.d.ts.map +1 -0
  370. package/dist/utils/NumberFormatter.d.ts +126 -0
  371. package/dist/utils/NumberFormatter.d.ts.map +1 -0
  372. package/dist/utils/ObjectUtils.d.ts +64 -0
  373. package/dist/utils/ObjectUtils.d.ts.map +1 -0
  374. package/dist/utils/PixiUtils.d.ts +118 -0
  375. package/dist/utils/PixiUtils.d.ts.map +1 -0
  376. package/dist/utils/Throttle.d.ts +103 -0
  377. package/dist/utils/Throttle.d.ts.map +1 -0
  378. package/dist/utils/index.d.ts +9 -0
  379. package/dist/utils/index.d.ts.map +1 -0
  380. package/dist/utils/index.js +899 -0
  381. package/dist/utils/index.js.map +1 -0
  382. package/dist/vite/index.d.ts +3 -0
  383. package/dist/vite/index.d.ts.map +1 -0
  384. package/dist/vite/index.js +126 -0
  385. package/dist/vite/index.js.map +1 -0
  386. package/dist/vite/mergeLocalesPlugin.d.ts +22 -0
  387. package/dist/vite/mergeLocalesPlugin.d.ts.map +1 -0
  388. package/package.json +143 -0
@@ -0,0 +1,899 @@
1
+ import { cloneDeep, merge, set, get } from 'lodash';
2
+ import { Rectangle, Color } from 'pixi.js';
3
+
4
+ // utils/Logger.ts
5
+ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
6
+ LogLevel2[LogLevel2["ERROR"] = 0] = "ERROR";
7
+ LogLevel2[LogLevel2["WARN"] = 1] = "WARN";
8
+ LogLevel2[LogLevel2["INFO"] = 2] = "INFO";
9
+ LogLevel2[LogLevel2["DEBUG"] = 3] = "DEBUG";
10
+ LogLevel2[LogLevel2["TRACE"] = 4] = "TRACE";
11
+ return LogLevel2;
12
+ })(LogLevel || {});
13
+ var Logger = class _Logger {
14
+ static instance;
15
+ config;
16
+ // Terminal colors (for Node.js environment)
17
+ terminalColors = {
18
+ reset: "\x1B[0m",
19
+ red: "\x1B[31m",
20
+ yellow: "\x1B[33m",
21
+ blue: "\x1B[34m",
22
+ green: "\x1B[32m",
23
+ gray: "\x1B[90m",
24
+ cyan: "\x1B[36m",
25
+ magenta: "\x1B[35m",
26
+ white: "\x1B[37m"
27
+ };
28
+ // Browser console colors (using CSS)
29
+ browserColors = {
30
+ timestamp: "color: gray",
31
+ context: "color: cyan; font-weight: bold",
32
+ message: "color: white",
33
+ error: "color: red; font-weight: bold",
34
+ warn: "color: orange; font-weight: bold",
35
+ info: "color: dodgerblue; font-weight: bold",
36
+ debug: "color: green",
37
+ trace: "color: gray"
38
+ };
39
+ levelLabels = {
40
+ [0 /* ERROR */]: "ERROR",
41
+ [1 /* WARN */]: "WARN",
42
+ [2 /* INFO */]: "INFO",
43
+ [3 /* DEBUG */]: "DEBUG",
44
+ [4 /* TRACE */]: "TRACE"
45
+ };
46
+ levelColors = {
47
+ [0 /* ERROR */]: this.terminalColors.red,
48
+ [1 /* WARN */]: this.terminalColors.yellow,
49
+ [2 /* INFO */]: this.terminalColors.blue,
50
+ [3 /* DEBUG */]: this.terminalColors.green,
51
+ [4 /* TRACE */]: this.terminalColors.gray
52
+ };
53
+ levelBrowserColors = {
54
+ [0 /* ERROR */]: this.browserColors.error,
55
+ [1 /* WARN */]: this.browserColors.warn,
56
+ [2 /* INFO */]: this.browserColors.info,
57
+ [3 /* DEBUG */]: this.browserColors.debug,
58
+ [4 /* TRACE */]: this.browserColors.trace
59
+ };
60
+ /**
61
+ * Private constructor for singleton pattern
62
+ */
63
+ constructor() {
64
+ var _a;
65
+ this.config = {
66
+ level: 3 /* DEBUG */,
67
+ // Default log level
68
+ enabled: true,
69
+ // Logging enabled by default
70
+ showTimestamp: false,
71
+ // Show timestamps by default
72
+ showColors: true
73
+ // Show colors by default
74
+ };
75
+ if ((_a = import.meta.env) == null ? void 0 : _a.DEV) {
76
+ console.warn(
77
+ "[Logger] For better debugging experience, add Logger.ts to DevTools ignore list:\nDevTools \u2192 Settings (F1) \u2192 Ignore List \u2192 Add pattern: /Logger\\.ts$"
78
+ );
79
+ }
80
+ }
81
+ /**
82
+ * Get the singleton instance of the Logger
83
+ */
84
+ static getInstance() {
85
+ if (!_Logger.instance) {
86
+ _Logger.instance = new _Logger();
87
+ }
88
+ return _Logger.instance;
89
+ }
90
+ /**
91
+ * Configure the logger
92
+ * @param config Configuration options
93
+ */
94
+ configure(config) {
95
+ this.config = { ...this.config, ...config };
96
+ }
97
+ /**
98
+ * Enable or disable logging
99
+ * @param enabled Whether logging is enabled
100
+ */
101
+ setEnabled(enabled) {
102
+ this.config.enabled = enabled;
103
+ }
104
+ /**
105
+ * Set the log level
106
+ * @param level The log level to set
107
+ */
108
+ setLevel(level) {
109
+ this.config.level = level;
110
+ }
111
+ /**
112
+ * Get the current log level
113
+ */
114
+ getLevel() {
115
+ return this.config.level;
116
+ }
117
+ /**
118
+ * Log an error message
119
+ * @param message The message to log
120
+ * @param args Additional arguments to log
121
+ */
122
+ error(message, ...args) {
123
+ this.log(0 /* ERROR */, message, ...args);
124
+ }
125
+ /**
126
+ * Log a warning message
127
+ * @param message The message to log
128
+ * @param args Additional arguments to log
129
+ */
130
+ warn(message, ...args) {
131
+ this.log(1 /* WARN */, message, ...args);
132
+ }
133
+ /**
134
+ * Log an info message
135
+ * @param message The message to log
136
+ * @param args Additional arguments to log
137
+ */
138
+ info(message, ...args) {
139
+ this.log(2 /* INFO */, message, ...args);
140
+ }
141
+ /**
142
+ * Log a debug message
143
+ * @param message The message to log
144
+ * @param args Additional arguments to log
145
+ */
146
+ debug(message, ...args) {
147
+ this.log(3 /* DEBUG */, message, ...args);
148
+ }
149
+ /**
150
+ * Log a trace message
151
+ * @param message The message to log
152
+ * @param args Additional arguments to log
153
+ */
154
+ trace(message, ...args) {
155
+ this.log(4 /* TRACE */, message, ...args);
156
+ }
157
+ /**
158
+ * Log a message with a specific log level
159
+ * @param level The log level
160
+ * @param message The message to log
161
+ * @param args Additional arguments to log
162
+ */
163
+ log(level, message, ...args) {
164
+ if (!this.config.enabled || level > this.config.level) {
165
+ return;
166
+ }
167
+ if (!this.shouldLogMessage(message)) {
168
+ return;
169
+ }
170
+ const isBrowser = typeof window !== "undefined";
171
+ if (isBrowser && this.config.showColors) {
172
+ this.logBrowser(level, message, ...args);
173
+ } else {
174
+ this.logTerminal(level, message, ...args);
175
+ }
176
+ }
177
+ extractContext(message) {
178
+ const contextMatch = message.match(/^\[([^\]]+)\]\s(.*)$/);
179
+ if (!contextMatch) {
180
+ return {
181
+ context: "",
182
+ messageContent: message
183
+ };
184
+ }
185
+ return {
186
+ context: contextMatch[1],
187
+ messageContent: contextMatch[2]
188
+ };
189
+ }
190
+ matchesFilter(value, matchers) {
191
+ if (!(matchers == null ? void 0 : matchers.length)) {
192
+ return false;
193
+ }
194
+ return matchers.some((matcher) => {
195
+ if (typeof matcher === "string") {
196
+ return value.includes(matcher);
197
+ }
198
+ matcher.lastIndex = 0;
199
+ return matcher.test(value);
200
+ });
201
+ }
202
+ shouldLogMessage(message) {
203
+ var _a, _b;
204
+ const filter = this.config.filter;
205
+ if (!filter) {
206
+ return true;
207
+ }
208
+ const hasFilters = Boolean(((_a = filter.contexts) == null ? void 0 : _a.length) || ((_b = filter.messages) == null ? void 0 : _b.length));
209
+ if (!hasFilters) {
210
+ return true;
211
+ }
212
+ const { context, messageContent } = this.extractContext(message);
213
+ const contextMatches = this.matchesFilter(context, filter.contexts);
214
+ const messageMatches = this.matchesFilter(messageContent, filter.messages);
215
+ const matches = contextMatches || messageMatches;
216
+ return filter.mode === "exclude" ? !matches : matches;
217
+ }
218
+ /**
219
+ * Log a message in terminal/node environment
220
+ */
221
+ logTerminal(level, message, ...args) {
222
+ let timestamp = "";
223
+ let levelStr = "";
224
+ let contextPart = "";
225
+ const contextMatch = message.match(/^\[([^\]]+)\]\s(.*)$/);
226
+ let messageContent = message;
227
+ if (contextMatch) {
228
+ contextPart = `[${contextMatch[1]}] `;
229
+ messageContent = contextMatch[2];
230
+ }
231
+ if (this.config.showTimestamp) {
232
+ const now = (/* @__PURE__ */ new Date()).toISOString();
233
+ timestamp = `[${now}] `;
234
+ }
235
+ levelStr = `[${this.levelLabels[level]}] `;
236
+ if (this.config.showColors) {
237
+ const levelColor = this.levelColors[level];
238
+ const contextColor = this.terminalColors.cyan;
239
+ const timestampColor = this.terminalColors.gray;
240
+ const messageColor = this.terminalColors.white;
241
+ timestamp = `${timestampColor}${timestamp}${this.terminalColors.reset}`;
242
+ levelStr = `${levelColor}${levelStr}${this.terminalColors.reset}`;
243
+ if (contextPart) {
244
+ contextPart = `${contextColor}${contextPart}${this.terminalColors.reset}`;
245
+ }
246
+ messageContent = `${messageColor}${messageContent}${this.terminalColors.reset}`;
247
+ }
248
+ const formattedMessage = timestamp + levelStr + contextPart + messageContent;
249
+ switch (level) {
250
+ case 0 /* ERROR */:
251
+ console.error(formattedMessage, ...args);
252
+ break;
253
+ case 1 /* WARN */:
254
+ console.warn(formattedMessage, ...args);
255
+ break;
256
+ case 2 /* INFO */:
257
+ console.info(formattedMessage, ...args);
258
+ break;
259
+ case 3 /* DEBUG */:
260
+ case 4 /* TRACE */:
261
+ default:
262
+ console.log(formattedMessage, ...args);
263
+ break;
264
+ }
265
+ }
266
+ /**
267
+ * Log a message in browser environment with CSS styling
268
+ */
269
+ logBrowser(level, message, ...args) {
270
+ const contextMatch = message.match(/^\[([^\]]+)\]\s(.*)$/);
271
+ let context = "";
272
+ let messageContent = message;
273
+ if (contextMatch) {
274
+ context = contextMatch[1];
275
+ messageContent = contextMatch[2];
276
+ }
277
+ let format = "";
278
+ const formatArgs = [];
279
+ if (this.config.showTimestamp) {
280
+ const now = (/* @__PURE__ */ new Date()).toISOString();
281
+ format += "%c[" + now + "] ";
282
+ formatArgs.push(this.browserColors.timestamp);
283
+ }
284
+ format += "%c[" + this.levelLabels[level] + "] ";
285
+ formatArgs.push(this.levelBrowserColors[level]);
286
+ if (context) {
287
+ format += "%c[" + context + "] ";
288
+ formatArgs.push(this.browserColors.context);
289
+ }
290
+ format += "%c" + messageContent;
291
+ formatArgs.push(this.browserColors.message);
292
+ switch (level) {
293
+ case 0 /* ERROR */:
294
+ console.error(format, ...formatArgs, ...args);
295
+ break;
296
+ case 1 /* WARN */:
297
+ console.warn(format, ...formatArgs, ...args);
298
+ break;
299
+ case 2 /* INFO */:
300
+ console.info(format, ...formatArgs, ...args);
301
+ break;
302
+ case 3 /* DEBUG */:
303
+ case 4 /* TRACE */:
304
+ default:
305
+ console.log(format, ...formatArgs, ...args);
306
+ break;
307
+ }
308
+ }
309
+ /**
310
+ * Creates a context-specific logger.
311
+ *
312
+ * Context loggers automatically prefix all log messages with a context tag.
313
+ * Commonly used in plugins and classes to identify log sources.
314
+ *
315
+ * @param context - Context name (e.g., 'MyPlugin', 'SceneManager')
316
+ * @returns ContextLogger instance
317
+ *
318
+ * @example
319
+ * ```typescript
320
+ * class DisplayPlugin {
321
+ * private logger = logger.createContextLogger('DisplayPlugin');
322
+ *
323
+ * initialize() {
324
+ * this.logger.info('Initializing display');
325
+ * // Output: [INFO] [DisplayPlugin] Initializing display
326
+ * }
327
+ * }
328
+ * ```
329
+ */
330
+ createContextLogger(context) {
331
+ return new ContextLogger(this, context);
332
+ }
333
+ };
334
+ var ContextLogger = class {
335
+ logger;
336
+ context;
337
+ constructor(logger2, context) {
338
+ this.logger = logger2;
339
+ this.context = context;
340
+ }
341
+ /**
342
+ * Log an error message
343
+ * @param message The message to log
344
+ * @param args Additional arguments to log
345
+ */
346
+ error(message, ...args) {
347
+ this.logger.error(`[${this.context}] ${message}`, ...args);
348
+ }
349
+ /**
350
+ * Log a warning message
351
+ * @param message The message to log
352
+ * @param args Additional arguments to log
353
+ */
354
+ warn(message, ...args) {
355
+ this.logger.warn(`[${this.context}] ${message}`, ...args);
356
+ }
357
+ /**
358
+ * Log an info message
359
+ * @param message The message to log
360
+ * @param args Additional arguments to log
361
+ */
362
+ info(message, ...args) {
363
+ this.logger.info(`[${this.context}] ${message}`, ...args);
364
+ }
365
+ /**
366
+ * Log a debug message
367
+ * @param message The message to log
368
+ * @param args Additional arguments to log
369
+ */
370
+ debug(message, ...args) {
371
+ this.logger.debug(`[${this.context}] ${message}`, ...args);
372
+ }
373
+ /**
374
+ * Log a trace message
375
+ * @param message The message to log
376
+ * @param args Additional arguments to log
377
+ */
378
+ trace(message, ...args) {
379
+ this.logger.trace(`[${this.context}] ${message}`, ...args);
380
+ }
381
+ };
382
+ var logger = Logger.getInstance();
383
+ var contextLoggers = /* @__PURE__ */ new Map();
384
+ function getLogger(context) {
385
+ let cached = contextLoggers.get(context);
386
+ if (!cached) {
387
+ cached = new ContextLogger(logger, context);
388
+ contextLoggers.set(context, cached);
389
+ }
390
+ return cached;
391
+ }
392
+ function DataInjector(obj, path, data, replace = false) {
393
+ const result = cloneDeep(obj);
394
+ if (path === "" || path === void 0 || path === null) {
395
+ return merge({}, result, cloneDeep(data));
396
+ }
397
+ if (replace) {
398
+ set(result, path, cloneDeep(data));
399
+ return result;
400
+ }
401
+ const current = get(result, path);
402
+ const merged = merge({}, current ?? {}, data);
403
+ set(result, path, merged);
404
+ return result;
405
+ }
406
+ function adjustColor(color, amount, sign) {
407
+ const colorObj = new Color(color);
408
+ const rgb = {
409
+ r: colorObj.red * 255,
410
+ g: colorObj.green * 255,
411
+ b: colorObj.blue * 255
412
+ };
413
+ const delta = 255 * amount * sign;
414
+ const newR = Math.max(0, Math.min(255, rgb.r + delta));
415
+ const newG = Math.max(0, Math.min(255, rgb.g + delta));
416
+ const newB = Math.max(0, Math.min(255, rgb.b + delta));
417
+ return new Color([newR / 255, newG / 255, newB / 255]);
418
+ }
419
+ function lightenColor(color, amount) {
420
+ return adjustColor(color, amount, 1);
421
+ }
422
+ function darkenColor(color, amount) {
423
+ return adjustColor(color, amount, -1);
424
+ }
425
+
426
+ // utils/NumberFormatter.ts
427
+ var DEFAULT_CONFIG = {
428
+ mask: "#,##0.##",
429
+ denom: 1,
430
+ expressThreshold: 1e3,
431
+ expressUnits: ["K", "M", "B", "T", "Q"],
432
+ decimalPrecision: 2,
433
+ roundedSymbol: "+"
434
+ };
435
+ var NumberFormatter = class _NumberFormatter {
436
+ static instance;
437
+ config;
438
+ maskCache = /* @__PURE__ */ new Map();
439
+ /**
440
+ * Private constructor for singleton pattern
441
+ */
442
+ constructor(config) {
443
+ this.config = config;
444
+ }
445
+ /**
446
+ * Configure the NumberFormatter singleton.
447
+ *
448
+ * @param config - Configuration options
449
+ * @returns NumberFormatter instance
450
+ */
451
+ static configure(config) {
452
+ const finalConfig = { ...DEFAULT_CONFIG, ...config };
453
+ if (!_NumberFormatter.instance) {
454
+ _NumberFormatter.instance = new _NumberFormatter(finalConfig);
455
+ } else {
456
+ _NumberFormatter.instance.config = finalConfig;
457
+ _NumberFormatter.instance.maskCache.clear();
458
+ }
459
+ return _NumberFormatter.instance;
460
+ }
461
+ /**
462
+ * Get the singleton instance.
463
+ *
464
+ * If not configured yet, initializes with default configuration.
465
+ *
466
+ * @returns NumberFormatter instance
467
+ */
468
+ static getInstance() {
469
+ if (!_NumberFormatter.instance) {
470
+ _NumberFormatter.instance = new _NumberFormatter(DEFAULT_CONFIG);
471
+ }
472
+ return _NumberFormatter.instance;
473
+ }
474
+ /**
475
+ * Format a number using the configured mask.
476
+ *
477
+ * @param value - Number to format
478
+ * @param options - Optional formatting options
479
+ * @returns Formatted string
480
+ *
481
+ * @example
482
+ * ```typescript
483
+ * formatter.format(1500); // "$ 15.00"
484
+ * formatter.format(1500, { forceDecimals: true }); // "$ 15.00"
485
+ * formatter.format(1500, { ignoreDenom: true }); // "$ 1,500.00"
486
+ * ```
487
+ */
488
+ format(value, options = {}) {
489
+ const { prefix = "", forceDecimals = false, ignoreDenom = false } = options;
490
+ const actualValue = ignoreDenom ? value : value * this.config.denom;
491
+ let mask = this.config.mask;
492
+ if (forceDecimals) {
493
+ mask = mask.replace(/\.##/g, ".00");
494
+ }
495
+ return this.applyMask(mask, actualValue) + prefix;
496
+ }
497
+ /**
498
+ * Format a number in express mode (shortened with K/M/B/T).
499
+ *
500
+ * @param value - Number to format
501
+ * @param options - Optional formatting options
502
+ * @returns Formatted string with unit suffix
503
+ *
504
+ * @example
505
+ * ```typescript
506
+ * formatter.express(150000); // "$ 1.5K"
507
+ * formatter.express(2500000); // "$ 2.5M"
508
+ * formatter.express(500, { threshold: 100 }); // "$ 0.5K"
509
+ * ```
510
+ */
511
+ express(value, options = {}) {
512
+ const {
513
+ prefix = "",
514
+ forceDecimals = false,
515
+ ignoreDenom = false,
516
+ threshold = this.config.expressThreshold
517
+ } = options;
518
+ const actualValue = ignoreDenom ? value : value * this.config.denom;
519
+ if (actualValue < threshold) {
520
+ return this.format(value, { prefix, forceDecimals, ignoreDenom });
521
+ }
522
+ let unitIndex = -1;
523
+ let shortenedNum = actualValue;
524
+ while (shortenedNum >= 1e3 && unitIndex < this.config.expressUnits.length - 1) {
525
+ shortenedNum /= 1e3;
526
+ unitIndex++;
527
+ }
528
+ const factor = Math.pow(10, this.config.decimalPrecision);
529
+ const roundedNum = Math.floor(shortenedNum * factor) / factor;
530
+ const isRounded = roundedNum < shortenedNum;
531
+ let mask = this.config.mask;
532
+ if (forceDecimals) {
533
+ mask = mask.replace(/\.##/g, ".00");
534
+ }
535
+ const parsed = this.parseMask(mask);
536
+ const formattedNumber = this.applyMask(parsed.pattern, roundedNum) + (this.config.expressUnits[unitIndex] || "") + (isRounded ? this.config.roundedSymbol : "");
537
+ return parsed.prefix + formattedNumber + parsed.suffix + prefix;
538
+ }
539
+ /**
540
+ * Parse a mask string into its components.
541
+ *
542
+ * @param mask - Mask string to parse
543
+ * @returns Parsed mask information
544
+ * @internal
545
+ */
546
+ parseMask(mask) {
547
+ if (this.maskCache.has(mask)) {
548
+ return this.maskCache.get(mask);
549
+ }
550
+ const len = mask.length;
551
+ const start = mask.search(/[0-9\-\+#]/);
552
+ const prefix = start > 0 ? mask.substring(0, start).trim() : "";
553
+ const str = mask.split("").reverse().join("");
554
+ const end = str.search(/[0-9\-\+#]/);
555
+ const offset = len - end;
556
+ const indx = offset + (mask.substring(offset, offset + 1) === "." ? 1 : 0);
557
+ const suffix = end > 0 ? mask.substring(indx, len).trim() : "";
558
+ const pattern = mask.substring(start, indx);
559
+ const result = pattern.match(/[^\d\-\+#]/g);
560
+ const decimal = result && result[result.length - 1] || ".";
561
+ const group = result && result[1] && result[0] || ",";
562
+ const parts = pattern.split(decimal);
563
+ const decimalPlaces = parts[1] ? parts[1].length : 0;
564
+ const szSep = parts[0].split(group);
565
+ const groupSize = szSep[1] ? szSep[szSep.length - 1].length : 0;
566
+ const cleanPattern = parts[0].replace(new RegExp(`\\${group}`, "g"), "");
567
+ const posLeadZero = cleanPattern.indexOf("0");
568
+ const parsed = {
569
+ pattern,
570
+ prefix,
571
+ suffix,
572
+ decimal,
573
+ group,
574
+ decimalPlaces,
575
+ posLeadZero,
576
+ groupSize
577
+ };
578
+ this.maskCache.set(mask, parsed);
579
+ return parsed;
580
+ }
581
+ /**
582
+ * Apply a mask to a number value.
583
+ *
584
+ * @param mask - Mask pattern
585
+ * @param value - Number to format
586
+ * @returns Formatted string
587
+ * @internal
588
+ */
589
+ applyMask(mask, value) {
590
+ if (!mask || isNaN(+value) || value === "") return value;
591
+ const parsed = this.parseMask(mask);
592
+ let isNegative = value < 0;
593
+ value = Math.abs(value);
594
+ const maskParts = parsed.pattern.split(parsed.decimal);
595
+ value = value.toFixed(maskParts[1] ? maskParts[1].length : 0);
596
+ value = +value + "";
597
+ const posTrailZero = maskParts[1] ? maskParts[1].lastIndexOf("0") : -1;
598
+ let parts = value.split(".");
599
+ if (!parts[1] || parts[1] && parts[1].length <= posTrailZero) {
600
+ value = (+value).toFixed(posTrailZero + 1);
601
+ }
602
+ const szSep = maskParts[0].split(parsed.group);
603
+ const cleanMask = szSep.join("");
604
+ if (parsed.posLeadZero > -1) {
605
+ while (parts[0].length < cleanMask.length - parsed.posLeadZero) {
606
+ parts[0] = "0" + parts[0];
607
+ }
608
+ } else if (+parts[0] === 0) {
609
+ parts[0] = "";
610
+ }
611
+ const valueParts = value.split(".");
612
+ valueParts[0] = parts[0];
613
+ if (parsed.groupSize) {
614
+ const integer = valueParts[0];
615
+ let str = "";
616
+ const offset = integer.length % parsed.groupSize;
617
+ const len = integer.length;
618
+ for (let i = 0; i < len; i++) {
619
+ str += integer.charAt(i);
620
+ if (!((i - offset + 1) % parsed.groupSize) && i < len - parsed.groupSize) {
621
+ str += parsed.group;
622
+ }
623
+ }
624
+ valueParts[0] = str;
625
+ }
626
+ valueParts[1] = maskParts[1] && valueParts[1] ? parsed.decimal + valueParts[1] : "";
627
+ const result = valueParts.join("");
628
+ if (result === "0" || result === "") {
629
+ isNegative = false;
630
+ }
631
+ return parsed.prefix + (isNegative ? "-" : "") + result + parsed.suffix;
632
+ }
633
+ /**
634
+ * Decimal/group separators and fraction length from the configured mask.
635
+ * Use for free-form numeric inputs (e.g. bet multipliers) that are not currency amounts.
636
+ */
637
+ getMaskLocale() {
638
+ const parsed = this.parseMask(this.config.mask);
639
+ return {
640
+ decimal: parsed.decimal,
641
+ group: parsed.group,
642
+ decimalPlaces: parsed.decimalPlaces > 0 ? parsed.decimalPlaces : this.config.decimalPrecision
643
+ };
644
+ }
645
+ /**
646
+ * Format a number using only the numeric portion of the mask (no prefix/suffix, no denom).
647
+ * Suitable for multipliers and limits (e.g. autoplay 10.5× bet).
648
+ */
649
+ formatPlainNumber(value, options = {}) {
650
+ const { forceDecimals = false } = options;
651
+ const parsed = this.parseMask(this.config.mask);
652
+ let pattern = parsed.pattern;
653
+ if (forceDecimals) {
654
+ pattern = pattern.replace(/\.##/g, ".00");
655
+ }
656
+ return this.applyMask(pattern, value);
657
+ }
658
+ /**
659
+ * Get current configuration.
660
+ *
661
+ * @returns Current configuration
662
+ */
663
+ getConfig() {
664
+ return { ...this.config };
665
+ }
666
+ };
667
+
668
+ // utils/ArrayUtils.ts
669
+ Object.defineProperty(Array.prototype, "exclude", {
670
+ value: function(...indexToExclude) {
671
+ return this.filter((_, index) => !indexToExclude.includes(index));
672
+ },
673
+ enumerable: false
674
+ });
675
+ Object.defineProperty(Array.prototype, "random", {
676
+ value: function() {
677
+ const randomIndex = Math.floor(Math.random() * this.length);
678
+ return this[randomIndex];
679
+ },
680
+ enumerable: false
681
+ });
682
+ Object.defineProperty(Array.prototype, "lastItem", {
683
+ value: function() {
684
+ return this[this.length - 1];
685
+ },
686
+ enumerable: false
687
+ });
688
+ Object.defineProperty(Array.prototype, "firstItem", {
689
+ value: function() {
690
+ return this[0];
691
+ },
692
+ enumerable: false
693
+ });
694
+ Object.defineProperty(Array.prototype, "clone", {
695
+ value: function() {
696
+ return [...this];
697
+ },
698
+ enumerable: false
699
+ });
700
+ Object.defineProperty(Array.prototype, "shuffle", {
701
+ value: function() {
702
+ const array = [...this];
703
+ for (let i = array.length - 1; i > 0; i--) {
704
+ const j = Math.floor(Math.random() * (i + 1));
705
+ [array[i], array[j]] = [array[j], array[i]];
706
+ }
707
+ return array;
708
+ },
709
+ enumerable: false
710
+ });
711
+ var __arrayUtilsLoaded = true;
712
+
713
+ // utils/ObjectUtils.ts
714
+ function getNestedValue(obj, path) {
715
+ return path.split(".").reduce((current, key) => current == null ? void 0 : current[key], obj);
716
+ }
717
+ function setNestedValue(obj, path, value) {
718
+ const keys = path.split(".");
719
+ const lastKey = keys.pop();
720
+ const target = keys.reduce((current, key) => {
721
+ if (current[key] === void 0 || current[key] === null) {
722
+ current[key] = {};
723
+ }
724
+ return current[key];
725
+ }, obj);
726
+ target[lastKey] = value;
727
+ }
728
+ function hasNestedProperty(obj, path) {
729
+ return getNestedValue(obj, path) !== void 0;
730
+ }
731
+ function deepClone(obj) {
732
+ return structuredClone(obj);
733
+ }
734
+ function calculateAnimationSpeed(exportedFps = 12, speed = 1) {
735
+ return exportedFps / 60 * speed;
736
+ }
737
+ function applyAnchor(element, anchor, defaultAnchor) {
738
+ if (!("anchor" in element)) return;
739
+ const elementWithAnchor = element;
740
+ if (anchor) {
741
+ elementWithAnchor.anchor.set(anchor.x, anchor.y);
742
+ } else if (defaultAnchor) {
743
+ elementWithAnchor.anchor.set(defaultAnchor.x, defaultAnchor.y);
744
+ }
745
+ }
746
+ function applyScale(element, scale) {
747
+ if (scale === void 0) return;
748
+ if (typeof scale === "number") {
749
+ element.scale.set(scale);
750
+ } else {
751
+ element.scale.set(scale.x, scale.y);
752
+ }
753
+ }
754
+ function applyCommonProperties(element, config) {
755
+ if (config.alpha !== void 0) {
756
+ element.alpha = config.alpha;
757
+ }
758
+ if (config.blendMode) {
759
+ element.blendMode = config.blendMode;
760
+ }
761
+ applyScale(element, config.scale);
762
+ }
763
+ function updateBounds(existingBounds, x, y, width, height) {
764
+ if (existingBounds instanceof Rectangle) {
765
+ existingBounds.x = x;
766
+ existingBounds.y = y;
767
+ existingBounds.width = width;
768
+ existingBounds.height = height;
769
+ return existingBounds;
770
+ }
771
+ return new Rectangle(x, y, width, height);
772
+ }
773
+
774
+ // utils/Throttle.ts
775
+ function debounce(func, wait = 0, options = {}) {
776
+ let lastArgs;
777
+ let lastThis;
778
+ const maxWait = options.maxWait ? options.maxWait : wait;
779
+ let result;
780
+ let timerId;
781
+ let lastCallTime;
782
+ let lastInvokeTime = 0;
783
+ const leading = !!options.leading;
784
+ const maxing = "maxWait" in options;
785
+ const trailing = options.trailing ?? true;
786
+ const useRAF = wait !== 0 && typeof globalThis.requestAnimationFrame === "function";
787
+ if (typeof func !== "function") {
788
+ throw new TypeError("Expected a function");
789
+ }
790
+ function invokeFunc(time) {
791
+ const args = lastArgs;
792
+ const thisArg = lastThis;
793
+ lastArgs = lastThis = void 0;
794
+ lastInvokeTime = time;
795
+ result = func.apply(thisArg, args);
796
+ return result;
797
+ }
798
+ function startTimer(pendingFunc, milliseconds) {
799
+ if (useRAF) {
800
+ if (typeof timerId === "number") {
801
+ globalThis.cancelAnimationFrame(timerId);
802
+ }
803
+ return globalThis.requestAnimationFrame(pendingFunc);
804
+ }
805
+ return setTimeout(pendingFunc, milliseconds);
806
+ }
807
+ function cancelTimer(id) {
808
+ if (useRAF) {
809
+ globalThis.cancelAnimationFrame(id);
810
+ return;
811
+ }
812
+ clearTimeout(id);
813
+ }
814
+ function leadingEdge(time) {
815
+ lastInvokeTime = time;
816
+ timerId = startTimer(timerExpired, wait);
817
+ return leading ? invokeFunc(time) : result;
818
+ }
819
+ function remainingWait(time) {
820
+ const timeSinceLastCall = time - (lastCallTime || 0);
821
+ const timeSinceLastInvoke = time - lastInvokeTime;
822
+ const timeWaiting = wait - timeSinceLastCall;
823
+ return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
824
+ }
825
+ function shouldInvoke(time) {
826
+ const timeSinceLastCall = time - (lastCallTime || 0);
827
+ const timeSinceLastInvoke = time - lastInvokeTime;
828
+ return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
829
+ }
830
+ function timerExpired() {
831
+ const time = Date.now();
832
+ if (shouldInvoke(time)) {
833
+ return trailingEdge(time);
834
+ }
835
+ timerId = startTimer(timerExpired, remainingWait(time));
836
+ return void 0;
837
+ }
838
+ function trailingEdge(time) {
839
+ timerId = void 0;
840
+ if (trailing && lastArgs) {
841
+ return invokeFunc(time);
842
+ }
843
+ lastArgs = lastThis = void 0;
844
+ return result;
845
+ }
846
+ function cancel() {
847
+ if (timerId !== void 0) {
848
+ cancelTimer(timerId);
849
+ }
850
+ lastInvokeTime = 0;
851
+ lastArgs = lastCallTime = lastThis = timerId = void 0;
852
+ }
853
+ function flush() {
854
+ return timerId === void 0 ? result : trailingEdge(Date.now());
855
+ }
856
+ function pending() {
857
+ return timerId !== void 0;
858
+ }
859
+ function debounced(...args) {
860
+ const time = Date.now();
861
+ const isInvoking = shouldInvoke(time);
862
+ lastArgs = args;
863
+ lastThis = this;
864
+ lastCallTime = time;
865
+ if (isInvoking) {
866
+ if (timerId === void 0) {
867
+ return leadingEdge(lastCallTime);
868
+ }
869
+ if (maxing) {
870
+ timerId = startTimer(timerExpired, wait);
871
+ return invokeFunc(lastCallTime);
872
+ }
873
+ }
874
+ if (timerId === void 0) {
875
+ timerId = startTimer(timerExpired, wait);
876
+ }
877
+ return result;
878
+ }
879
+ debounced.cancel = cancel;
880
+ debounced.flush = flush;
881
+ debounced.pending = pending;
882
+ return debounced;
883
+ }
884
+ function throttle(func, wait, options = {}) {
885
+ const leading = options.leading ?? true;
886
+ const trailing = options.trailing ?? true;
887
+ if (typeof func !== "function") {
888
+ throw new TypeError("Expected a function");
889
+ }
890
+ return debounce(func, wait, {
891
+ leading,
892
+ trailing,
893
+ maxWait: wait
894
+ });
895
+ }
896
+
897
+ export { ContextLogger, DataInjector, LogLevel, Logger, NumberFormatter, __arrayUtilsLoaded, applyAnchor, applyCommonProperties, applyScale, calculateAnimationSpeed, darkenColor, debounce, deepClone, getLogger, getNestedValue, hasNestedProperty, lightenColor, logger, setNestedValue, throttle, updateBounds };
898
+ //# sourceMappingURL=index.js.map
899
+ //# sourceMappingURL=index.js.map