tsparticles 1.37.6 → 1.39.2

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 (1513) hide show
  1. package/Core/Canvas.d.ts +3 -3
  2. package/Core/Canvas.js +27 -17
  3. package/Core/Container.d.ts +5 -6
  4. package/Core/Container.js +8 -9
  5. package/Core/Interfaces/Gradients.d.ts +2 -2
  6. package/Core/Interfaces/ICircleBouncer.d.ts +1 -1
  7. package/Core/Interfaces/IContainerPlugin.d.ts +4 -4
  8. package/Core/Interfaces/IExternalInteractor.d.ts +1 -1
  9. package/Core/Interfaces/IInteractor.d.ts +1 -1
  10. package/Core/Interfaces/IMovePathGenerator.d.ts +1 -1
  11. package/Core/Interfaces/IParticle.d.ts +8 -8
  12. package/Core/Interfaces/IParticleGradientAnimation.d.ts +1 -1
  13. package/Core/Interfaces/IParticleSpin.d.ts +1 -1
  14. package/Core/Interfaces/IParticlesInteractor.d.ts +2 -2
  15. package/Core/Interfaces/IPlugin.d.ts +1 -1
  16. package/Core/Interfaces/index.d.ts +3 -1
  17. package/Core/Interfaces/index.js +3 -1
  18. package/Core/Loader.d.ts +1 -1
  19. package/Core/Loader.js +8 -12
  20. package/Core/Particle.d.ts +3 -6
  21. package/Core/Particle.js +41 -43
  22. package/Core/Particles.d.ts +3 -3
  23. package/Core/Particles.js +14 -20
  24. package/{Utils → Core/Utils}/Circle.d.ts +1 -1
  25. package/{Utils → Core/Utils}/Circle.js +2 -2
  26. package/{esm → Core}/Utils/CircleWarp.d.ts +2 -3
  27. package/{Utils → Core/Utils}/CircleWarp.js +1 -1
  28. package/{Utils → Core/Utils}/Constants.d.ts +1 -1
  29. package/{Utils → Core/Utils}/Constants.js +1 -1
  30. package/{Utils → Core/Utils}/EventListeners.d.ts +1 -1
  31. package/{Utils → Core/Utils}/EventListeners.js +11 -12
  32. package/Core/{ExternalInteractorBase.d.ts → Utils/ExternalInteractorBase.d.ts} +4 -4
  33. package/Core/{ExternalInteractorBase.js → Utils/ExternalInteractorBase.js} +1 -2
  34. package/{esm/Core → Core/Utils}/FrameManager.d.ts +1 -1
  35. package/Core/{FrameManager.js → Utils/FrameManager.js} +0 -0
  36. package/{esm/Core → Core/Utils}/InteractionManager.d.ts +3 -3
  37. package/Core/{InteractionManager.js → Utils/InteractionManager.js} +2 -3
  38. package/{esm/Core → Core/Utils}/ParticlesInteractorBase.d.ts +4 -4
  39. package/Core/{ParticlesInteractorBase.js → Utils/ParticlesInteractorBase.js} +1 -2
  40. package/{esm/Core/Particle/Mover.d.ts → Core/Utils/ParticlesMover.d.ts} +2 -2
  41. package/Core/{Particle/Mover.js → Utils/ParticlesMover.js} +6 -7
  42. package/{esm → Core}/Utils/Plugins.d.ts +5 -5
  43. package/{Utils → Core/Utils}/Plugins.js +0 -0
  44. package/{Utils → Core/Utils}/Point.d.ts +2 -2
  45. package/{Utils → Core/Utils}/Point.js +0 -0
  46. package/{Utils → Core/Utils}/QuadTree.d.ts +4 -4
  47. package/{Utils → Core/Utils}/QuadTree.js +3 -3
  48. package/{esm → Core}/Utils/Range.d.ts +1 -1
  49. package/{Utils → Core/Utils}/Range.js +0 -0
  50. package/{esm → Core}/Utils/Rectangle.d.ts +1 -2
  51. package/{Utils → Core/Utils}/Rectangle.js +0 -0
  52. package/Core/{Particle → Utils}/Vector.d.ts +0 -0
  53. package/Core/{Particle → Utils}/Vector.js +0 -0
  54. package/{esm/Core/Particle → Core/Utils}/Vector3d.d.ts +1 -1
  55. package/Core/{Particle → Utils}/Vector3d.js +0 -0
  56. package/Core/Utils/index.d.ts +16 -0
  57. package/Core/Utils/index.js +28 -0
  58. package/Core/index.d.ts +8 -0
  59. package/Core/index.js +20 -0
  60. package/Enums/AnimationStatus.d.ts +1 -1
  61. package/Enums/AnimationStatus.js +0 -6
  62. package/Enums/Directions/MoveDirection.d.ts +1 -1
  63. package/Enums/Directions/MoveDirection.js +0 -13
  64. package/Enums/Directions/OutModeDirection.d.ts +1 -1
  65. package/Enums/Directions/OutModeDirection.js +0 -8
  66. package/Enums/Directions/RotateDirection.d.ts +1 -1
  67. package/Enums/Directions/RotateDirection.js +0 -7
  68. package/Enums/Directions/TiltDirection.d.ts +1 -1
  69. package/Enums/Directions/TiltDirection.js +0 -7
  70. package/Enums/InteractivityDetect.d.ts +1 -1
  71. package/Enums/InteractivityDetect.js +0 -7
  72. package/Enums/Modes/ClickMode.d.ts +1 -1
  73. package/Enums/Modes/ClickMode.js +0 -11
  74. package/Enums/Modes/CollisionMode.d.ts +1 -1
  75. package/Enums/Modes/CollisionMode.js +0 -7
  76. package/Enums/Modes/DestroyMode.d.ts +1 -1
  77. package/Enums/Modes/DestroyMode.js +0 -6
  78. package/Enums/Modes/DivMode.d.ts +1 -1
  79. package/Enums/Modes/DivMode.js +0 -7
  80. package/Enums/Modes/HoverMode.d.ts +1 -1
  81. package/Enums/Modes/HoverMode.js +0 -13
  82. package/Enums/Modes/OutMode.d.ts +1 -1
  83. package/Enums/Modes/OutMode.js +0 -11
  84. package/Enums/Modes/ResponsiveMode.d.ts +1 -1
  85. package/Enums/Modes/ResponsiveMode.js +0 -6
  86. package/Enums/Modes/RollMode.d.ts +1 -1
  87. package/Enums/Modes/RollMode.js +0 -7
  88. package/Enums/Modes/SizeMode.d.ts +1 -1
  89. package/Enums/Modes/SizeMode.js +0 -6
  90. package/Enums/Modes/ThemeMode.d.ts +1 -1
  91. package/Enums/Modes/ThemeMode.js +0 -7
  92. package/Enums/Types/AlterType.d.ts +1 -1
  93. package/Enums/Types/AlterType.js +0 -6
  94. package/Enums/Types/DestroyType.d.ts +1 -1
  95. package/Enums/Types/DestroyType.js +0 -7
  96. package/Enums/Types/DivType.d.ts +1 -1
  97. package/Enums/Types/DivType.js +0 -6
  98. package/Enums/Types/EasingType.d.ts +1 -1
  99. package/Enums/Types/EasingType.js +0 -12
  100. package/Enums/Types/GradientType.d.ts +1 -1
  101. package/Enums/Types/GradientType.js +0 -7
  102. package/Enums/Types/InteractorType.d.ts +1 -1
  103. package/Enums/Types/InteractorType.js +0 -6
  104. package/Enums/Types/OrbitType.d.ts +1 -1
  105. package/Enums/Types/OrbitType.js +0 -6
  106. package/Enums/Types/ShapeType.d.ts +1 -1
  107. package/Enums/Types/ShapeType.js +0 -15
  108. package/Enums/Types/StartValueType.d.ts +1 -1
  109. package/Enums/Types/StartValueType.js +0 -7
  110. package/Interactions/External/Attract/Attractor.d.ts +2 -2
  111. package/Interactions/External/Attract/Attractor.js +9 -11
  112. package/Interactions/External/Attract/index.d.ts +2 -2
  113. package/Interactions/External/Attract/index.js +2 -2
  114. package/Interactions/External/Bounce/Bouncer.d.ts +2 -2
  115. package/Interactions/External/Bounce/Bouncer.js +15 -17
  116. package/Interactions/External/Bounce/index.d.ts +2 -2
  117. package/Interactions/External/Bounce/index.js +2 -2
  118. package/Interactions/External/Bubble/Bubbler.d.ts +3 -3
  119. package/Interactions/External/Bubble/Bubbler.js +20 -22
  120. package/Interactions/External/Bubble/ProcessBubbleType.d.ts +1 -1
  121. package/Interactions/External/Bubble/ProcessBubbleType.js +0 -7
  122. package/Interactions/External/Bubble/index.d.ts +2 -2
  123. package/Interactions/External/Bubble/index.js +2 -2
  124. package/Interactions/External/Connect/Connector.d.ts +2 -2
  125. package/Interactions/External/Connect/Connector.js +3 -4
  126. package/Interactions/External/Connect/index.d.ts +2 -2
  127. package/Interactions/External/Connect/index.js +2 -2
  128. package/Interactions/External/Grab/Grabber.d.ts +2 -2
  129. package/Interactions/External/Grab/Grabber.js +4 -5
  130. package/Interactions/External/Grab/index.d.ts +2 -2
  131. package/Interactions/External/Grab/index.js +2 -2
  132. package/Interactions/External/Repulse/Repulser.d.ts +2 -2
  133. package/Interactions/External/Repulse/Repulser.js +15 -17
  134. package/Interactions/External/Repulse/index.d.ts +2 -2
  135. package/Interactions/External/Repulse/index.js +2 -2
  136. package/Interactions/External/Trail/TrailMaker.d.ts +2 -3
  137. package/Interactions/External/Trail/TrailMaker.js +4 -5
  138. package/Interactions/External/Trail/index.d.ts +2 -2
  139. package/Interactions/External/Trail/index.js +2 -2
  140. package/Interactions/Particles/Attract/Attractor.d.ts +2 -4
  141. package/Interactions/Particles/Attract/Attractor.js +2 -2
  142. package/Interactions/Particles/Attract/index.d.ts +2 -2
  143. package/Interactions/Particles/Attract/index.js +2 -2
  144. package/Interactions/Particles/Collisions/Collider.d.ts +2 -3
  145. package/Interactions/Particles/Collisions/Collider.js +5 -6
  146. package/Interactions/Particles/Collisions/index.d.ts +2 -2
  147. package/Interactions/Particles/Collisions/index.js +2 -2
  148. package/Interactions/Particles/Links/LinkInstance.d.ts +1 -3
  149. package/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
  150. package/Interactions/Particles/Links/Linker.d.ts +3 -4
  151. package/Interactions/Particles/Links/Linker.js +4 -4
  152. package/Interactions/Particles/Links/index.d.ts +2 -3
  153. package/Interactions/Particles/Links/index.js +5 -9
  154. package/Interactions/Particles/Links/interaction.d.ts +2 -0
  155. package/Interactions/Particles/Links/interaction.js +8 -0
  156. package/Interactions/Particles/Links/plugin.d.ts +2 -2
  157. package/Interactions/Particles/Links/plugin.js +4 -4
  158. package/Options/Classes/AnimatableColor.d.ts +3 -3
  159. package/Options/Classes/AnimatableColor.js +1 -1
  160. package/Options/Classes/AnimatableGradient.d.ts +6 -6
  161. package/Options/Classes/AnimatableGradient.js +3 -4
  162. package/Options/Classes/AnimationOptions.d.ts +2 -2
  163. package/Options/Classes/Background/Background.d.ts +2 -2
  164. package/Options/Classes/BackgroundMask/BackgroundMask.d.ts +2 -2
  165. package/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +2 -2
  166. package/Options/Classes/ColorAnimation.d.ts +1 -1
  167. package/Options/Classes/HslAnimation.d.ts +2 -2
  168. package/Options/Classes/Interactivity/Events/ClickEvent.d.ts +2 -2
  169. package/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -1
  170. package/Options/Classes/Interactivity/Events/DivEvent.js +1 -2
  171. package/Options/Classes/Interactivity/Events/Events.d.ts +2 -2
  172. package/Options/Classes/Interactivity/Events/HoverEvent.d.ts +3 -3
  173. package/Options/Classes/Interactivity/Events/Parallax.d.ts +1 -1
  174. package/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
  175. package/Options/Classes/Interactivity/Interactivity.js +5 -6
  176. package/Options/Classes/Interactivity/Modes/Attract.d.ts +2 -2
  177. package/Options/Classes/Interactivity/Modes/Attract.js +1 -2
  178. package/Options/Classes/Interactivity/Modes/Bubble.d.ts +2 -2
  179. package/Options/Classes/Interactivity/Modes/Bubble.js +1 -1
  180. package/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +1 -1
  181. package/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +1 -1
  182. package/Options/Classes/Interactivity/Modes/Connect.d.ts +2 -2
  183. package/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +1 -1
  184. package/Options/Classes/Interactivity/Modes/Grab.d.ts +2 -2
  185. package/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +2 -2
  186. package/Options/Classes/Interactivity/Modes/Light.d.ts +1 -1
  187. package/Options/Classes/Interactivity/Modes/Modes.d.ts +7 -7
  188. package/Options/Classes/Interactivity/Modes/Modes.js +4 -4
  189. package/Options/Classes/Interactivity/Modes/Push.d.ts +1 -1
  190. package/Options/Classes/Interactivity/Modes/Remove.d.ts +1 -1
  191. package/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -3
  192. package/Options/Classes/Interactivity/Modes/Repulse.js +1 -1
  193. package/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +2 -2
  194. package/Options/Classes/Interactivity/Modes/RepulseBase.js +1 -2
  195. package/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +1 -1
  196. package/Options/Classes/Interactivity/Modes/Slow.d.ts +1 -1
  197. package/Options/Classes/Interactivity/Modes/Trail.d.ts +2 -2
  198. package/Options/Classes/ManualParticle.d.ts +2 -2
  199. package/Options/Classes/Motion/Motion.d.ts +1 -1
  200. package/Options/Classes/Options.d.ts +8 -7
  201. package/Options/Classes/Options.js +16 -14
  202. package/Options/Classes/OptionsColor.d.ts +2 -2
  203. package/Options/Classes/Particles/Bounce/Bounce.d.ts +1 -1
  204. package/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -4
  205. package/Options/Classes/Particles/Collisions/Collisions.js +1 -2
  206. package/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +2 -2
  207. package/Options/Classes/Particles/Destroy/Destroy.d.ts +1 -1
  208. package/Options/Classes/Particles/Destroy/Destroy.js +1 -2
  209. package/Options/Classes/Particles/Destroy/Split.d.ts +3 -3
  210. package/Options/Classes/Particles/Life/Life.d.ts +1 -1
  211. package/Options/Classes/Particles/Links/Links.d.ts +2 -2
  212. package/Options/Classes/Particles/Links/LinksShadow.d.ts +2 -2
  213. package/Options/Classes/Particles/Links/LinksTriangle.d.ts +1 -1
  214. package/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  215. package/Options/Classes/Particles/Move/Move.d.ts +5 -5
  216. package/Options/Classes/Particles/Move/Move.js +4 -5
  217. package/Options/Classes/Particles/Move/OutModes.d.ts +2 -2
  218. package/Options/Classes/Particles/Move/OutModes.js +1 -2
  219. package/Options/Classes/Particles/Move/Path/Path.d.ts +3 -3
  220. package/Options/Classes/Particles/Move/Spin.d.ts +3 -3
  221. package/Options/Classes/Particles/Move/Trail.d.ts +2 -2
  222. package/Options/Classes/Particles/Number/Density.d.ts +1 -1
  223. package/Options/Classes/Particles/Number/ParticlesNumber.d.ts +2 -2
  224. package/Options/Classes/Particles/Opacity/Opacity.d.ts +1 -1
  225. package/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +3 -3
  226. package/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -3
  227. package/Options/Classes/Particles/Orbit/Orbit.d.ts +5 -5
  228. package/Options/Classes/Particles/Orbit/Orbit.js +2 -2
  229. package/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +1 -1
  230. package/Options/Classes/Particles/ParticlesOptions.d.ts +16 -16
  231. package/Options/Classes/Particles/ParticlesOptions.js +13 -13
  232. package/Options/Classes/Particles/Repulse/Repulse.d.ts +1 -1
  233. package/Options/Classes/Particles/Roll/Roll.d.ts +2 -2
  234. package/Options/Classes/Particles/Roll/Roll.js +1 -2
  235. package/Options/Classes/Particles/Roll/RollLight.d.ts +1 -1
  236. package/Options/Classes/Particles/Rotate/Rotate.d.ts +3 -3
  237. package/Options/Classes/Particles/Rotate/Rotate.js +1 -2
  238. package/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +1 -1
  239. package/Options/Classes/Particles/Shadow.d.ts +3 -3
  240. package/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
  241. package/Options/Classes/Particles/Shape/Shape.js +13 -14
  242. package/Options/Classes/Particles/Size/Size.d.ts +2 -2
  243. package/Options/Classes/Particles/Size/SizeAnimation.d.ts +3 -3
  244. package/Options/Classes/Particles/Size/SizeAnimation.js +2 -3
  245. package/Options/Classes/Particles/Stroke.d.ts +2 -2
  246. package/Options/Classes/Particles/Tilt/Tilt.d.ts +3 -3
  247. package/Options/Classes/Particles/Tilt/Tilt.js +1 -2
  248. package/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +1 -1
  249. package/Options/Classes/Particles/Twinkle/Twinkle.d.ts +1 -1
  250. package/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  251. package/Options/Classes/Particles/Wobble/Wobble.d.ts +2 -2
  252. package/Options/Classes/Particles/ZIndex/ZIndex.d.ts +1 -1
  253. package/Options/Classes/Random.d.ts +1 -1
  254. package/Options/Classes/Responsive.d.ts +2 -2
  255. package/Options/Classes/Responsive.js +4 -5
  256. package/Options/Classes/Theme/Theme.d.ts +2 -2
  257. package/Options/Classes/Theme/Theme.js +1 -1
  258. package/Options/Classes/Theme/ThemeDefault.d.ts +2 -2
  259. package/Options/Classes/Theme/ThemeDefault.js +1 -2
  260. package/Options/Classes/ValueWithRandom.d.ts +2 -2
  261. package/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +1 -1
  262. package/Options/Interfaces/IAnimatableColor.d.ts +1 -1
  263. package/Options/Interfaces/IAnimatableGradient.d.ts +1 -1
  264. package/Options/Interfaces/IColorAnimation.d.ts +1 -1
  265. package/Options/Interfaces/IManualParticle.d.ts +1 -1
  266. package/Options/Interfaces/IOptions.d.ts +7 -6
  267. package/Options/Interfaces/IOptionsGradient.d.ts +2 -2
  268. package/Options/Interfaces/IResponsive.d.ts +2 -2
  269. package/Options/Interfaces/IValueWithRandom.d.ts +1 -1
  270. package/Options/Interfaces/Interactivity/Events/IEvents.d.ts +1 -1
  271. package/Options/Interfaces/Interactivity/IInteractivity.d.ts +1 -1
  272. package/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +2 -2
  273. package/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +1 -1
  274. package/Options/Interfaces/Interactivity/Modes/IModes.d.ts +2 -2
  275. package/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +2 -2
  276. package/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +1 -1
  277. package/Options/Interfaces/Particles/Destroy/ISplit.d.ts +1 -1
  278. package/Options/Interfaces/Particles/IParticles.d.ts +14 -14
  279. package/Options/Interfaces/Particles/IShadow.d.ts +1 -1
  280. package/Options/Interfaces/Particles/IStroke.d.ts +1 -1
  281. package/Options/Interfaces/Particles/Links/ILinks.d.ts +1 -1
  282. package/Options/Interfaces/Particles/Move/IMove.d.ts +5 -5
  283. package/Options/Interfaces/Particles/Move/Path/{iPath.d.ts → IPath.d.ts} +0 -0
  284. package/Options/Interfaces/Particles/Move/Path/{iPath.js → IPath.js} +0 -0
  285. package/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +3 -3
  286. package/Options/Interfaces/Particles/Roll/IRoll.d.ts +1 -1
  287. package/Options/Interfaces/Particles/Rotate/IRotate.d.ts +1 -1
  288. package/Options/Interfaces/Particles/Shape/IShape.d.ts +3 -3
  289. package/Options/Interfaces/Particles/Tilt/ITilt.d.ts +1 -1
  290. package/Options/Interfaces/Theme/ITheme.d.ts +2 -2
  291. package/Plugins/Absorbers/AbsorberContainer.d.ts +1 -1
  292. package/Plugins/Absorbers/AbsorberInstance.d.ts +6 -7
  293. package/Plugins/Absorbers/AbsorberInstance.js +27 -28
  294. package/Plugins/Absorbers/Absorbers.d.ts +4 -7
  295. package/Plugins/Absorbers/Absorbers.js +2 -3
  296. package/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +1 -1
  297. package/Plugins/Absorbers/Enums/AbsorberClickMode.js +0 -5
  298. package/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -4
  299. package/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -2
  300. package/Plugins/Absorbers/Options/Classes/AbsorberSize.js +1 -1
  301. package/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +2 -2
  302. package/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +1 -2
  303. package/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +1 -1
  304. package/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +1 -1
  305. package/Plugins/Absorbers/index.d.ts +2 -0
  306. package/Plugins/Absorbers/{plugin.js → index.js} +6 -7
  307. package/Plugins/Emitters/EmitterContainer.d.ts +2 -1
  308. package/Plugins/Emitters/EmitterInstance.d.ts +6 -5
  309. package/Plugins/Emitters/EmitterInstance.js +37 -39
  310. package/Plugins/Emitters/Emitters.d.ts +4 -5
  311. package/Plugins/Emitters/Emitters.js +12 -5
  312. package/Plugins/Emitters/EmittersMain.d.ts +2 -2
  313. package/Plugins/Emitters/Enums/EmitterClickMode.d.ts +1 -1
  314. package/Plugins/Emitters/Enums/EmitterClickMode.js +0 -5
  315. package/Plugins/Emitters/Enums/EmitterShapeType.d.ts +1 -1
  316. package/Plugins/Emitters/Enums/EmitterShapeType.js +0 -6
  317. package/Plugins/Emitters/IEmitterShape.d.ts +1 -1
  318. package/Plugins/Emitters/Options/Classes/Emitter.d.ts +7 -7
  319. package/Plugins/Emitters/Options/Classes/Emitter.js +4 -5
  320. package/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +1 -1
  321. package/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +1 -1
  322. package/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +1 -1
  323. package/Plugins/Emitters/Options/Classes/EmitterSize.js +1 -2
  324. package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +6 -6
  325. package/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +1 -1
  326. package/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +1 -1
  327. package/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +1 -1
  328. package/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +1 -1
  329. package/Plugins/Emitters/index.d.ts +3 -0
  330. package/Plugins/Emitters/{plugin.js → index.js} +10 -11
  331. package/Plugins/PolygonMask/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
  332. package/Plugins/PolygonMask/{Options/Interfaces/IDraw.js → Enums/PolygonMaskInlineArrangement.js} +0 -0
  333. package/Plugins/PolygonMask/Enums/PolygonMaskMoveType.d.ts +4 -0
  334. package/Plugins/PolygonMask/{Options/Interfaces/IDrawStroke.js → Enums/PolygonMaskMoveType.js} +0 -0
  335. package/{esm/Plugins/PolygonMask/Enums/Type.d.ts → Plugins/PolygonMask/Enums/PolygonMaskType.d.ts} +1 -1
  336. package/Plugins/PolygonMask/{Options/Interfaces/IInline.js → Enums/PolygonMaskType.js} +0 -0
  337. package/Plugins/PolygonMask/Enums/index.d.ts +3 -3
  338. package/Plugins/PolygonMask/Enums/index.js +3 -3
  339. package/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +14 -14
  340. package/Plugins/PolygonMask/Options/Classes/PolygonMask.js +42 -42
  341. package/Plugins/PolygonMask/Options/Classes/{Draw.d.ts → PolygonMaskDraw.d.ts} +7 -7
  342. package/Plugins/PolygonMask/Options/Classes/{Draw.js → PolygonMaskDraw.js} +15 -14
  343. package/Plugins/PolygonMask/Options/Classes/{DrawStroke.d.ts → PolygonMaskDrawStroke.d.ts} +5 -5
  344. package/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.js +29 -0
  345. package/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +9 -0
  346. package/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.js +17 -0
  347. package/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.d.ts +11 -0
  348. package/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.js +29 -0
  349. package/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +10 -0
  350. package/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.js +21 -0
  351. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +12 -13
  352. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.d.ts +8 -0
  353. package/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.js → IPolygonMaskDraw.js} +0 -0
  354. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDrawStroke.d.ts +6 -0
  355. package/Plugins/PolygonMask/Options/Interfaces/{IMove.js → IPolygonMaskDrawStroke.js} +0 -0
  356. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.d.ts +4 -0
  357. package/Plugins/PolygonMask/{types.js → Options/Interfaces/IPolygonMaskInline.js} +0 -0
  358. package/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.d.ts → IPolygonMaskLocalSvg.d.ts} +2 -2
  359. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.js +2 -0
  360. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.d.ts +5 -0
  361. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.js +2 -0
  362. package/Plugins/PolygonMask/PolygonMaskInstance.d.ts +4 -6
  363. package/Plugins/PolygonMask/PolygonMaskInstance.js +39 -36
  364. package/Plugins/PolygonMask/{types.d.ts → Types.d.ts} +1 -1
  365. package/Plugins/PolygonMask/Types.js +2 -0
  366. package/{esm/Plugins/PolygonMask/utils.d.ts → Plugins/PolygonMask/Utils.d.ts} +5 -5
  367. package/Plugins/PolygonMask/{utils.js → Utils.js} +15 -12
  368. package/Plugins/PolygonMask/index.d.ts +2 -0
  369. package/Plugins/PolygonMask/{plugin.js → index.js} +7 -8
  370. package/Plugins/PolygonMask/pathseg.js +54 -43
  371. package/README.md +161 -17
  372. package/Shapes/Circle/CircleDrawer.d.ts +1 -1
  373. package/Shapes/Circle/index.d.ts +2 -2
  374. package/Shapes/Circle/index.js +2 -2
  375. package/Shapes/Image/ImageDrawer.d.ts +3 -7
  376. package/Shapes/Image/ImageDrawer.js +29 -109
  377. package/Shapes/Image/Utils.d.ts +8 -5
  378. package/Shapes/Image/Utils.js +69 -38
  379. package/Shapes/Image/index.d.ts +2 -2
  380. package/Shapes/Image/index.js +3 -3
  381. package/Shapes/Line/LineDrawer.d.ts +1 -1
  382. package/Shapes/Line/index.d.ts +2 -2
  383. package/Shapes/Line/index.js +2 -2
  384. package/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
  385. package/Shapes/Polygon/PolygonDrawerBase.d.ts +1 -1
  386. package/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
  387. package/Shapes/Polygon/index.d.ts +4 -4
  388. package/Shapes/Polygon/index.js +7 -7
  389. package/Shapes/Square/SquareDrawer.d.ts +1 -1
  390. package/Shapes/Square/index.d.ts +2 -2
  391. package/Shapes/Square/index.js +3 -3
  392. package/Shapes/Star/StarDrawer.d.ts +1 -1
  393. package/Shapes/Star/index.d.ts +2 -2
  394. package/Shapes/Star/index.js +2 -2
  395. package/Shapes/Text/TextDrawer.d.ts +1 -2
  396. package/Shapes/Text/index.d.ts +2 -2
  397. package/Shapes/Text/index.js +2 -2
  398. package/Types/ShapeData.d.ts +1 -1
  399. package/Types/ShapeDrawerFunctions.d.ts +1 -1
  400. package/Updaters/Angle/AngleUpdater.d.ts +1 -3
  401. package/Updaters/Angle/AngleUpdater.js +8 -9
  402. package/Updaters/Angle/index.d.ts +2 -2
  403. package/Updaters/Angle/index.js +2 -2
  404. package/Updaters/Color/ColorUpdater.d.ts +1 -3
  405. package/Updaters/Color/ColorUpdater.js +3 -4
  406. package/Updaters/Color/index.d.ts +2 -2
  407. package/Updaters/Color/index.js +2 -2
  408. package/Updaters/Life/LifeUpdater.d.ts +1 -3
  409. package/Updaters/Life/index.d.ts +2 -2
  410. package/Updaters/Life/index.js +2 -2
  411. package/Updaters/Opacity/OpacityUpdater.d.ts +1 -3
  412. package/Updaters/Opacity/OpacityUpdater.js +13 -14
  413. package/Updaters/Opacity/index.d.ts +2 -2
  414. package/Updaters/Opacity/index.js +2 -2
  415. package/Updaters/OutModes/IBounceData.d.ts +1 -2
  416. package/Updaters/OutModes/OutOfCanvasUpdater.d.ts +1 -3
  417. package/Updaters/OutModes/OutOfCanvasUpdater.js +28 -29
  418. package/Updaters/OutModes/Utils.js +12 -13
  419. package/Updaters/OutModes/index.d.ts +2 -2
  420. package/Updaters/OutModes/index.js +2 -2
  421. package/Updaters/Roll/RollUpdater.d.ts +1 -2
  422. package/Updaters/Roll/RollUpdater.js +4 -5
  423. package/Updaters/Roll/index.d.ts +2 -2
  424. package/Updaters/Roll/index.js +2 -2
  425. package/Updaters/Size/SizeUpdater.d.ts +1 -2
  426. package/Updaters/Size/SizeUpdater.js +6 -7
  427. package/Updaters/Size/index.d.ts +2 -2
  428. package/Updaters/Size/index.js +2 -2
  429. package/Updaters/StrokeColor/StrokeColorUpdater.d.ts +1 -3
  430. package/Updaters/StrokeColor/StrokeColorUpdater.js +3 -4
  431. package/Updaters/StrokeColor/index.d.ts +2 -2
  432. package/Updaters/StrokeColor/index.js +2 -2
  433. package/Updaters/Tilt/TiltUpdater.d.ts +1 -3
  434. package/Updaters/Tilt/TiltUpdater.js +8 -9
  435. package/Updaters/Tilt/index.d.ts +2 -2
  436. package/Updaters/Tilt/index.js +2 -2
  437. package/Updaters/Wobble/WobbleUpdater.d.ts +1 -3
  438. package/Updaters/Wobble/index.d.ts +2 -2
  439. package/Updaters/Wobble/index.js +2 -2
  440. package/Utils/CanvasUtils.d.ts +3 -4
  441. package/Utils/CanvasUtils.js +5 -6
  442. package/Utils/ColorUtils.d.ts +1 -1
  443. package/Utils/ColorUtils.js +8 -9
  444. package/Utils/NumberUtils.d.ts +3 -3
  445. package/Utils/NumberUtils.js +20 -21
  446. package/Utils/Utils.d.ts +3 -3
  447. package/Utils/Utils.js +6 -7
  448. package/Utils/index.d.ts +0 -9
  449. package/Utils/index.js +0 -9
  450. package/browser/Core/Canvas.d.ts +3 -3
  451. package/browser/Core/Canvas.js +25 -15
  452. package/browser/Core/Container.d.ts +5 -6
  453. package/browser/Core/Container.js +3 -4
  454. package/browser/Core/Interfaces/Gradients.d.ts +2 -2
  455. package/browser/Core/Interfaces/ICircleBouncer.d.ts +1 -1
  456. package/browser/Core/Interfaces/IContainerPlugin.d.ts +4 -4
  457. package/browser/Core/Interfaces/IExternalInteractor.d.ts +1 -1
  458. package/browser/Core/Interfaces/IInteractor.d.ts +1 -1
  459. package/browser/Core/Interfaces/IMovePathGenerator.d.ts +1 -1
  460. package/browser/Core/Interfaces/IParticle.d.ts +8 -8
  461. package/browser/Core/Interfaces/IParticleGradientAnimation.d.ts +1 -1
  462. package/browser/Core/Interfaces/IParticleSpin.d.ts +1 -1
  463. package/browser/Core/Interfaces/IParticlesInteractor.d.ts +2 -2
  464. package/browser/Core/Interfaces/IPlugin.d.ts +1 -1
  465. package/browser/Core/Interfaces/index.d.ts +3 -1
  466. package/browser/Core/Interfaces/index.js +3 -1
  467. package/browser/Core/Loader.d.ts +1 -1
  468. package/browser/Core/Loader.js +6 -10
  469. package/browser/Core/Particle.d.ts +3 -6
  470. package/browser/Core/Particle.js +13 -15
  471. package/browser/Core/Particles.d.ts +3 -3
  472. package/browser/Core/Particles.js +8 -14
  473. package/browser/{Utils → Core/Utils}/Circle.d.ts +1 -1
  474. package/browser/{Utils → Core/Utils}/Circle.js +1 -1
  475. package/browser/{Utils → Core/Utils}/CircleWarp.d.ts +2 -3
  476. package/browser/{Utils → Core/Utils}/CircleWarp.js +1 -1
  477. package/browser/{Utils → Core/Utils}/Constants.d.ts +1 -4
  478. package/browser/{Utils → Core/Utils}/Constants.js +1 -4
  479. package/browser/{Utils → Core/Utils}/EventListeners.d.ts +1 -1
  480. package/browser/{Utils → Core/Utils}/EventListeners.js +11 -12
  481. package/{esm/Core → browser/Core/Utils}/ExternalInteractorBase.d.ts +4 -4
  482. package/{esm/Core → browser/Core/Utils}/ExternalInteractorBase.js +1 -2
  483. package/browser/Core/{FrameManager.d.ts → Utils/FrameManager.d.ts} +1 -1
  484. package/browser/Core/{FrameManager.js → Utils/FrameManager.js} +0 -0
  485. package/browser/Core/{InteractionManager.d.ts → Utils/InteractionManager.d.ts} +3 -3
  486. package/browser/Core/{InteractionManager.js → Utils/InteractionManager.js} +2 -3
  487. package/{Core → browser/Core/Utils}/ParticlesInteractorBase.d.ts +4 -4
  488. package/{esm/Core → browser/Core/Utils}/ParticlesInteractorBase.js +1 -2
  489. package/browser/Core/{Particle/Mover.d.ts → Utils/ParticlesMover.d.ts} +2 -2
  490. package/browser/Core/{Particle/Mover.js → Utils/ParticlesMover.js} +4 -5
  491. package/browser/{Utils → Core/Utils}/Plugins.d.ts +5 -5
  492. package/browser/{Utils → Core/Utils}/Plugins.js +0 -0
  493. package/browser/{Utils → Core/Utils}/Point.d.ts +2 -2
  494. package/browser/{Utils → Core/Utils}/Point.js +0 -0
  495. package/browser/{Utils → Core/Utils}/QuadTree.d.ts +4 -4
  496. package/browser/{Utils → Core/Utils}/QuadTree.js +2 -2
  497. package/browser/{Utils → Core/Utils}/Range.d.ts +1 -1
  498. package/browser/{Utils → Core/Utils}/Range.js +0 -0
  499. package/browser/{Utils → Core/Utils}/Rectangle.d.ts +1 -2
  500. package/browser/{Utils → Core/Utils}/Rectangle.js +0 -0
  501. package/browser/Core/{Particle → Utils}/Vector.d.ts +0 -0
  502. package/browser/Core/{Particle → Utils}/Vector.js +0 -0
  503. package/{Core/Particle → browser/Core/Utils}/Vector3d.d.ts +1 -1
  504. package/browser/Core/{Particle → Utils}/Vector3d.js +0 -0
  505. package/browser/Core/Utils/index.d.ts +16 -0
  506. package/browser/Core/Utils/index.js +16 -0
  507. package/browser/Core/index.d.ts +8 -0
  508. package/browser/Core/index.js +8 -0
  509. package/browser/Enums/AnimationStatus.d.ts +1 -1
  510. package/browser/Enums/AnimationStatus.js +1 -5
  511. package/browser/Enums/Directions/MoveDirection.d.ts +1 -1
  512. package/browser/Enums/Directions/MoveDirection.js +1 -15
  513. package/browser/Enums/Directions/OutModeDirection.d.ts +1 -1
  514. package/browser/Enums/Directions/OutModeDirection.js +1 -7
  515. package/browser/Enums/Directions/RotateDirection.d.ts +1 -1
  516. package/browser/Enums/Directions/RotateDirection.js +1 -9
  517. package/browser/Enums/Directions/TiltDirection.d.ts +1 -1
  518. package/browser/Enums/Directions/TiltDirection.js +1 -9
  519. package/browser/Enums/InteractivityDetect.d.ts +1 -1
  520. package/browser/Enums/InteractivityDetect.js +1 -9
  521. package/browser/Enums/Modes/ClickMode.d.ts +1 -1
  522. package/browser/Enums/Modes/ClickMode.js +1 -13
  523. package/browser/Enums/Modes/CollisionMode.d.ts +1 -1
  524. package/browser/Enums/Modes/CollisionMode.js +1 -9
  525. package/browser/Enums/Modes/DestroyMode.d.ts +1 -1
  526. package/browser/Enums/Modes/DestroyMode.js +1 -5
  527. package/browser/Enums/Modes/DivMode.d.ts +1 -1
  528. package/browser/Enums/Modes/DivMode.js +1 -9
  529. package/browser/Enums/Modes/HoverMode.d.ts +1 -1
  530. package/browser/Enums/Modes/HoverMode.js +1 -15
  531. package/browser/Enums/Modes/OutMode.d.ts +1 -1
  532. package/browser/Enums/Modes/OutMode.js +1 -13
  533. package/browser/Enums/Modes/ResponsiveMode.d.ts +1 -1
  534. package/browser/Enums/Modes/ResponsiveMode.js +1 -5
  535. package/browser/Enums/Modes/RollMode.d.ts +1 -1
  536. package/browser/Enums/Modes/RollMode.js +1 -6
  537. package/browser/Enums/Modes/SizeMode.d.ts +1 -1
  538. package/browser/Enums/Modes/SizeMode.js +1 -8
  539. package/browser/Enums/Modes/ThemeMode.d.ts +1 -1
  540. package/browser/Enums/Modes/ThemeMode.js +1 -6
  541. package/browser/Enums/Types/AlterType.d.ts +1 -1
  542. package/browser/Enums/Types/AlterType.js +1 -5
  543. package/browser/Enums/Types/DestroyType.d.ts +1 -1
  544. package/browser/Enums/Types/DestroyType.js +1 -9
  545. package/browser/Enums/Types/DivType.d.ts +1 -1
  546. package/browser/Enums/Types/DivType.js +1 -8
  547. package/browser/Enums/Types/EasingType.d.ts +1 -1
  548. package/browser/Enums/Types/EasingType.js +1 -11
  549. package/browser/Enums/Types/GradientType.d.ts +1 -1
  550. package/browser/Enums/Types/GradientType.js +1 -6
  551. package/browser/Enums/Types/InteractorType.d.ts +1 -1
  552. package/browser/Enums/Types/InteractorType.js +1 -5
  553. package/browser/Enums/Types/OrbitType.d.ts +1 -1
  554. package/browser/Enums/Types/OrbitType.js +1 -8
  555. package/browser/Enums/Types/ShapeType.d.ts +1 -1
  556. package/browser/Enums/Types/ShapeType.js +1 -17
  557. package/browser/Enums/Types/StartValueType.d.ts +1 -1
  558. package/browser/Enums/Types/StartValueType.js +1 -9
  559. package/browser/Interactions/External/Attract/Attractor.d.ts +2 -2
  560. package/browser/Interactions/External/Attract/Attractor.js +5 -7
  561. package/browser/Interactions/External/Attract/index.d.ts +2 -2
  562. package/browser/Interactions/External/Attract/index.js +2 -2
  563. package/browser/Interactions/External/Bounce/Bouncer.d.ts +2 -2
  564. package/browser/Interactions/External/Bounce/Bouncer.js +7 -9
  565. package/browser/Interactions/External/Bounce/index.d.ts +2 -2
  566. package/browser/Interactions/External/Bounce/index.js +2 -2
  567. package/browser/Interactions/External/Bubble/Bubbler.d.ts +3 -3
  568. package/browser/Interactions/External/Bubble/Bubbler.js +16 -18
  569. package/browser/Interactions/External/Bubble/ProcessBubbleType.d.ts +1 -1
  570. package/browser/Interactions/External/Bubble/ProcessBubbleType.js +1 -9
  571. package/browser/Interactions/External/Bubble/index.d.ts +2 -2
  572. package/browser/Interactions/External/Bubble/index.js +2 -2
  573. package/browser/Interactions/External/Connect/Connector.d.ts +2 -2
  574. package/browser/Interactions/External/Connect/Connector.js +2 -3
  575. package/browser/Interactions/External/Connect/index.d.ts +2 -2
  576. package/browser/Interactions/External/Connect/index.js +2 -2
  577. package/browser/Interactions/External/Grab/Grabber.d.ts +2 -2
  578. package/browser/Interactions/External/Grab/Grabber.js +3 -4
  579. package/browser/Interactions/External/Grab/index.d.ts +2 -2
  580. package/browser/Interactions/External/Grab/index.js +2 -2
  581. package/browser/Interactions/External/Repulse/Repulser.d.ts +2 -2
  582. package/browser/Interactions/External/Repulse/Repulser.js +8 -10
  583. package/browser/Interactions/External/Repulse/index.d.ts +2 -2
  584. package/browser/Interactions/External/Repulse/index.js +2 -2
  585. package/browser/Interactions/External/Trail/TrailMaker.d.ts +2 -3
  586. package/browser/Interactions/External/Trail/TrailMaker.js +3 -4
  587. package/browser/Interactions/External/Trail/index.d.ts +2 -2
  588. package/browser/Interactions/External/Trail/index.js +2 -2
  589. package/browser/Interactions/Particles/Attract/Attractor.d.ts +2 -4
  590. package/browser/Interactions/Particles/Attract/Attractor.js +1 -1
  591. package/browser/Interactions/Particles/Attract/index.d.ts +2 -2
  592. package/browser/Interactions/Particles/Attract/index.js +2 -2
  593. package/browser/Interactions/Particles/Collisions/Collider.d.ts +2 -3
  594. package/browser/Interactions/Particles/Collisions/Collider.js +4 -5
  595. package/browser/Interactions/Particles/Collisions/index.d.ts +2 -2
  596. package/browser/Interactions/Particles/Collisions/index.js +2 -2
  597. package/browser/Interactions/Particles/Links/LinkInstance.d.ts +1 -3
  598. package/browser/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
  599. package/browser/Interactions/Particles/Links/Linker.d.ts +3 -4
  600. package/browser/Interactions/Particles/Links/Linker.js +2 -2
  601. package/browser/Interactions/Particles/Links/index.d.ts +2 -3
  602. package/browser/Interactions/Particles/Links/index.js +4 -7
  603. package/browser/Interactions/Particles/Links/interaction.d.ts +2 -0
  604. package/browser/Interactions/Particles/Links/interaction.js +4 -0
  605. package/browser/Interactions/Particles/Links/plugin.d.ts +2 -2
  606. package/browser/Interactions/Particles/Links/plugin.js +4 -4
  607. package/browser/Options/Classes/AnimatableColor.d.ts +3 -3
  608. package/browser/Options/Classes/AnimatableColor.js +1 -1
  609. package/browser/Options/Classes/AnimatableGradient.d.ts +6 -6
  610. package/browser/Options/Classes/AnimatableGradient.js +3 -4
  611. package/browser/Options/Classes/AnimationOptions.d.ts +2 -2
  612. package/browser/Options/Classes/Background/Background.d.ts +2 -2
  613. package/browser/Options/Classes/BackgroundMask/BackgroundMask.d.ts +2 -2
  614. package/browser/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +2 -2
  615. package/browser/Options/Classes/ColorAnimation.d.ts +1 -1
  616. package/browser/Options/Classes/HslAnimation.d.ts +2 -2
  617. package/browser/Options/Classes/Interactivity/Events/ClickEvent.d.ts +2 -2
  618. package/browser/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -1
  619. package/browser/Options/Classes/Interactivity/Events/DivEvent.js +1 -2
  620. package/browser/Options/Classes/Interactivity/Events/Events.d.ts +2 -2
  621. package/browser/Options/Classes/Interactivity/Events/HoverEvent.d.ts +3 -3
  622. package/browser/Options/Classes/Interactivity/Events/Parallax.d.ts +1 -1
  623. package/browser/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
  624. package/browser/Options/Classes/Interactivity/Interactivity.js +5 -6
  625. package/browser/Options/Classes/Interactivity/Modes/Attract.d.ts +2 -2
  626. package/browser/Options/Classes/Interactivity/Modes/Attract.js +1 -2
  627. package/browser/Options/Classes/Interactivity/Modes/Bubble.d.ts +2 -2
  628. package/browser/Options/Classes/Interactivity/Modes/Bubble.js +1 -1
  629. package/browser/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +1 -1
  630. package/browser/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +1 -1
  631. package/browser/Options/Classes/Interactivity/Modes/Connect.d.ts +2 -2
  632. package/browser/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +1 -1
  633. package/browser/Options/Classes/Interactivity/Modes/Grab.d.ts +2 -2
  634. package/browser/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +2 -2
  635. package/browser/Options/Classes/Interactivity/Modes/Light.d.ts +1 -1
  636. package/browser/Options/Classes/Interactivity/Modes/Modes.d.ts +7 -7
  637. package/browser/Options/Classes/Interactivity/Modes/Modes.js +4 -4
  638. package/browser/Options/Classes/Interactivity/Modes/Push.d.ts +1 -1
  639. package/browser/Options/Classes/Interactivity/Modes/Remove.d.ts +1 -1
  640. package/browser/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -3
  641. package/browser/Options/Classes/Interactivity/Modes/Repulse.js +1 -1
  642. package/browser/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +2 -2
  643. package/browser/Options/Classes/Interactivity/Modes/RepulseBase.js +1 -2
  644. package/browser/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +1 -1
  645. package/browser/Options/Classes/Interactivity/Modes/Slow.d.ts +1 -1
  646. package/browser/Options/Classes/Interactivity/Modes/Trail.d.ts +2 -2
  647. package/browser/Options/Classes/ManualParticle.d.ts +2 -2
  648. package/browser/Options/Classes/Motion/Motion.d.ts +1 -1
  649. package/browser/Options/Classes/Options.d.ts +8 -7
  650. package/browser/Options/Classes/Options.js +14 -12
  651. package/browser/Options/Classes/OptionsColor.d.ts +2 -2
  652. package/browser/Options/Classes/Particles/Bounce/Bounce.d.ts +1 -1
  653. package/browser/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -4
  654. package/browser/Options/Classes/Particles/Collisions/Collisions.js +1 -2
  655. package/browser/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +2 -2
  656. package/browser/Options/Classes/Particles/Destroy/Destroy.d.ts +1 -1
  657. package/browser/Options/Classes/Particles/Destroy/Destroy.js +1 -2
  658. package/browser/Options/Classes/Particles/Destroy/Split.d.ts +3 -3
  659. package/browser/Options/Classes/Particles/Life/Life.d.ts +1 -1
  660. package/browser/Options/Classes/Particles/Links/Links.d.ts +2 -2
  661. package/browser/Options/Classes/Particles/Links/LinksShadow.d.ts +2 -2
  662. package/browser/Options/Classes/Particles/Links/LinksTriangle.d.ts +1 -1
  663. package/browser/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  664. package/browser/Options/Classes/Particles/Move/Move.d.ts +5 -5
  665. package/browser/Options/Classes/Particles/Move/Move.js +4 -5
  666. package/browser/Options/Classes/Particles/Move/OutModes.d.ts +2 -2
  667. package/browser/Options/Classes/Particles/Move/OutModes.js +1 -2
  668. package/browser/Options/Classes/Particles/Move/Path/Path.d.ts +3 -3
  669. package/browser/Options/Classes/Particles/Move/Spin.d.ts +3 -3
  670. package/browser/Options/Classes/Particles/Move/Trail.d.ts +2 -2
  671. package/browser/Options/Classes/Particles/Number/Density.d.ts +1 -1
  672. package/browser/Options/Classes/Particles/Number/ParticlesNumber.d.ts +2 -2
  673. package/browser/Options/Classes/Particles/Opacity/Opacity.d.ts +1 -1
  674. package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +3 -3
  675. package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -3
  676. package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +5 -5
  677. package/browser/Options/Classes/Particles/Orbit/Orbit.js +2 -2
  678. package/browser/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +1 -1
  679. package/browser/Options/Classes/Particles/ParticlesOptions.d.ts +16 -16
  680. package/browser/Options/Classes/Particles/ParticlesOptions.js +13 -13
  681. package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +1 -1
  682. package/browser/Options/Classes/Particles/Roll/Roll.d.ts +2 -2
  683. package/browser/Options/Classes/Particles/Roll/Roll.js +1 -2
  684. package/browser/Options/Classes/Particles/Roll/RollLight.d.ts +1 -1
  685. package/browser/Options/Classes/Particles/Rotate/Rotate.d.ts +3 -3
  686. package/browser/Options/Classes/Particles/Rotate/Rotate.js +1 -2
  687. package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +1 -1
  688. package/browser/Options/Classes/Particles/Shadow.d.ts +3 -3
  689. package/browser/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
  690. package/browser/Options/Classes/Particles/Shape/Shape.js +13 -14
  691. package/browser/Options/Classes/Particles/Size/Size.d.ts +2 -2
  692. package/browser/Options/Classes/Particles/Size/SizeAnimation.d.ts +3 -3
  693. package/browser/Options/Classes/Particles/Size/SizeAnimation.js +2 -3
  694. package/browser/Options/Classes/Particles/Stroke.d.ts +2 -2
  695. package/browser/Options/Classes/Particles/Tilt/Tilt.d.ts +3 -3
  696. package/browser/Options/Classes/Particles/Tilt/Tilt.js +1 -2
  697. package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +1 -1
  698. package/browser/Options/Classes/Particles/Twinkle/Twinkle.d.ts +1 -1
  699. package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  700. package/browser/Options/Classes/Particles/Wobble/Wobble.d.ts +2 -2
  701. package/browser/Options/Classes/Particles/ZIndex/ZIndex.d.ts +1 -1
  702. package/browser/Options/Classes/Random.d.ts +1 -1
  703. package/browser/Options/Classes/Responsive.d.ts +2 -2
  704. package/browser/Options/Classes/Responsive.js +4 -5
  705. package/browser/Options/Classes/Theme/Theme.d.ts +2 -2
  706. package/browser/Options/Classes/Theme/Theme.js +1 -1
  707. package/browser/Options/Classes/Theme/ThemeDefault.d.ts +2 -2
  708. package/browser/Options/Classes/Theme/ThemeDefault.js +1 -2
  709. package/browser/Options/Classes/ValueWithRandom.d.ts +2 -2
  710. package/browser/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +1 -1
  711. package/browser/Options/Interfaces/IAnimatableColor.d.ts +1 -1
  712. package/browser/Options/Interfaces/IAnimatableGradient.d.ts +1 -1
  713. package/browser/Options/Interfaces/IColorAnimation.d.ts +1 -1
  714. package/browser/Options/Interfaces/IColorAnimation.js +0 -4
  715. package/browser/Options/Interfaces/IManualParticle.d.ts +1 -1
  716. package/browser/Options/Interfaces/IOptions.d.ts +7 -6
  717. package/browser/Options/Interfaces/IOptionsGradient.d.ts +2 -2
  718. package/browser/Options/Interfaces/IResponsive.d.ts +2 -2
  719. package/browser/Options/Interfaces/IValueWithRandom.d.ts +1 -1
  720. package/browser/Options/Interfaces/Interactivity/Events/IEvents.d.ts +1 -1
  721. package/browser/Options/Interfaces/Interactivity/IInteractivity.d.ts +1 -1
  722. package/browser/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +2 -2
  723. package/browser/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +1 -1
  724. package/browser/Options/Interfaces/Interactivity/Modes/IModes.d.ts +2 -2
  725. package/browser/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +2 -2
  726. package/browser/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +1 -1
  727. package/browser/Options/Interfaces/Particles/Destroy/ISplit.d.ts +1 -1
  728. package/browser/Options/Interfaces/Particles/IParticles.d.ts +14 -14
  729. package/browser/Options/Interfaces/Particles/IShadow.d.ts +1 -1
  730. package/browser/Options/Interfaces/Particles/IStroke.d.ts +1 -1
  731. package/browser/Options/Interfaces/Particles/Links/ILinks.d.ts +1 -1
  732. package/browser/Options/Interfaces/Particles/Move/IMove.d.ts +5 -5
  733. package/browser/Options/Interfaces/Particles/Move/Path/{iPath.d.ts → IPath.d.ts} +0 -0
  734. package/browser/Options/Interfaces/Particles/Move/Path/{iPath.js → IPath.js} +0 -0
  735. package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +3 -3
  736. package/browser/Options/Interfaces/Particles/Roll/IRoll.d.ts +1 -1
  737. package/browser/Options/Interfaces/Particles/Rotate/IRotate.d.ts +1 -1
  738. package/browser/Options/Interfaces/Particles/Shape/IShape.d.ts +3 -3
  739. package/browser/Options/Interfaces/Particles/Tilt/ITilt.d.ts +1 -1
  740. package/browser/Options/Interfaces/Theme/ITheme.d.ts +2 -2
  741. package/browser/Plugins/Absorbers/AbsorberContainer.d.ts +1 -1
  742. package/browser/Plugins/Absorbers/AbsorberInstance.d.ts +6 -7
  743. package/browser/Plugins/Absorbers/AbsorberInstance.js +22 -23
  744. package/browser/Plugins/Absorbers/Absorbers.d.ts +4 -7
  745. package/browser/Plugins/Absorbers/Absorbers.js +2 -3
  746. package/browser/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +1 -1
  747. package/browser/Plugins/Absorbers/Enums/AbsorberClickMode.js +1 -7
  748. package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -4
  749. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -2
  750. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.js +1 -1
  751. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +2 -2
  752. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +1 -2
  753. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +1 -1
  754. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +1 -1
  755. package/browser/Plugins/Absorbers/index.d.ts +2 -0
  756. package/browser/Plugins/Absorbers/{plugin.js → index.js} +6 -7
  757. package/browser/Plugins/Emitters/EmitterContainer.d.ts +2 -1
  758. package/browser/Plugins/Emitters/EmitterInstance.d.ts +6 -5
  759. package/browser/Plugins/Emitters/EmitterInstance.js +37 -39
  760. package/browser/Plugins/Emitters/Emitters.d.ts +4 -5
  761. package/browser/Plugins/Emitters/Emitters.js +12 -5
  762. package/browser/Plugins/Emitters/EmittersMain.d.ts +2 -2
  763. package/browser/Plugins/Emitters/Enums/EmitterClickMode.d.ts +1 -1
  764. package/browser/Plugins/Emitters/Enums/EmitterClickMode.js +1 -7
  765. package/browser/Plugins/Emitters/Enums/EmitterShapeType.d.ts +1 -1
  766. package/browser/Plugins/Emitters/Enums/EmitterShapeType.js +1 -5
  767. package/browser/Plugins/Emitters/IEmitterShape.d.ts +1 -1
  768. package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +7 -7
  769. package/browser/Plugins/Emitters/Options/Classes/Emitter.js +4 -5
  770. package/browser/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +1 -1
  771. package/browser/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +1 -1
  772. package/browser/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +1 -1
  773. package/browser/Plugins/Emitters/Options/Classes/EmitterSize.js +1 -2
  774. package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +6 -6
  775. package/browser/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +1 -1
  776. package/browser/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +1 -1
  777. package/browser/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +1 -1
  778. package/browser/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +1 -1
  779. package/browser/Plugins/Emitters/index.d.ts +3 -0
  780. package/browser/Plugins/Emitters/{plugin.js → index.js} +10 -11
  781. package/browser/Plugins/PolygonMask/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
  782. package/browser/Plugins/PolygonMask/{Options/Interfaces/IDraw.js → Enums/PolygonMaskInlineArrangement.js} +0 -0
  783. package/browser/Plugins/PolygonMask/Enums/PolygonMaskMoveType.d.ts +4 -0
  784. package/browser/Plugins/PolygonMask/{Options/Interfaces/IDrawStroke.js → Enums/PolygonMaskMoveType.js} +0 -0
  785. package/{Plugins/PolygonMask/Enums/Type.d.ts → browser/Plugins/PolygonMask/Enums/PolygonMaskType.d.ts} +1 -1
  786. package/browser/Plugins/PolygonMask/{Options/Interfaces/IInline.js → Enums/PolygonMaskType.js} +0 -0
  787. package/browser/Plugins/PolygonMask/Enums/index.d.ts +3 -3
  788. package/browser/Plugins/PolygonMask/Enums/index.js +3 -3
  789. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +14 -14
  790. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.js +42 -42
  791. package/browser/Plugins/PolygonMask/Options/Classes/{Draw.d.ts → PolygonMaskDraw.d.ts} +7 -7
  792. package/browser/Plugins/PolygonMask/Options/Classes/{Draw.js → PolygonMaskDraw.js} +13 -12
  793. package/browser/Plugins/PolygonMask/Options/Classes/{DrawStroke.d.ts → PolygonMaskDrawStroke.d.ts} +5 -5
  794. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.js +28 -0
  795. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +12 -0
  796. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.js +16 -0
  797. package/browser/Plugins/PolygonMask/Options/Classes/{LocalSvg.d.ts → PolygonMaskLocalSvg.d.ts} +6 -6
  798. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.js +28 -0
  799. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +13 -0
  800. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.js +20 -0
  801. package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +12 -13
  802. package/browser/Plugins/PolygonMask/Options/Interfaces/{IDraw.d.ts → IPolygonMaskDraw.d.ts} +4 -4
  803. package/browser/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.js → IPolygonMaskDraw.js} +0 -0
  804. package/browser/Plugins/PolygonMask/Options/Interfaces/{IDrawStroke.d.ts → IPolygonMaskDrawStroke.d.ts} +2 -2
  805. package/browser/Plugins/PolygonMask/Options/Interfaces/{IMove.js → IPolygonMaskDrawStroke.js} +0 -0
  806. package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.d.ts +7 -0
  807. package/browser/Plugins/PolygonMask/{types.js → Options/Interfaces/IPolygonMaskInline.js} +0 -0
  808. package/browser/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.d.ts → IPolygonMaskLocalSvg.d.ts} +2 -2
  809. package/{esm/Options/Interfaces/Particles/Move/Path/iPath.js → browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.js} +0 -0
  810. package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.d.ts +8 -0
  811. package/{esm/Plugins/PolygonMask/Options/Interfaces/IDraw.js → browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.js} +0 -0
  812. package/browser/Plugins/PolygonMask/PolygonMaskInstance.d.ts +4 -6
  813. package/browser/Plugins/PolygonMask/PolygonMaskInstance.js +24 -21
  814. package/{esm/Plugins/PolygonMask/types.d.ts → browser/Plugins/PolygonMask/Types.d.ts} +1 -1
  815. package/{esm/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.js → browser/Plugins/PolygonMask/Types.js} +0 -0
  816. package/{Plugins/PolygonMask/utils.d.ts → browser/Plugins/PolygonMask/Utils.d.ts} +5 -5
  817. package/browser/Plugins/PolygonMask/{utils.js → Utils.js} +15 -12
  818. package/browser/Plugins/PolygonMask/index.d.ts +2 -0
  819. package/browser/Plugins/PolygonMask/{plugin.js → index.js} +8 -9
  820. package/browser/Plugins/PolygonMask/pathseg.js +54 -44
  821. package/browser/Shapes/Circle/CircleDrawer.d.ts +1 -1
  822. package/browser/Shapes/Circle/index.d.ts +2 -2
  823. package/browser/Shapes/Circle/index.js +2 -2
  824. package/browser/Shapes/Image/ImageDrawer.d.ts +3 -7
  825. package/browser/Shapes/Image/ImageDrawer.js +28 -111
  826. package/browser/Shapes/Image/Utils.d.ts +8 -5
  827. package/browser/Shapes/Image/Utils.js +71 -37
  828. package/browser/Shapes/Image/index.d.ts +2 -2
  829. package/browser/Shapes/Image/index.js +3 -3
  830. package/browser/Shapes/Line/LineDrawer.d.ts +1 -1
  831. package/browser/Shapes/Line/index.d.ts +2 -2
  832. package/browser/Shapes/Line/index.js +2 -2
  833. package/browser/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
  834. package/browser/Shapes/Polygon/PolygonDrawerBase.d.ts +1 -1
  835. package/browser/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
  836. package/browser/Shapes/Polygon/index.d.ts +4 -4
  837. package/browser/Shapes/Polygon/index.js +7 -7
  838. package/browser/Shapes/Square/SquareDrawer.d.ts +1 -1
  839. package/browser/Shapes/Square/index.d.ts +2 -2
  840. package/browser/Shapes/Square/index.js +3 -3
  841. package/browser/Shapes/Star/StarDrawer.d.ts +1 -1
  842. package/browser/Shapes/Star/index.d.ts +2 -2
  843. package/browser/Shapes/Star/index.js +2 -2
  844. package/browser/Shapes/Text/TextDrawer.d.ts +1 -2
  845. package/browser/Shapes/Text/index.d.ts +2 -2
  846. package/browser/Shapes/Text/index.js +3 -3
  847. package/browser/Types/ShapeData.d.ts +1 -1
  848. package/browser/Types/ShapeDrawerFunctions.d.ts +1 -1
  849. package/browser/Updaters/Angle/AngleUpdater.d.ts +1 -3
  850. package/browser/Updaters/Angle/AngleUpdater.js +8 -9
  851. package/browser/Updaters/Angle/index.d.ts +2 -2
  852. package/browser/Updaters/Angle/index.js +2 -2
  853. package/browser/Updaters/Color/ColorUpdater.d.ts +1 -3
  854. package/browser/Updaters/Color/ColorUpdater.js +3 -4
  855. package/browser/Updaters/Color/index.d.ts +2 -2
  856. package/browser/Updaters/Color/index.js +2 -2
  857. package/browser/Updaters/Life/LifeUpdater.d.ts +1 -3
  858. package/browser/Updaters/Life/index.d.ts +2 -2
  859. package/browser/Updaters/Life/index.js +2 -2
  860. package/browser/Updaters/Opacity/OpacityUpdater.d.ts +1 -3
  861. package/browser/Updaters/Opacity/OpacityUpdater.js +13 -14
  862. package/browser/Updaters/Opacity/index.d.ts +2 -2
  863. package/browser/Updaters/Opacity/index.js +2 -2
  864. package/browser/Updaters/OutModes/IBounceData.d.ts +1 -2
  865. package/browser/Updaters/OutModes/OutOfCanvasUpdater.d.ts +1 -3
  866. package/browser/Updaters/OutModes/OutOfCanvasUpdater.js +20 -21
  867. package/browser/Updaters/OutModes/Utils.js +12 -13
  868. package/browser/Updaters/OutModes/index.d.ts +2 -2
  869. package/browser/Updaters/OutModes/index.js +2 -2
  870. package/browser/Updaters/Roll/RollUpdater.d.ts +1 -2
  871. package/browser/Updaters/Roll/RollUpdater.js +4 -5
  872. package/browser/Updaters/Roll/index.d.ts +2 -2
  873. package/browser/Updaters/Roll/index.js +2 -2
  874. package/browser/Updaters/Size/SizeUpdater.d.ts +1 -2
  875. package/browser/Updaters/Size/SizeUpdater.js +6 -7
  876. package/browser/Updaters/Size/index.d.ts +2 -2
  877. package/browser/Updaters/Size/index.js +2 -2
  878. package/browser/Updaters/StrokeColor/StrokeColorUpdater.d.ts +1 -3
  879. package/browser/Updaters/StrokeColor/StrokeColorUpdater.js +3 -4
  880. package/browser/Updaters/StrokeColor/index.d.ts +2 -2
  881. package/browser/Updaters/StrokeColor/index.js +2 -2
  882. package/browser/Updaters/Tilt/TiltUpdater.d.ts +1 -3
  883. package/browser/Updaters/Tilt/TiltUpdater.js +8 -9
  884. package/browser/Updaters/Tilt/index.d.ts +2 -2
  885. package/browser/Updaters/Tilt/index.js +2 -2
  886. package/browser/Updaters/Wobble/WobbleUpdater.d.ts +1 -3
  887. package/browser/Updaters/Wobble/index.d.ts +2 -2
  888. package/browser/Updaters/Wobble/index.js +2 -2
  889. package/browser/Utils/CanvasUtils.d.ts +3 -4
  890. package/browser/Utils/CanvasUtils.js +5 -6
  891. package/browser/Utils/ColorUtils.d.ts +1 -1
  892. package/browser/Utils/ColorUtils.js +3 -4
  893. package/browser/Utils/NumberUtils.d.ts +3 -3
  894. package/browser/Utils/NumberUtils.js +18 -19
  895. package/browser/Utils/Utils.d.ts +3 -3
  896. package/browser/Utils/Utils.js +6 -7
  897. package/browser/Utils/index.d.ts +0 -9
  898. package/browser/Utils/index.js +0 -9
  899. package/browser/{main.d.ts → engine.d.ts} +5 -7
  900. package/browser/{main.js → engine.js} +10 -11
  901. package/browser/full.d.ts +2 -2
  902. package/browser/full.js +14 -14
  903. package/browser/index.d.ts +7 -17
  904. package/browser/index.engine.d.ts +13 -0
  905. package/browser/index.engine.js +12 -0
  906. package/browser/index.js +5 -13
  907. package/browser/index.slim.d.ts +6 -16
  908. package/browser/index.slim.js +5 -13
  909. package/browser/pjs.d.ts +3 -3
  910. package/browser/pjs.js +6 -5
  911. package/browser/slim.d.ts +2 -2
  912. package/browser/slim.js +40 -40
  913. package/{esm/main.d.ts → engine.d.ts} +3 -5
  914. package/{main.js → engine.js} +24 -25
  915. package/esm/Core/Canvas.d.ts +3 -3
  916. package/esm/Core/Canvas.js +25 -15
  917. package/esm/Core/Container.d.ts +5 -6
  918. package/esm/Core/Container.js +3 -4
  919. package/esm/Core/Interfaces/Gradients.d.ts +2 -2
  920. package/esm/Core/Interfaces/ICircleBouncer.d.ts +1 -1
  921. package/esm/Core/Interfaces/IContainerPlugin.d.ts +4 -4
  922. package/esm/Core/Interfaces/IExternalInteractor.d.ts +1 -1
  923. package/esm/Core/Interfaces/IInteractor.d.ts +1 -1
  924. package/esm/Core/Interfaces/IMovePathGenerator.d.ts +1 -1
  925. package/esm/Core/Interfaces/IParticle.d.ts +8 -8
  926. package/esm/Core/Interfaces/IParticleGradientAnimation.d.ts +1 -1
  927. package/esm/Core/Interfaces/IParticleSpin.d.ts +1 -1
  928. package/esm/Core/Interfaces/IParticlesInteractor.d.ts +2 -2
  929. package/esm/Core/Interfaces/IPlugin.d.ts +1 -1
  930. package/esm/Core/Interfaces/index.d.ts +3 -1
  931. package/esm/Core/Interfaces/index.js +3 -1
  932. package/esm/Core/Loader.d.ts +1 -1
  933. package/esm/Core/Loader.js +6 -10
  934. package/esm/Core/Particle.d.ts +3 -6
  935. package/esm/Core/Particle.js +13 -15
  936. package/esm/Core/Particles.d.ts +3 -3
  937. package/esm/Core/Particles.js +8 -14
  938. package/esm/{Utils → Core/Utils}/Circle.d.ts +1 -1
  939. package/esm/{Utils → Core/Utils}/Circle.js +1 -1
  940. package/{Utils → esm/Core/Utils}/CircleWarp.d.ts +2 -3
  941. package/esm/{Utils → Core/Utils}/CircleWarp.js +1 -1
  942. package/esm/{Utils → Core/Utils}/Constants.d.ts +1 -1
  943. package/esm/{Utils → Core/Utils}/Constants.js +1 -1
  944. package/esm/{Utils → Core/Utils}/EventListeners.d.ts +1 -1
  945. package/esm/{Utils → Core/Utils}/EventListeners.js +11 -12
  946. package/{browser/Core → esm/Core/Utils}/ExternalInteractorBase.d.ts +4 -4
  947. package/{browser/Core → esm/Core/Utils}/ExternalInteractorBase.js +1 -2
  948. package/{Core → esm/Core/Utils}/FrameManager.d.ts +1 -1
  949. package/esm/Core/{FrameManager.js → Utils/FrameManager.js} +0 -0
  950. package/{Core → esm/Core/Utils}/InteractionManager.d.ts +3 -3
  951. package/esm/Core/{InteractionManager.js → Utils/InteractionManager.js} +2 -3
  952. package/{browser/Core → esm/Core/Utils}/ParticlesInteractorBase.d.ts +4 -4
  953. package/{browser/Core → esm/Core/Utils}/ParticlesInteractorBase.js +1 -2
  954. package/{Core/Particle/Mover.d.ts → esm/Core/Utils/ParticlesMover.d.ts} +2 -2
  955. package/esm/Core/{Particle/Mover.js → Utils/ParticlesMover.js} +4 -5
  956. package/{Utils → esm/Core/Utils}/Plugins.d.ts +5 -5
  957. package/esm/{Utils → Core/Utils}/Plugins.js +0 -0
  958. package/esm/{Utils → Core/Utils}/Point.d.ts +2 -2
  959. package/esm/{Utils → Core/Utils}/Point.js +0 -0
  960. package/esm/{Utils → Core/Utils}/QuadTree.d.ts +4 -4
  961. package/esm/{Utils → Core/Utils}/QuadTree.js +2 -2
  962. package/{Utils → esm/Core/Utils}/Range.d.ts +1 -1
  963. package/esm/{Utils → Core/Utils}/Range.js +0 -0
  964. package/{Utils → esm/Core/Utils}/Rectangle.d.ts +1 -2
  965. package/esm/{Utils → Core/Utils}/Rectangle.js +0 -0
  966. package/esm/Core/{Particle → Utils}/Vector.d.ts +0 -0
  967. package/esm/Core/{Particle → Utils}/Vector.js +0 -0
  968. package/{browser/Core/Particle → esm/Core/Utils}/Vector3d.d.ts +1 -1
  969. package/esm/Core/{Particle → Utils}/Vector3d.js +0 -0
  970. package/esm/Core/Utils/index.d.ts +16 -0
  971. package/esm/Core/Utils/index.js +16 -0
  972. package/esm/Core/index.d.ts +8 -0
  973. package/esm/Core/index.js +8 -0
  974. package/esm/Enums/AnimationStatus.d.ts +1 -1
  975. package/esm/Enums/AnimationStatus.js +1 -5
  976. package/esm/Enums/Directions/MoveDirection.d.ts +1 -1
  977. package/esm/Enums/Directions/MoveDirection.js +1 -12
  978. package/esm/Enums/Directions/OutModeDirection.d.ts +1 -1
  979. package/esm/Enums/Directions/OutModeDirection.js +1 -7
  980. package/esm/Enums/Directions/RotateDirection.d.ts +1 -1
  981. package/esm/Enums/Directions/RotateDirection.js +1 -6
  982. package/esm/Enums/Directions/TiltDirection.d.ts +1 -1
  983. package/esm/Enums/Directions/TiltDirection.js +1 -6
  984. package/esm/Enums/InteractivityDetect.d.ts +1 -1
  985. package/esm/Enums/InteractivityDetect.js +1 -6
  986. package/esm/Enums/Modes/ClickMode.d.ts +1 -1
  987. package/esm/Enums/Modes/ClickMode.js +1 -10
  988. package/esm/Enums/Modes/CollisionMode.d.ts +1 -1
  989. package/esm/Enums/Modes/CollisionMode.js +1 -6
  990. package/esm/Enums/Modes/DestroyMode.d.ts +1 -1
  991. package/esm/Enums/Modes/DestroyMode.js +1 -5
  992. package/esm/Enums/Modes/DivMode.d.ts +1 -1
  993. package/esm/Enums/Modes/DivMode.js +1 -6
  994. package/esm/Enums/Modes/HoverMode.d.ts +1 -1
  995. package/esm/Enums/Modes/HoverMode.js +1 -12
  996. package/esm/Enums/Modes/OutMode.d.ts +1 -1
  997. package/esm/Enums/Modes/OutMode.js +1 -10
  998. package/esm/Enums/Modes/ResponsiveMode.d.ts +1 -1
  999. package/esm/Enums/Modes/ResponsiveMode.js +1 -5
  1000. package/esm/Enums/Modes/RollMode.d.ts +1 -1
  1001. package/esm/Enums/Modes/RollMode.js +1 -6
  1002. package/esm/Enums/Modes/SizeMode.d.ts +1 -1
  1003. package/esm/Enums/Modes/SizeMode.js +1 -5
  1004. package/esm/Enums/Modes/ThemeMode.d.ts +1 -1
  1005. package/esm/Enums/Modes/ThemeMode.js +1 -6
  1006. package/esm/Enums/Types/AlterType.d.ts +1 -1
  1007. package/esm/Enums/Types/AlterType.js +1 -5
  1008. package/esm/Enums/Types/DestroyType.d.ts +1 -1
  1009. package/esm/Enums/Types/DestroyType.js +1 -6
  1010. package/esm/Enums/Types/DivType.d.ts +1 -1
  1011. package/esm/Enums/Types/DivType.js +1 -5
  1012. package/esm/Enums/Types/EasingType.d.ts +1 -1
  1013. package/esm/Enums/Types/EasingType.js +1 -11
  1014. package/esm/Enums/Types/GradientType.d.ts +1 -1
  1015. package/esm/Enums/Types/GradientType.js +1 -6
  1016. package/esm/Enums/Types/InteractorType.d.ts +1 -1
  1017. package/esm/Enums/Types/InteractorType.js +1 -5
  1018. package/esm/Enums/Types/OrbitType.d.ts +1 -1
  1019. package/esm/Enums/Types/OrbitType.js +1 -5
  1020. package/esm/Enums/Types/ShapeType.d.ts +1 -1
  1021. package/esm/Enums/Types/ShapeType.js +1 -14
  1022. package/esm/Enums/Types/StartValueType.d.ts +1 -1
  1023. package/esm/Enums/Types/StartValueType.js +1 -6
  1024. package/esm/Interactions/External/Attract/Attractor.d.ts +2 -2
  1025. package/esm/Interactions/External/Attract/Attractor.js +5 -7
  1026. package/esm/Interactions/External/Attract/index.d.ts +2 -2
  1027. package/esm/Interactions/External/Attract/index.js +2 -2
  1028. package/esm/Interactions/External/Bounce/Bouncer.d.ts +2 -2
  1029. package/esm/Interactions/External/Bounce/Bouncer.js +7 -9
  1030. package/esm/Interactions/External/Bounce/index.d.ts +2 -2
  1031. package/esm/Interactions/External/Bounce/index.js +2 -2
  1032. package/esm/Interactions/External/Bubble/Bubbler.d.ts +3 -3
  1033. package/esm/Interactions/External/Bubble/Bubbler.js +16 -18
  1034. package/esm/Interactions/External/Bubble/ProcessBubbleType.d.ts +1 -1
  1035. package/esm/Interactions/External/Bubble/ProcessBubbleType.js +1 -6
  1036. package/esm/Interactions/External/Bubble/index.d.ts +2 -2
  1037. package/esm/Interactions/External/Bubble/index.js +2 -2
  1038. package/esm/Interactions/External/Connect/Connector.d.ts +2 -2
  1039. package/esm/Interactions/External/Connect/Connector.js +2 -3
  1040. package/esm/Interactions/External/Connect/index.d.ts +2 -2
  1041. package/esm/Interactions/External/Connect/index.js +2 -2
  1042. package/esm/Interactions/External/Grab/Grabber.d.ts +2 -2
  1043. package/esm/Interactions/External/Grab/Grabber.js +3 -4
  1044. package/esm/Interactions/External/Grab/index.d.ts +2 -2
  1045. package/esm/Interactions/External/Grab/index.js +2 -2
  1046. package/esm/Interactions/External/Repulse/Repulser.d.ts +2 -2
  1047. package/esm/Interactions/External/Repulse/Repulser.js +8 -10
  1048. package/esm/Interactions/External/Repulse/index.d.ts +2 -2
  1049. package/esm/Interactions/External/Repulse/index.js +2 -2
  1050. package/esm/Interactions/External/Trail/TrailMaker.d.ts +2 -3
  1051. package/esm/Interactions/External/Trail/TrailMaker.js +3 -4
  1052. package/esm/Interactions/External/Trail/index.d.ts +2 -2
  1053. package/esm/Interactions/External/Trail/index.js +2 -2
  1054. package/esm/Interactions/Particles/Attract/Attractor.d.ts +2 -4
  1055. package/esm/Interactions/Particles/Attract/Attractor.js +1 -1
  1056. package/esm/Interactions/Particles/Attract/index.d.ts +2 -2
  1057. package/esm/Interactions/Particles/Attract/index.js +2 -2
  1058. package/esm/Interactions/Particles/Collisions/Collider.d.ts +2 -3
  1059. package/esm/Interactions/Particles/Collisions/Collider.js +4 -5
  1060. package/esm/Interactions/Particles/Collisions/index.d.ts +2 -2
  1061. package/esm/Interactions/Particles/Collisions/index.js +2 -2
  1062. package/esm/Interactions/Particles/Links/LinkInstance.d.ts +1 -3
  1063. package/esm/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
  1064. package/esm/Interactions/Particles/Links/Linker.d.ts +3 -4
  1065. package/esm/Interactions/Particles/Links/Linker.js +2 -2
  1066. package/esm/Interactions/Particles/Links/index.d.ts +2 -3
  1067. package/esm/Interactions/Particles/Links/index.js +4 -7
  1068. package/esm/Interactions/Particles/Links/interaction.d.ts +2 -0
  1069. package/esm/Interactions/Particles/Links/interaction.js +4 -0
  1070. package/esm/Interactions/Particles/Links/plugin.d.ts +2 -2
  1071. package/esm/Interactions/Particles/Links/plugin.js +4 -4
  1072. package/esm/Options/Classes/AnimatableColor.d.ts +3 -3
  1073. package/esm/Options/Classes/AnimatableColor.js +1 -1
  1074. package/esm/Options/Classes/AnimatableGradient.d.ts +6 -6
  1075. package/esm/Options/Classes/AnimatableGradient.js +3 -4
  1076. package/esm/Options/Classes/AnimationOptions.d.ts +2 -2
  1077. package/esm/Options/Classes/Background/Background.d.ts +2 -2
  1078. package/esm/Options/Classes/BackgroundMask/BackgroundMask.d.ts +2 -2
  1079. package/esm/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +2 -2
  1080. package/esm/Options/Classes/ColorAnimation.d.ts +1 -1
  1081. package/esm/Options/Classes/HslAnimation.d.ts +2 -2
  1082. package/esm/Options/Classes/Interactivity/Events/ClickEvent.d.ts +2 -2
  1083. package/esm/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -1
  1084. package/esm/Options/Classes/Interactivity/Events/DivEvent.js +1 -2
  1085. package/esm/Options/Classes/Interactivity/Events/Events.d.ts +2 -2
  1086. package/esm/Options/Classes/Interactivity/Events/HoverEvent.d.ts +3 -3
  1087. package/esm/Options/Classes/Interactivity/Events/Parallax.d.ts +1 -1
  1088. package/esm/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
  1089. package/esm/Options/Classes/Interactivity/Interactivity.js +5 -6
  1090. package/esm/Options/Classes/Interactivity/Modes/Attract.d.ts +2 -2
  1091. package/esm/Options/Classes/Interactivity/Modes/Attract.js +1 -2
  1092. package/esm/Options/Classes/Interactivity/Modes/Bubble.d.ts +2 -2
  1093. package/esm/Options/Classes/Interactivity/Modes/Bubble.js +1 -1
  1094. package/esm/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +1 -1
  1095. package/esm/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +1 -1
  1096. package/esm/Options/Classes/Interactivity/Modes/Connect.d.ts +2 -2
  1097. package/esm/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +1 -1
  1098. package/esm/Options/Classes/Interactivity/Modes/Grab.d.ts +2 -2
  1099. package/esm/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +2 -2
  1100. package/esm/Options/Classes/Interactivity/Modes/Light.d.ts +1 -1
  1101. package/esm/Options/Classes/Interactivity/Modes/Modes.d.ts +7 -7
  1102. package/esm/Options/Classes/Interactivity/Modes/Modes.js +4 -4
  1103. package/esm/Options/Classes/Interactivity/Modes/Push.d.ts +1 -1
  1104. package/esm/Options/Classes/Interactivity/Modes/Remove.d.ts +1 -1
  1105. package/esm/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -3
  1106. package/esm/Options/Classes/Interactivity/Modes/Repulse.js +1 -1
  1107. package/esm/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +2 -2
  1108. package/esm/Options/Classes/Interactivity/Modes/RepulseBase.js +1 -2
  1109. package/esm/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +1 -1
  1110. package/esm/Options/Classes/Interactivity/Modes/Slow.d.ts +1 -1
  1111. package/esm/Options/Classes/Interactivity/Modes/Trail.d.ts +2 -2
  1112. package/esm/Options/Classes/ManualParticle.d.ts +2 -2
  1113. package/esm/Options/Classes/Motion/Motion.d.ts +1 -1
  1114. package/esm/Options/Classes/Options.d.ts +8 -7
  1115. package/esm/Options/Classes/Options.js +14 -12
  1116. package/esm/Options/Classes/OptionsColor.d.ts +2 -2
  1117. package/esm/Options/Classes/Particles/Bounce/Bounce.d.ts +1 -1
  1118. package/esm/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -4
  1119. package/esm/Options/Classes/Particles/Collisions/Collisions.js +1 -2
  1120. package/esm/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +2 -2
  1121. package/esm/Options/Classes/Particles/Destroy/Destroy.d.ts +1 -1
  1122. package/esm/Options/Classes/Particles/Destroy/Destroy.js +1 -2
  1123. package/esm/Options/Classes/Particles/Destroy/Split.d.ts +3 -3
  1124. package/esm/Options/Classes/Particles/Life/Life.d.ts +1 -1
  1125. package/esm/Options/Classes/Particles/Links/Links.d.ts +2 -2
  1126. package/esm/Options/Classes/Particles/Links/LinksShadow.d.ts +2 -2
  1127. package/esm/Options/Classes/Particles/Links/LinksTriangle.d.ts +1 -1
  1128. package/esm/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  1129. package/esm/Options/Classes/Particles/Move/Move.d.ts +5 -5
  1130. package/esm/Options/Classes/Particles/Move/Move.js +4 -5
  1131. package/esm/Options/Classes/Particles/Move/OutModes.d.ts +2 -2
  1132. package/esm/Options/Classes/Particles/Move/OutModes.js +1 -2
  1133. package/esm/Options/Classes/Particles/Move/Path/Path.d.ts +3 -3
  1134. package/esm/Options/Classes/Particles/Move/Spin.d.ts +3 -3
  1135. package/esm/Options/Classes/Particles/Move/Trail.d.ts +2 -2
  1136. package/esm/Options/Classes/Particles/Number/Density.d.ts +1 -1
  1137. package/esm/Options/Classes/Particles/Number/ParticlesNumber.d.ts +2 -2
  1138. package/esm/Options/Classes/Particles/Opacity/Opacity.d.ts +1 -1
  1139. package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +3 -3
  1140. package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -3
  1141. package/esm/Options/Classes/Particles/Orbit/Orbit.d.ts +5 -5
  1142. package/esm/Options/Classes/Particles/Orbit/Orbit.js +2 -2
  1143. package/esm/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +1 -1
  1144. package/esm/Options/Classes/Particles/ParticlesOptions.d.ts +16 -16
  1145. package/esm/Options/Classes/Particles/ParticlesOptions.js +13 -13
  1146. package/esm/Options/Classes/Particles/Repulse/Repulse.d.ts +1 -1
  1147. package/esm/Options/Classes/Particles/Roll/Roll.d.ts +2 -2
  1148. package/esm/Options/Classes/Particles/Roll/Roll.js +1 -2
  1149. package/esm/Options/Classes/Particles/Roll/RollLight.d.ts +1 -1
  1150. package/esm/Options/Classes/Particles/Rotate/Rotate.d.ts +3 -3
  1151. package/esm/Options/Classes/Particles/Rotate/Rotate.js +1 -2
  1152. package/esm/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +1 -1
  1153. package/esm/Options/Classes/Particles/Shadow.d.ts +3 -3
  1154. package/esm/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
  1155. package/esm/Options/Classes/Particles/Shape/Shape.js +13 -14
  1156. package/esm/Options/Classes/Particles/Size/Size.d.ts +2 -2
  1157. package/esm/Options/Classes/Particles/Size/SizeAnimation.d.ts +3 -3
  1158. package/esm/Options/Classes/Particles/Size/SizeAnimation.js +2 -3
  1159. package/esm/Options/Classes/Particles/Stroke.d.ts +2 -2
  1160. package/esm/Options/Classes/Particles/Tilt/Tilt.d.ts +3 -3
  1161. package/esm/Options/Classes/Particles/Tilt/Tilt.js +1 -2
  1162. package/esm/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +1 -1
  1163. package/esm/Options/Classes/Particles/Twinkle/Twinkle.d.ts +1 -1
  1164. package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  1165. package/esm/Options/Classes/Particles/Wobble/Wobble.d.ts +2 -2
  1166. package/esm/Options/Classes/Particles/ZIndex/ZIndex.d.ts +1 -1
  1167. package/esm/Options/Classes/Random.d.ts +1 -1
  1168. package/esm/Options/Classes/Responsive.d.ts +2 -2
  1169. package/esm/Options/Classes/Responsive.js +4 -5
  1170. package/esm/Options/Classes/Theme/Theme.d.ts +2 -2
  1171. package/esm/Options/Classes/Theme/Theme.js +1 -1
  1172. package/esm/Options/Classes/Theme/ThemeDefault.d.ts +2 -2
  1173. package/esm/Options/Classes/Theme/ThemeDefault.js +1 -2
  1174. package/esm/Options/Classes/ValueWithRandom.d.ts +2 -2
  1175. package/esm/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +1 -1
  1176. package/esm/Options/Interfaces/IAnimatableColor.d.ts +1 -1
  1177. package/esm/Options/Interfaces/IAnimatableGradient.d.ts +1 -1
  1178. package/esm/Options/Interfaces/IColorAnimation.d.ts +1 -1
  1179. package/esm/Options/Interfaces/IManualParticle.d.ts +1 -1
  1180. package/esm/Options/Interfaces/IOptions.d.ts +7 -6
  1181. package/esm/Options/Interfaces/IOptionsGradient.d.ts +2 -2
  1182. package/esm/Options/Interfaces/IResponsive.d.ts +2 -2
  1183. package/esm/Options/Interfaces/IValueWithRandom.d.ts +1 -1
  1184. package/esm/Options/Interfaces/Interactivity/Events/IEvents.d.ts +1 -1
  1185. package/esm/Options/Interfaces/Interactivity/IInteractivity.d.ts +1 -1
  1186. package/esm/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +2 -2
  1187. package/esm/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +1 -1
  1188. package/esm/Options/Interfaces/Interactivity/Modes/IModes.d.ts +2 -2
  1189. package/esm/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +2 -2
  1190. package/esm/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +1 -1
  1191. package/esm/Options/Interfaces/Particles/Destroy/ISplit.d.ts +1 -1
  1192. package/esm/Options/Interfaces/Particles/IParticles.d.ts +14 -14
  1193. package/esm/Options/Interfaces/Particles/IShadow.d.ts +1 -1
  1194. package/esm/Options/Interfaces/Particles/IStroke.d.ts +1 -1
  1195. package/esm/Options/Interfaces/Particles/Links/ILinks.d.ts +1 -1
  1196. package/esm/Options/Interfaces/Particles/Move/IMove.d.ts +5 -5
  1197. package/esm/Options/Interfaces/Particles/Move/Path/{iPath.d.ts → IPath.d.ts} +0 -0
  1198. package/esm/{Plugins/PolygonMask/Options/Interfaces/IInline.js → Options/Interfaces/Particles/Move/Path/IPath.js} +0 -0
  1199. package/esm/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +3 -3
  1200. package/esm/Options/Interfaces/Particles/Roll/IRoll.d.ts +1 -1
  1201. package/esm/Options/Interfaces/Particles/Rotate/IRotate.d.ts +1 -1
  1202. package/esm/Options/Interfaces/Particles/Shape/IShape.d.ts +3 -3
  1203. package/esm/Options/Interfaces/Particles/Tilt/ITilt.d.ts +1 -1
  1204. package/esm/Options/Interfaces/Theme/ITheme.d.ts +2 -2
  1205. package/esm/Plugins/Absorbers/AbsorberContainer.d.ts +1 -1
  1206. package/esm/Plugins/Absorbers/AbsorberInstance.d.ts +6 -7
  1207. package/esm/Plugins/Absorbers/AbsorberInstance.js +22 -23
  1208. package/esm/Plugins/Absorbers/Absorbers.d.ts +4 -7
  1209. package/esm/Plugins/Absorbers/Absorbers.js +2 -3
  1210. package/esm/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +1 -1
  1211. package/esm/Plugins/Absorbers/Enums/AbsorberClickMode.js +1 -4
  1212. package/esm/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -4
  1213. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -2
  1214. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.js +1 -1
  1215. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +2 -2
  1216. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +1 -2
  1217. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +1 -1
  1218. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +1 -1
  1219. package/esm/Plugins/Absorbers/index.d.ts +2 -0
  1220. package/esm/Plugins/Absorbers/{plugin.js → index.js} +6 -7
  1221. package/esm/Plugins/Emitters/EmitterContainer.d.ts +2 -1
  1222. package/esm/Plugins/Emitters/EmitterInstance.d.ts +6 -5
  1223. package/esm/Plugins/Emitters/EmitterInstance.js +37 -39
  1224. package/esm/Plugins/Emitters/Emitters.d.ts +4 -5
  1225. package/esm/Plugins/Emitters/Emitters.js +12 -5
  1226. package/esm/Plugins/Emitters/EmittersMain.d.ts +2 -2
  1227. package/esm/Plugins/Emitters/Enums/EmitterClickMode.d.ts +1 -1
  1228. package/esm/Plugins/Emitters/Enums/EmitterClickMode.js +1 -4
  1229. package/esm/Plugins/Emitters/Enums/EmitterShapeType.d.ts +1 -1
  1230. package/esm/Plugins/Emitters/Enums/EmitterShapeType.js +1 -5
  1231. package/esm/Plugins/Emitters/IEmitterShape.d.ts +1 -1
  1232. package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +7 -7
  1233. package/esm/Plugins/Emitters/Options/Classes/Emitter.js +4 -5
  1234. package/esm/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +1 -1
  1235. package/esm/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +1 -1
  1236. package/esm/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +1 -1
  1237. package/esm/Plugins/Emitters/Options/Classes/EmitterSize.js +1 -2
  1238. package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +6 -6
  1239. package/esm/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +1 -1
  1240. package/esm/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +1 -1
  1241. package/esm/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +1 -1
  1242. package/esm/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +1 -1
  1243. package/esm/Plugins/Emitters/index.d.ts +3 -0
  1244. package/esm/Plugins/Emitters/{plugin.js → index.js} +10 -11
  1245. package/esm/Plugins/PolygonMask/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
  1246. package/esm/Plugins/PolygonMask/{Options/Interfaces/ILocalSvg.js → Enums/PolygonMaskInlineArrangement.js} +0 -0
  1247. package/esm/Plugins/PolygonMask/Enums/PolygonMaskMoveType.d.ts +4 -0
  1248. package/esm/Plugins/PolygonMask/{Options/Interfaces/IMove.js → Enums/PolygonMaskMoveType.js} +0 -0
  1249. package/{browser/Plugins/PolygonMask/Enums/Type.d.ts → esm/Plugins/PolygonMask/Enums/PolygonMaskType.d.ts} +1 -1
  1250. package/esm/Plugins/PolygonMask/{types.js → Enums/PolygonMaskType.js} +0 -0
  1251. package/esm/Plugins/PolygonMask/Enums/index.d.ts +3 -3
  1252. package/esm/Plugins/PolygonMask/Enums/index.js +3 -3
  1253. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +14 -14
  1254. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMask.js +42 -42
  1255. package/esm/Plugins/PolygonMask/Options/Classes/{Draw.d.ts → PolygonMaskDraw.d.ts} +7 -7
  1256. package/esm/Plugins/PolygonMask/Options/Classes/{Draw.js → PolygonMaskDraw.js} +13 -12
  1257. package/esm/Plugins/PolygonMask/Options/Classes/{DrawStroke.d.ts → PolygonMaskDrawStroke.d.ts} +5 -5
  1258. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.js +25 -0
  1259. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +9 -0
  1260. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.js +13 -0
  1261. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.d.ts +11 -0
  1262. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.js +25 -0
  1263. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +10 -0
  1264. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.js +17 -0
  1265. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +12 -13
  1266. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.d.ts +8 -0
  1267. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.js +1 -0
  1268. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDrawStroke.d.ts +6 -0
  1269. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDrawStroke.js +1 -0
  1270. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.d.ts +4 -0
  1271. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.js +1 -0
  1272. package/esm/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.d.ts → IPolygonMaskLocalSvg.d.ts} +2 -2
  1273. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.js +1 -0
  1274. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.d.ts +5 -0
  1275. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.js +1 -0
  1276. package/esm/Plugins/PolygonMask/PolygonMaskInstance.d.ts +4 -6
  1277. package/esm/Plugins/PolygonMask/PolygonMaskInstance.js +24 -21
  1278. package/{browser/Plugins/PolygonMask/types.d.ts → esm/Plugins/PolygonMask/Types.d.ts} +1 -1
  1279. package/esm/Plugins/PolygonMask/Types.js +1 -0
  1280. package/{browser/Plugins/PolygonMask/utils.d.ts → esm/Plugins/PolygonMask/Utils.d.ts} +5 -5
  1281. package/esm/Plugins/PolygonMask/{utils.js → Utils.js} +15 -12
  1282. package/esm/Plugins/PolygonMask/index.d.ts +2 -0
  1283. package/esm/Plugins/PolygonMask/{plugin.js → index.js} +7 -8
  1284. package/esm/Plugins/PolygonMask/pathseg.js +54 -43
  1285. package/esm/Shapes/Circle/CircleDrawer.d.ts +1 -1
  1286. package/esm/Shapes/Circle/index.d.ts +2 -2
  1287. package/esm/Shapes/Circle/index.js +2 -2
  1288. package/esm/Shapes/Image/ImageDrawer.d.ts +3 -7
  1289. package/esm/Shapes/Image/ImageDrawer.js +28 -108
  1290. package/esm/Shapes/Image/Utils.d.ts +8 -5
  1291. package/esm/Shapes/Image/Utils.js +67 -36
  1292. package/esm/Shapes/Image/index.d.ts +2 -2
  1293. package/esm/Shapes/Image/index.js +3 -3
  1294. package/esm/Shapes/Line/LineDrawer.d.ts +1 -1
  1295. package/esm/Shapes/Line/index.d.ts +2 -2
  1296. package/esm/Shapes/Line/index.js +2 -2
  1297. package/esm/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
  1298. package/esm/Shapes/Polygon/PolygonDrawerBase.d.ts +1 -1
  1299. package/esm/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
  1300. package/esm/Shapes/Polygon/index.d.ts +4 -4
  1301. package/esm/Shapes/Polygon/index.js +7 -7
  1302. package/esm/Shapes/Square/SquareDrawer.d.ts +1 -1
  1303. package/esm/Shapes/Square/index.d.ts +2 -2
  1304. package/esm/Shapes/Square/index.js +3 -3
  1305. package/esm/Shapes/Star/StarDrawer.d.ts +1 -1
  1306. package/esm/Shapes/Star/index.d.ts +2 -2
  1307. package/esm/Shapes/Star/index.js +2 -2
  1308. package/esm/Shapes/Text/TextDrawer.d.ts +1 -2
  1309. package/esm/Shapes/Text/index.d.ts +2 -2
  1310. package/esm/Shapes/Text/index.js +3 -3
  1311. package/esm/Types/ShapeData.d.ts +1 -1
  1312. package/esm/Types/ShapeDrawerFunctions.d.ts +1 -1
  1313. package/esm/Updaters/Angle/AngleUpdater.d.ts +1 -3
  1314. package/esm/Updaters/Angle/AngleUpdater.js +8 -9
  1315. package/esm/Updaters/Angle/index.d.ts +2 -2
  1316. package/esm/Updaters/Angle/index.js +2 -2
  1317. package/esm/Updaters/Color/ColorUpdater.d.ts +1 -3
  1318. package/esm/Updaters/Color/ColorUpdater.js +3 -4
  1319. package/esm/Updaters/Color/index.d.ts +2 -2
  1320. package/esm/Updaters/Color/index.js +2 -2
  1321. package/esm/Updaters/Life/LifeUpdater.d.ts +1 -3
  1322. package/esm/Updaters/Life/index.d.ts +2 -2
  1323. package/esm/Updaters/Life/index.js +2 -2
  1324. package/esm/Updaters/Opacity/OpacityUpdater.d.ts +1 -3
  1325. package/esm/Updaters/Opacity/OpacityUpdater.js +13 -14
  1326. package/esm/Updaters/Opacity/index.d.ts +2 -2
  1327. package/esm/Updaters/Opacity/index.js +2 -2
  1328. package/esm/Updaters/OutModes/IBounceData.d.ts +1 -2
  1329. package/esm/Updaters/OutModes/OutOfCanvasUpdater.d.ts +1 -3
  1330. package/esm/Updaters/OutModes/OutOfCanvasUpdater.js +20 -21
  1331. package/esm/Updaters/OutModes/Utils.js +12 -13
  1332. package/esm/Updaters/OutModes/index.d.ts +2 -2
  1333. package/esm/Updaters/OutModes/index.js +2 -2
  1334. package/esm/Updaters/Roll/RollUpdater.d.ts +1 -2
  1335. package/esm/Updaters/Roll/RollUpdater.js +4 -5
  1336. package/esm/Updaters/Roll/index.d.ts +2 -2
  1337. package/esm/Updaters/Roll/index.js +2 -2
  1338. package/esm/Updaters/Size/SizeUpdater.d.ts +1 -2
  1339. package/esm/Updaters/Size/SizeUpdater.js +6 -7
  1340. package/esm/Updaters/Size/index.d.ts +2 -2
  1341. package/esm/Updaters/Size/index.js +2 -2
  1342. package/esm/Updaters/StrokeColor/StrokeColorUpdater.d.ts +1 -3
  1343. package/esm/Updaters/StrokeColor/StrokeColorUpdater.js +3 -4
  1344. package/esm/Updaters/StrokeColor/index.d.ts +2 -2
  1345. package/esm/Updaters/StrokeColor/index.js +2 -2
  1346. package/esm/Updaters/Tilt/TiltUpdater.d.ts +1 -3
  1347. package/esm/Updaters/Tilt/TiltUpdater.js +8 -9
  1348. package/esm/Updaters/Tilt/index.d.ts +2 -2
  1349. package/esm/Updaters/Tilt/index.js +2 -2
  1350. package/esm/Updaters/Wobble/WobbleUpdater.d.ts +1 -3
  1351. package/esm/Updaters/Wobble/index.d.ts +2 -2
  1352. package/esm/Updaters/Wobble/index.js +2 -2
  1353. package/esm/Utils/CanvasUtils.d.ts +3 -4
  1354. package/esm/Utils/CanvasUtils.js +5 -6
  1355. package/esm/Utils/ColorUtils.d.ts +1 -1
  1356. package/esm/Utils/ColorUtils.js +3 -4
  1357. package/esm/Utils/NumberUtils.d.ts +3 -3
  1358. package/esm/Utils/NumberUtils.js +18 -19
  1359. package/esm/Utils/Utils.d.ts +3 -3
  1360. package/esm/Utils/Utils.js +6 -7
  1361. package/esm/Utils/index.d.ts +0 -9
  1362. package/esm/Utils/index.js +0 -9
  1363. package/{main.d.ts → esm/engine.d.ts} +3 -5
  1364. package/esm/{main.js → engine.js} +8 -9
  1365. package/esm/full.d.ts +2 -2
  1366. package/esm/full.js +14 -14
  1367. package/esm/index.d.ts +7 -17
  1368. package/esm/index.engine.d.ts +13 -0
  1369. package/esm/index.engine.js +11 -0
  1370. package/esm/index.js +5 -13
  1371. package/esm/index.slim.d.ts +6 -16
  1372. package/esm/index.slim.js +5 -13
  1373. package/esm/pjs.d.ts +3 -3
  1374. package/esm/pjs.js +6 -5
  1375. package/esm/slim.d.ts +2 -2
  1376. package/esm/slim.js +40 -40
  1377. package/full.d.ts +2 -2
  1378. package/full.js +14 -14
  1379. package/index.d.ts +7 -17
  1380. package/index.engine.d.ts +13 -0
  1381. package/index.engine.js +27 -0
  1382. package/index.js +7 -19
  1383. package/index.slim.d.ts +6 -16
  1384. package/index.slim.js +7 -19
  1385. package/package.json +1 -1
  1386. package/pjs.d.ts +3 -3
  1387. package/pjs.js +6 -5
  1388. package/report.html +2 -2
  1389. package/report.slim.html +2 -2
  1390. package/slim.d.ts +2 -2
  1391. package/slim.js +40 -40
  1392. package/tsparticles.engine.js +6746 -0
  1393. package/tsparticles.engine.min.js +2 -0
  1394. package/tsparticles.interaction.external.attract.js +4976 -0
  1395. package/tsparticles.interaction.external.attract.min.js +2 -0
  1396. package/tsparticles.interaction.external.bounce.js +4997 -0
  1397. package/tsparticles.interaction.external.bounce.min.js +2 -0
  1398. package/tsparticles.interaction.external.bubble.js +5083 -0
  1399. package/tsparticles.interaction.external.bubble.min.js +2 -0
  1400. package/tsparticles.interaction.external.connect.js +4845 -0
  1401. package/tsparticles.interaction.external.connect.min.js +2 -0
  1402. package/tsparticles.interaction.external.grab.js +4851 -0
  1403. package/tsparticles.interaction.external.grab.min.js +2 -0
  1404. package/tsparticles.interaction.external.repulse.js +5028 -0
  1405. package/tsparticles.interaction.external.repulse.min.js +2 -0
  1406. package/tsparticles.interaction.external.trail.js +4853 -0
  1407. package/tsparticles.interaction.external.trail.min.js +2 -0
  1408. package/tsparticles.interaction.particles.attract.js +4834 -0
  1409. package/tsparticles.interaction.particles.attract.min.js +2 -0
  1410. package/tsparticles.interaction.particles.collisions.js +4999 -0
  1411. package/tsparticles.interaction.particles.collisions.min.js +2 -0
  1412. package/tsparticles.interaction.particles.links.js +5071 -0
  1413. package/tsparticles.interaction.particles.links.min.js +2 -0
  1414. package/tsparticles.js +6713 -7012
  1415. package/tsparticles.min.js +2 -2
  1416. package/tsparticles.pathseg.min.js +2 -0
  1417. package/tsparticles.plugins.absorbers.js +5331 -0
  1418. package/tsparticles.plugins.absorbers.min.js +2 -0
  1419. package/tsparticles.plugins.emitters.js +5426 -0
  1420. package/tsparticles.plugins.emitters.min.js +2 -0
  1421. package/tsparticles.plugins.polygonMask.js +5862 -0
  1422. package/tsparticles.plugins.polygonMask.min.js +2 -0
  1423. package/tsparticles.shape.circle.js +59 -0
  1424. package/tsparticles.shape.circle.min.js +2 -0
  1425. package/tsparticles.shape.image.js +5021 -0
  1426. package/tsparticles.shape.image.min.js +2 -0
  1427. package/tsparticles.shape.line.js +60 -0
  1428. package/tsparticles.shape.line.min.js +2 -0
  1429. package/tsparticles.shape.polygon.js +131 -0
  1430. package/tsparticles.shape.polygon.min.js +2 -0
  1431. package/tsparticles.shape.square.js +62 -0
  1432. package/tsparticles.shape.square.min.js +2 -0
  1433. package/tsparticles.shape.star.js +71 -0
  1434. package/tsparticles.shape.star.min.js +2 -0
  1435. package/tsparticles.shape.text.js +4865 -0
  1436. package/tsparticles.shape.text.min.js +2 -0
  1437. package/tsparticles.slim.js +3970 -4228
  1438. package/tsparticles.slim.min.js +2 -2
  1439. package/tsparticles.updater.angle.js +4880 -0
  1440. package/tsparticles.updater.angle.min.js +2 -0
  1441. package/tsparticles.updater.color.js +4862 -0
  1442. package/tsparticles.updater.color.min.js +2 -0
  1443. package/tsparticles.updater.life.js +4864 -0
  1444. package/tsparticles.updater.life.min.js +2 -0
  1445. package/tsparticles.updater.opacity.js +4914 -0
  1446. package/tsparticles.updater.opacity.min.js +2 -0
  1447. package/tsparticles.updater.outModes.js +4998 -0
  1448. package/tsparticles.updater.outModes.min.js +2 -0
  1449. package/tsparticles.updater.roll.js +4862 -0
  1450. package/tsparticles.updater.roll.min.js +2 -0
  1451. package/tsparticles.updater.size.js +4870 -0
  1452. package/tsparticles.updater.size.min.js +2 -0
  1453. package/tsparticles.updater.strokeColor.js +4875 -0
  1454. package/tsparticles.updater.strokeColor.min.js +2 -0
  1455. package/tsparticles.updater.tilt.js +4881 -0
  1456. package/tsparticles.updater.tilt.min.js +2 -0
  1457. package/tsparticles.updater.wobble.js +4850 -0
  1458. package/tsparticles.updater.wobble.min.js +2 -0
  1459. package/Plugins/Absorbers/plugin.d.ts +0 -2
  1460. package/Plugins/Emitters/plugin.d.ts +0 -3
  1461. package/Plugins/PolygonMask/Enums/InlineArrangement.d.ts +0 -8
  1462. package/Plugins/PolygonMask/Enums/InlineArrangement.js +0 -11
  1463. package/Plugins/PolygonMask/Enums/MoveType.d.ts +0 -4
  1464. package/Plugins/PolygonMask/Enums/MoveType.js +0 -8
  1465. package/Plugins/PolygonMask/Enums/Type.js +0 -10
  1466. package/Plugins/PolygonMask/Options/Classes/DrawStroke.js +0 -28
  1467. package/Plugins/PolygonMask/Options/Classes/Inline.d.ts +0 -9
  1468. package/Plugins/PolygonMask/Options/Classes/Inline.js +0 -17
  1469. package/Plugins/PolygonMask/Options/Classes/LocalSvg.d.ts +0 -11
  1470. package/Plugins/PolygonMask/Options/Classes/LocalSvg.js +0 -28
  1471. package/Plugins/PolygonMask/Options/Classes/Move.d.ts +0 -10
  1472. package/Plugins/PolygonMask/Options/Classes/Move.js +0 -21
  1473. package/Plugins/PolygonMask/Options/Interfaces/IDraw.d.ts +0 -8
  1474. package/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.d.ts +0 -6
  1475. package/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +0 -4
  1476. package/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +0 -5
  1477. package/Plugins/PolygonMask/plugin.d.ts +0 -2
  1478. package/browser/Plugins/Absorbers/plugin.d.ts +0 -2
  1479. package/browser/Plugins/Emitters/plugin.d.ts +0 -3
  1480. package/browser/Plugins/PolygonMask/Enums/InlineArrangement.d.ts +0 -8
  1481. package/browser/Plugins/PolygonMask/Enums/InlineArrangement.js +0 -8
  1482. package/browser/Plugins/PolygonMask/Enums/MoveType.d.ts +0 -4
  1483. package/browser/Plugins/PolygonMask/Enums/MoveType.js +0 -5
  1484. package/browser/Plugins/PolygonMask/Enums/Type.js +0 -7
  1485. package/browser/Plugins/PolygonMask/Options/Classes/DrawStroke.js +0 -27
  1486. package/browser/Plugins/PolygonMask/Options/Classes/Inline.d.ts +0 -12
  1487. package/browser/Plugins/PolygonMask/Options/Classes/Inline.js +0 -16
  1488. package/browser/Plugins/PolygonMask/Options/Classes/LocalSvg.js +0 -27
  1489. package/browser/Plugins/PolygonMask/Options/Classes/Move.d.ts +0 -13
  1490. package/browser/Plugins/PolygonMask/Options/Classes/Move.js +0 -20
  1491. package/browser/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +0 -7
  1492. package/browser/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +0 -8
  1493. package/browser/Plugins/PolygonMask/plugin.d.ts +0 -2
  1494. package/esm/Plugins/Absorbers/plugin.d.ts +0 -2
  1495. package/esm/Plugins/Emitters/plugin.d.ts +0 -3
  1496. package/esm/Plugins/PolygonMask/Enums/InlineArrangement.d.ts +0 -8
  1497. package/esm/Plugins/PolygonMask/Enums/InlineArrangement.js +0 -8
  1498. package/esm/Plugins/PolygonMask/Enums/MoveType.d.ts +0 -4
  1499. package/esm/Plugins/PolygonMask/Enums/MoveType.js +0 -5
  1500. package/esm/Plugins/PolygonMask/Enums/Type.js +0 -7
  1501. package/esm/Plugins/PolygonMask/Options/Classes/DrawStroke.js +0 -24
  1502. package/esm/Plugins/PolygonMask/Options/Classes/Inline.d.ts +0 -9
  1503. package/esm/Plugins/PolygonMask/Options/Classes/Inline.js +0 -13
  1504. package/esm/Plugins/PolygonMask/Options/Classes/LocalSvg.d.ts +0 -11
  1505. package/esm/Plugins/PolygonMask/Options/Classes/LocalSvg.js +0 -24
  1506. package/esm/Plugins/PolygonMask/Options/Classes/Move.d.ts +0 -10
  1507. package/esm/Plugins/PolygonMask/Options/Classes/Move.js +0 -17
  1508. package/esm/Plugins/PolygonMask/Options/Interfaces/IDraw.d.ts +0 -8
  1509. package/esm/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.d.ts +0 -6
  1510. package/esm/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +0 -4
  1511. package/esm/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +0 -5
  1512. package/esm/Plugins/PolygonMask/plugin.d.ts +0 -2
  1513. package/tsparticles.pathseg.js +0 -1472
@@ -0,0 +1,4870 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if (typeof exports === "object" && typeof module === "object") module.exports = factory(); else if (typeof define === "function" && define.amd) define([], factory); else {
3
+ var a = factory();
4
+ for (var i in a) (typeof exports === "object" ? exports : root)[i] = a[i];
5
+ }
6
+ })(window, (function() {
7
+ return function() {
8
+ "use strict";
9
+ var __webpack_require__ = {};
10
+ !function() {
11
+ __webpack_require__.d = function(exports, definition) {
12
+ for (var key in definition) {
13
+ if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
14
+ Object.defineProperty(exports, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ }
19
+ }
20
+ };
21
+ }();
22
+ !function() {
23
+ __webpack_require__.o = function(obj, prop) {
24
+ return Object.prototype.hasOwnProperty.call(obj, prop);
25
+ };
26
+ }();
27
+ !function() {
28
+ __webpack_require__.r = function(exports) {
29
+ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
30
+ Object.defineProperty(exports, Symbol.toStringTag, {
31
+ value: "Module"
32
+ });
33
+ }
34
+ Object.defineProperty(exports, "__esModule", {
35
+ value: true
36
+ });
37
+ };
38
+ }();
39
+ var __webpack_exports__ = {};
40
+ __webpack_require__.r(__webpack_exports__);
41
+ __webpack_require__.d(__webpack_exports__, {
42
+ loadSizeUpdater: function() {
43
+ return loadSizeUpdater;
44
+ }
45
+ });
46
+ class Circle_Circle extends(null && Range){
47
+ constructor(x, y, radius) {
48
+ super(x, y);
49
+ this.radius = radius;
50
+ }
51
+ contains(point) {
52
+ return getDistance(point, this.position) <= this.radius;
53
+ }
54
+ intersects(range) {
55
+ const rect = range;
56
+ const circle = range;
57
+ const pos1 = this.position;
58
+ const pos2 = range.position;
59
+ const xDist = Math.abs(pos2.x - pos1.x);
60
+ const yDist = Math.abs(pos2.y - pos1.y);
61
+ const r = this.radius;
62
+ if (circle.radius !== undefined) {
63
+ const rSum = r + circle.radius;
64
+ const dist = Math.sqrt(xDist * xDist + yDist + yDist);
65
+ return rSum > dist;
66
+ } else if (rect.size !== undefined) {
67
+ const w = rect.size.width;
68
+ const h = rect.size.height;
69
+ const edges = Math.pow(xDist - w, 2) + Math.pow(yDist - h, 2);
70
+ if (xDist > r + w || yDist > r + h) {
71
+ return false;
72
+ }
73
+ if (xDist <= w || yDist <= h) {
74
+ return true;
75
+ }
76
+ return edges <= r * r;
77
+ }
78
+ return false;
79
+ }
80
+ }
81
+ class CircleWarp_CircleWarp extends(null && Circle){
82
+ constructor(x, y, radius, canvasSize) {
83
+ super(x, y, radius);
84
+ this.canvasSize = canvasSize;
85
+ this.canvasSize = {
86
+ height: canvasSize.height,
87
+ width: canvasSize.width
88
+ };
89
+ }
90
+ contains(point) {
91
+ if (super.contains(point)) {
92
+ return true;
93
+ }
94
+ const posNE = {
95
+ x: point.x - this.canvasSize.width,
96
+ y: point.y
97
+ };
98
+ if (super.contains(posNE)) {
99
+ return true;
100
+ }
101
+ const posSE = {
102
+ x: point.x - this.canvasSize.width,
103
+ y: point.y - this.canvasSize.height
104
+ };
105
+ if (super.contains(posSE)) {
106
+ return true;
107
+ }
108
+ const posSW = {
109
+ x: point.x,
110
+ y: point.y - this.canvasSize.height
111
+ };
112
+ return super.contains(posSW);
113
+ }
114
+ intersects(range) {
115
+ if (super.intersects(range)) {
116
+ return true;
117
+ }
118
+ const rect = range;
119
+ const circle = range;
120
+ const newPos = {
121
+ x: range.position.x - this.canvasSize.width,
122
+ y: range.position.y - this.canvasSize.height
123
+ };
124
+ if (circle.radius !== undefined) {
125
+ const biggerCircle = new Circle(newPos.x, newPos.y, circle.radius * 2);
126
+ return super.intersects(biggerCircle);
127
+ } else if (rect.size !== undefined) {
128
+ const rectSW = new Rectangle(newPos.x, newPos.y, rect.size.width * 2, rect.size.height * 2);
129
+ return super.intersects(rectSW);
130
+ }
131
+ return false;
132
+ }
133
+ }
134
+ class Constants_Constants {}
135
+ Constants_Constants.generatedAttribute = "generated";
136
+ Constants_Constants.randomColorValue = "random";
137
+ Constants_Constants.midColorValue = "mid";
138
+ Constants_Constants.touchEndEvent = "touchend";
139
+ Constants_Constants.mouseDownEvent = "mousedown";
140
+ Constants_Constants.mouseUpEvent = "mouseup";
141
+ Constants_Constants.mouseMoveEvent = "mousemove";
142
+ Constants_Constants.touchStartEvent = "touchstart";
143
+ Constants_Constants.touchMoveEvent = "touchmove";
144
+ Constants_Constants.mouseLeaveEvent = "mouseleave";
145
+ Constants_Constants.mouseOutEvent = "mouseout";
146
+ Constants_Constants.touchCancelEvent = "touchcancel";
147
+ Constants_Constants.resizeEvent = "resize";
148
+ Constants_Constants.visibilityChangeEvent = "visibilitychange";
149
+ Constants_Constants.noPolygonDataLoaded = "No polygon data loaded.";
150
+ Constants_Constants.noPolygonFound = "No polygon found, you need to specify SVG url in config.";
151
+ function manageListener(element, event, handler, add, options) {
152
+ if (add) {
153
+ let addOptions = {
154
+ passive: true
155
+ };
156
+ if (typeof options === "boolean") {
157
+ addOptions.capture = options;
158
+ } else if (options !== undefined) {
159
+ addOptions = options;
160
+ }
161
+ element.addEventListener(event, handler, addOptions);
162
+ } else {
163
+ const removeOptions = options;
164
+ element.removeEventListener(event, handler, removeOptions);
165
+ }
166
+ }
167
+ class EventListeners_EventListeners {
168
+ constructor(container) {
169
+ this.container = container;
170
+ this.canPush = true;
171
+ this.mouseMoveHandler = e => this.mouseTouchMove(e);
172
+ this.touchStartHandler = e => this.mouseTouchMove(e);
173
+ this.touchMoveHandler = e => this.mouseTouchMove(e);
174
+ this.touchEndHandler = () => this.mouseTouchFinish();
175
+ this.mouseLeaveHandler = () => this.mouseTouchFinish();
176
+ this.touchCancelHandler = () => this.mouseTouchFinish();
177
+ this.touchEndClickHandler = e => this.mouseTouchClick(e);
178
+ this.mouseUpHandler = e => this.mouseTouchClick(e);
179
+ this.mouseDownHandler = () => this.mouseDown();
180
+ this.visibilityChangeHandler = () => this.handleVisibilityChange();
181
+ this.themeChangeHandler = e => this.handleThemeChange(e);
182
+ this.oldThemeChangeHandler = e => this.handleThemeChange(e);
183
+ this.resizeHandler = () => this.handleWindowResize();
184
+ }
185
+ addListeners() {
186
+ this.manageListeners(true);
187
+ }
188
+ removeListeners() {
189
+ this.manageListeners(false);
190
+ }
191
+ manageListeners(add) {
192
+ var _a;
193
+ const container = this.container;
194
+ const options = container.actualOptions;
195
+ const detectType = options.interactivity.detectsOn;
196
+ let mouseLeaveEvent = Constants.mouseLeaveEvent;
197
+ if (detectType === "window") {
198
+ container.interactivity.element = window;
199
+ mouseLeaveEvent = Constants.mouseOutEvent;
200
+ } else if (detectType === "parent" && container.canvas.element) {
201
+ const canvasEl = container.canvas.element;
202
+ container.interactivity.element = (_a = canvasEl.parentElement) !== null && _a !== void 0 ? _a : canvasEl.parentNode;
203
+ } else {
204
+ container.interactivity.element = container.canvas.element;
205
+ }
206
+ const mediaMatch = !isSsr() && typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)");
207
+ if (mediaMatch) {
208
+ if (mediaMatch.addEventListener !== undefined) {
209
+ manageListener(mediaMatch, "change", this.themeChangeHandler, add);
210
+ } else if (mediaMatch.addListener !== undefined) {
211
+ if (add) {
212
+ mediaMatch.addListener(this.oldThemeChangeHandler);
213
+ } else {
214
+ mediaMatch.removeListener(this.oldThemeChangeHandler);
215
+ }
216
+ }
217
+ }
218
+ const interactivityEl = container.interactivity.element;
219
+ if (!interactivityEl) {
220
+ return;
221
+ }
222
+ const html = interactivityEl;
223
+ if (options.interactivity.events.onHover.enable || options.interactivity.events.onClick.enable) {
224
+ manageListener(interactivityEl, Constants.mouseMoveEvent, this.mouseMoveHandler, add);
225
+ manageListener(interactivityEl, Constants.touchStartEvent, this.touchStartHandler, add);
226
+ manageListener(interactivityEl, Constants.touchMoveEvent, this.touchMoveHandler, add);
227
+ if (!options.interactivity.events.onClick.enable) {
228
+ manageListener(interactivityEl, Constants.touchEndEvent, this.touchEndHandler, add);
229
+ } else {
230
+ manageListener(interactivityEl, Constants.touchEndEvent, this.touchEndClickHandler, add);
231
+ manageListener(interactivityEl, Constants.mouseUpEvent, this.mouseUpHandler, add);
232
+ manageListener(interactivityEl, Constants.mouseDownEvent, this.mouseDownHandler, add);
233
+ }
234
+ manageListener(interactivityEl, mouseLeaveEvent, this.mouseLeaveHandler, add);
235
+ manageListener(interactivityEl, Constants.touchCancelEvent, this.touchCancelHandler, add);
236
+ }
237
+ if (container.canvas.element) {
238
+ container.canvas.element.style.pointerEvents = html === container.canvas.element ? "initial" : "none";
239
+ }
240
+ if (options.interactivity.events.resize) {
241
+ if (typeof ResizeObserver !== "undefined") {
242
+ if (this.resizeObserver && !add) {
243
+ if (container.canvas.element) {
244
+ this.resizeObserver.unobserve(container.canvas.element);
245
+ }
246
+ this.resizeObserver.disconnect();
247
+ delete this.resizeObserver;
248
+ } else if (!this.resizeObserver && add && container.canvas.element) {
249
+ this.resizeObserver = new ResizeObserver((entries => {
250
+ const entry = entries.find((e => e.target === container.canvas.element));
251
+ if (!entry) {
252
+ return;
253
+ }
254
+ this.handleWindowResize();
255
+ }));
256
+ this.resizeObserver.observe(container.canvas.element);
257
+ }
258
+ } else {
259
+ manageListener(window, Constants.resizeEvent, this.resizeHandler, add);
260
+ }
261
+ }
262
+ if (document) {
263
+ manageListener(document, Constants.visibilityChangeEvent, this.visibilityChangeHandler, add, false);
264
+ }
265
+ }
266
+ handleWindowResize() {
267
+ if (this.resizeTimeout) {
268
+ clearTimeout(this.resizeTimeout);
269
+ delete this.resizeTimeout;
270
+ }
271
+ this.resizeTimeout = setTimeout((async () => {
272
+ var _a;
273
+ return await ((_a = this.container.canvas) === null || _a === void 0 ? void 0 : _a.windowResize());
274
+ }), 500);
275
+ }
276
+ handleVisibilityChange() {
277
+ const container = this.container;
278
+ const options = container.actualOptions;
279
+ this.mouseTouchFinish();
280
+ if (!options.pauseOnBlur) {
281
+ return;
282
+ }
283
+ if (document === null || document === void 0 ? void 0 : document.hidden) {
284
+ container.pageHidden = true;
285
+ container.pause();
286
+ } else {
287
+ container.pageHidden = false;
288
+ if (container.getAnimationStatus()) {
289
+ container.play(true);
290
+ } else {
291
+ container.draw(true);
292
+ }
293
+ }
294
+ }
295
+ mouseDown() {
296
+ const interactivity = this.container.interactivity;
297
+ if (interactivity) {
298
+ const mouse = interactivity.mouse;
299
+ mouse.clicking = true;
300
+ mouse.downPosition = mouse.position;
301
+ }
302
+ }
303
+ mouseTouchMove(e) {
304
+ var _a, _b, _c, _d, _e, _f, _g;
305
+ const container = this.container;
306
+ const options = container.actualOptions;
307
+ if (((_a = container.interactivity) === null || _a === void 0 ? void 0 : _a.element) === undefined) {
308
+ return;
309
+ }
310
+ container.interactivity.mouse.inside = true;
311
+ let pos;
312
+ const canvas = container.canvas.element;
313
+ if (e.type.startsWith("mouse")) {
314
+ this.canPush = true;
315
+ const mouseEvent = e;
316
+ if (container.interactivity.element === window) {
317
+ if (canvas) {
318
+ const clientRect = canvas.getBoundingClientRect();
319
+ pos = {
320
+ x: mouseEvent.clientX - clientRect.left,
321
+ y: mouseEvent.clientY - clientRect.top
322
+ };
323
+ }
324
+ } else if (options.interactivity.detectsOn === "parent") {
325
+ const source = mouseEvent.target;
326
+ const target = mouseEvent.currentTarget;
327
+ const canvasEl = container.canvas.element;
328
+ if (source && target && canvasEl) {
329
+ const sourceRect = source.getBoundingClientRect();
330
+ const targetRect = target.getBoundingClientRect();
331
+ const canvasRect = canvasEl.getBoundingClientRect();
332
+ pos = {
333
+ x: mouseEvent.offsetX + 2 * sourceRect.left - (targetRect.left + canvasRect.left),
334
+ y: mouseEvent.offsetY + 2 * sourceRect.top - (targetRect.top + canvasRect.top)
335
+ };
336
+ } else {
337
+ pos = {
338
+ x: (_b = mouseEvent.offsetX) !== null && _b !== void 0 ? _b : mouseEvent.clientX,
339
+ y: (_c = mouseEvent.offsetY) !== null && _c !== void 0 ? _c : mouseEvent.clientY
340
+ };
341
+ }
342
+ } else {
343
+ if (mouseEvent.target === container.canvas.element) {
344
+ pos = {
345
+ x: (_d = mouseEvent.offsetX) !== null && _d !== void 0 ? _d : mouseEvent.clientX,
346
+ y: (_e = mouseEvent.offsetY) !== null && _e !== void 0 ? _e : mouseEvent.clientY
347
+ };
348
+ }
349
+ }
350
+ } else {
351
+ this.canPush = e.type !== "touchmove";
352
+ const touchEvent = e;
353
+ const lastTouch = touchEvent.touches[touchEvent.touches.length - 1];
354
+ const canvasRect = canvas === null || canvas === void 0 ? void 0 : canvas.getBoundingClientRect();
355
+ pos = {
356
+ x: lastTouch.clientX - ((_f = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.left) !== null && _f !== void 0 ? _f : 0),
357
+ y: lastTouch.clientY - ((_g = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.top) !== null && _g !== void 0 ? _g : 0)
358
+ };
359
+ }
360
+ const pxRatio = container.retina.pixelRatio;
361
+ if (pos) {
362
+ pos.x *= pxRatio;
363
+ pos.y *= pxRatio;
364
+ }
365
+ container.interactivity.mouse.position = pos;
366
+ container.interactivity.status = Constants.mouseMoveEvent;
367
+ }
368
+ mouseTouchFinish() {
369
+ const interactivity = this.container.interactivity;
370
+ if (interactivity === undefined) {
371
+ return;
372
+ }
373
+ const mouse = interactivity.mouse;
374
+ delete mouse.position;
375
+ delete mouse.clickPosition;
376
+ delete mouse.downPosition;
377
+ interactivity.status = Constants.mouseLeaveEvent;
378
+ mouse.inside = false;
379
+ mouse.clicking = false;
380
+ }
381
+ mouseTouchClick(e) {
382
+ const container = this.container;
383
+ const options = container.actualOptions;
384
+ const mouse = container.interactivity.mouse;
385
+ mouse.inside = true;
386
+ let handled = false;
387
+ const mousePosition = mouse.position;
388
+ if (mousePosition === undefined || !options.interactivity.events.onClick.enable) {
389
+ return;
390
+ }
391
+ for (const [, plugin] of container.plugins) {
392
+ if (plugin.clickPositionValid !== undefined) {
393
+ handled = plugin.clickPositionValid(mousePosition);
394
+ if (handled) {
395
+ break;
396
+ }
397
+ }
398
+ }
399
+ if (!handled) {
400
+ this.doMouseTouchClick(e);
401
+ }
402
+ mouse.clicking = false;
403
+ }
404
+ doMouseTouchClick(e) {
405
+ const container = this.container;
406
+ const options = container.actualOptions;
407
+ if (this.canPush) {
408
+ const mousePos = container.interactivity.mouse.position;
409
+ if (mousePos) {
410
+ container.interactivity.mouse.clickPosition = {
411
+ x: mousePos.x,
412
+ y: mousePos.y
413
+ };
414
+ } else {
415
+ return;
416
+ }
417
+ container.interactivity.mouse.clickTime = (new Date).getTime();
418
+ const onClick = options.interactivity.events.onClick;
419
+ if (onClick.mode instanceof Array) {
420
+ for (const mode of onClick.mode) {
421
+ this.handleClickMode(mode);
422
+ }
423
+ } else {
424
+ this.handleClickMode(onClick.mode);
425
+ }
426
+ }
427
+ if (e.type === "touchend") {
428
+ setTimeout((() => this.mouseTouchFinish()), 500);
429
+ }
430
+ }
431
+ handleThemeChange(e) {
432
+ const mediaEvent = e;
433
+ const themeName = mediaEvent.matches ? this.container.options.defaultDarkTheme : this.container.options.defaultLightTheme;
434
+ const theme = this.container.options.themes.find((theme => theme.name === themeName));
435
+ if (theme && theme.default.auto) {
436
+ this.container.loadTheme(themeName);
437
+ }
438
+ }
439
+ handleClickMode(mode) {
440
+ const container = this.container;
441
+ const options = container.actualOptions;
442
+ const pushNb = options.interactivity.modes.push.quantity;
443
+ const removeNb = options.interactivity.modes.remove.quantity;
444
+ switch (mode) {
445
+ case "push":
446
+ {
447
+ if (pushNb > 0) {
448
+ const pushOptions = options.interactivity.modes.push;
449
+ const group = itemFromArray([ undefined, ...pushOptions.groups ]);
450
+ const groupOptions = group !== undefined ? container.actualOptions.particles.groups[group] : undefined;
451
+ container.particles.push(pushNb, container.interactivity.mouse, groupOptions, group);
452
+ }
453
+ break;
454
+ }
455
+
456
+ case "remove":
457
+ container.particles.removeQuantity(removeNb);
458
+ break;
459
+
460
+ case "bubble":
461
+ container.bubble.clicking = true;
462
+ break;
463
+
464
+ case "repulse":
465
+ container.repulse.clicking = true;
466
+ container.repulse.count = 0;
467
+ for (const particle of container.repulse.particles) {
468
+ particle.velocity.setTo(particle.initialVelocity);
469
+ }
470
+ container.repulse.particles = [];
471
+ container.repulse.finish = false;
472
+ setTimeout((() => {
473
+ if (!container.destroyed) {
474
+ container.repulse.clicking = false;
475
+ }
476
+ }), options.interactivity.modes.repulse.duration * 1e3);
477
+ break;
478
+
479
+ case "attract":
480
+ container.attract.clicking = true;
481
+ container.attract.count = 0;
482
+ for (const particle of container.attract.particles) {
483
+ particle.velocity.setTo(particle.initialVelocity);
484
+ }
485
+ container.attract.particles = [];
486
+ container.attract.finish = false;
487
+ setTimeout((() => {
488
+ if (!container.destroyed) {
489
+ container.attract.clicking = false;
490
+ }
491
+ }), options.interactivity.modes.attract.duration * 1e3);
492
+ break;
493
+
494
+ case "pause":
495
+ if (container.getAnimationStatus()) {
496
+ container.pause();
497
+ } else {
498
+ container.play();
499
+ }
500
+ break;
501
+ }
502
+ for (const [, plugin] of container.plugins) {
503
+ if (plugin.handleClickMode) {
504
+ plugin.handleClickMode(mode);
505
+ }
506
+ }
507
+ }
508
+ }
509
+ class InteractionManager_InteractionManager {
510
+ constructor(container) {
511
+ this.container = container;
512
+ this.externalInteractors = [];
513
+ this.particleInteractors = [];
514
+ this.init();
515
+ }
516
+ init() {
517
+ const interactors = Plugins.getInteractors(this.container, true);
518
+ for (const interactor of interactors) {
519
+ switch (interactor.type) {
520
+ case 0:
521
+ this.externalInteractors.push(interactor);
522
+ break;
523
+
524
+ case 1:
525
+ this.particleInteractors.push(interactor);
526
+ break;
527
+ }
528
+ }
529
+ }
530
+ externalInteract(delta) {
531
+ for (const interactor of this.externalInteractors) {
532
+ if (interactor.isEnabled()) {
533
+ interactor.interact(delta);
534
+ }
535
+ }
536
+ }
537
+ particlesInteract(particle, delta) {
538
+ for (const interactor of this.externalInteractors) {
539
+ interactor.reset(particle);
540
+ }
541
+ for (const interactor of this.particleInteractors) {
542
+ if (interactor.isEnabled(particle)) {
543
+ interactor.interact(particle, delta);
544
+ }
545
+ }
546
+ }
547
+ }
548
+ function applyDistance(particle) {
549
+ const initialPosition = particle.initialPosition;
550
+ const {dx: dx, dy: dy} = getDistances(initialPosition, particle.position);
551
+ const dxFixed = Math.abs(dx), dyFixed = Math.abs(dy);
552
+ const hDistance = particle.retina.maxDistance.horizontal;
553
+ const vDistance = particle.retina.maxDistance.vertical;
554
+ if (!hDistance && !vDistance) {
555
+ return;
556
+ }
557
+ if ((hDistance && dxFixed >= hDistance || vDistance && dyFixed >= vDistance) && !particle.misplaced) {
558
+ particle.misplaced = !!hDistance && dxFixed > hDistance || !!vDistance && dyFixed > vDistance;
559
+ if (hDistance) {
560
+ particle.velocity.x = particle.velocity.y / 2 - particle.velocity.x;
561
+ }
562
+ if (vDistance) {
563
+ particle.velocity.y = particle.velocity.x / 2 - particle.velocity.y;
564
+ }
565
+ } else if ((!hDistance || dxFixed < hDistance) && (!vDistance || dyFixed < vDistance) && particle.misplaced) {
566
+ particle.misplaced = false;
567
+ } else if (particle.misplaced) {
568
+ const pos = particle.position, vel = particle.velocity;
569
+ if (hDistance && (pos.x < initialPosition.x && vel.x < 0 || pos.x > initialPosition.x && vel.x > 0)) {
570
+ vel.x *= -Math.random();
571
+ }
572
+ if (vDistance && (pos.y < initialPosition.y && vel.y < 0 || pos.y > initialPosition.y && vel.y > 0)) {
573
+ vel.y *= -Math.random();
574
+ }
575
+ }
576
+ }
577
+ class ParticlesMover_ParticlesMover {
578
+ constructor(container) {
579
+ this.container = container;
580
+ }
581
+ move(particle, delta) {
582
+ if (particle.destroyed) {
583
+ return;
584
+ }
585
+ this.moveParticle(particle, delta);
586
+ this.moveParallax(particle);
587
+ }
588
+ moveParticle(particle, delta) {
589
+ var _a, _b, _c;
590
+ var _d, _e;
591
+ const particleOptions = particle.options;
592
+ const moveOptions = particleOptions.move;
593
+ if (!moveOptions.enable) {
594
+ return;
595
+ }
596
+ const container = this.container, slowFactor = this.getProximitySpeedFactor(particle), baseSpeed = ((_a = (_d = particle.retina).moveSpeed) !== null && _a !== void 0 ? _a : _d.moveSpeed = getRangeValue(moveOptions.speed) * container.retina.pixelRatio) * container.retina.reduceFactor, moveDrift = (_b = (_e = particle.retina).moveDrift) !== null && _b !== void 0 ? _b : _e.moveDrift = getRangeValue(particle.options.move.drift) * container.retina.pixelRatio, maxSize = getRangeMax(particleOptions.size.value) * container.retina.pixelRatio, sizeFactor = moveOptions.size ? particle.getRadius() / maxSize : 1, diffFactor = 2, speedFactor = sizeFactor * slowFactor * (delta.factor || 1) / diffFactor, moveSpeed = baseSpeed * speedFactor;
597
+ this.applyPath(particle, delta);
598
+ const gravityOptions = moveOptions.gravity;
599
+ const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
600
+ if (gravityOptions.enable && moveSpeed) {
601
+ particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
602
+ }
603
+ if (moveDrift && moveSpeed) {
604
+ particle.velocity.x += moveDrift * delta.factor / (60 * moveSpeed);
605
+ }
606
+ const decay = particle.moveDecay;
607
+ if (decay != 1) {
608
+ particle.velocity.multTo(decay);
609
+ }
610
+ const velocity = particle.velocity.mult(moveSpeed);
611
+ const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
612
+ if (gravityOptions.enable && gravityOptions.maxSpeed > 0 && (!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed)) {
613
+ velocity.y = gravityFactor * maxSpeed;
614
+ if (moveSpeed) {
615
+ particle.velocity.y = velocity.y / moveSpeed;
616
+ }
617
+ }
618
+ const zIndexOptions = particle.options.zIndex, zVelocityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.velocityRate;
619
+ if (moveOptions.spin.enable) {
620
+ this.spin(particle, moveSpeed);
621
+ } else {
622
+ if (zVelocityFactor != 1) {
623
+ velocity.multTo(zVelocityFactor);
624
+ }
625
+ particle.position.addTo(velocity);
626
+ if (moveOptions.vibrate) {
627
+ particle.position.x += Math.sin(particle.position.x * Math.cos(particle.position.y));
628
+ particle.position.y += Math.cos(particle.position.y * Math.sin(particle.position.x));
629
+ }
630
+ }
631
+ applyDistance(particle);
632
+ }
633
+ spin(particle, moveSpeed) {
634
+ const container = this.container;
635
+ if (!particle.spin) {
636
+ return;
637
+ }
638
+ const updateFunc = {
639
+ x: particle.spin.direction === "clockwise" ? Math.cos : Math.sin,
640
+ y: particle.spin.direction === "clockwise" ? Math.sin : Math.cos
641
+ };
642
+ particle.position.x = particle.spin.center.x + particle.spin.radius * updateFunc.x(particle.spin.angle);
643
+ particle.position.y = particle.spin.center.y + particle.spin.radius * updateFunc.y(particle.spin.angle);
644
+ particle.spin.radius += particle.spin.acceleration;
645
+ const maxCanvasSize = Math.max(container.canvas.size.width, container.canvas.size.height);
646
+ if (particle.spin.radius > maxCanvasSize / 2) {
647
+ particle.spin.radius = maxCanvasSize / 2;
648
+ particle.spin.acceleration *= -1;
649
+ } else if (particle.spin.radius < 0) {
650
+ particle.spin.radius = 0;
651
+ particle.spin.acceleration *= -1;
652
+ }
653
+ particle.spin.angle += moveSpeed / 100 * (1 - particle.spin.radius / maxCanvasSize);
654
+ }
655
+ applyPath(particle, delta) {
656
+ const particlesOptions = particle.options;
657
+ const pathOptions = particlesOptions.move.path;
658
+ const pathEnabled = pathOptions.enable;
659
+ if (!pathEnabled) {
660
+ return;
661
+ }
662
+ const container = this.container;
663
+ if (particle.lastPathTime <= particle.pathDelay) {
664
+ particle.lastPathTime += delta.value;
665
+ return;
666
+ }
667
+ const path = container.pathGenerator.generate(particle);
668
+ particle.velocity.addTo(path);
669
+ if (pathOptions.clamp) {
670
+ particle.velocity.x = clamp(particle.velocity.x, -1, 1);
671
+ particle.velocity.y = clamp(particle.velocity.y, -1, 1);
672
+ }
673
+ particle.lastPathTime -= particle.pathDelay;
674
+ }
675
+ moveParallax(particle) {
676
+ const container = this.container;
677
+ const options = container.actualOptions;
678
+ if (isSsr() || !options.interactivity.events.onHover.parallax.enable) {
679
+ return;
680
+ }
681
+ const parallaxForce = options.interactivity.events.onHover.parallax.force;
682
+ const mousePos = container.interactivity.mouse.position;
683
+ if (!mousePos) {
684
+ return;
685
+ }
686
+ const canvasCenter = {
687
+ x: container.canvas.size.width / 2,
688
+ y: container.canvas.size.height / 2
689
+ };
690
+ const parallaxSmooth = options.interactivity.events.onHover.parallax.smooth;
691
+ const factor = particle.getRadius() / parallaxForce;
692
+ const tmp = {
693
+ x: (mousePos.x - canvasCenter.x) * factor,
694
+ y: (mousePos.y - canvasCenter.y) * factor
695
+ };
696
+ particle.offset.x += (tmp.x - particle.offset.x) / parallaxSmooth;
697
+ particle.offset.y += (tmp.y - particle.offset.y) / parallaxSmooth;
698
+ }
699
+ getProximitySpeedFactor(particle) {
700
+ const container = this.container;
701
+ const options = container.actualOptions;
702
+ const active = isInArray("slow", options.interactivity.events.onHover.mode);
703
+ if (!active) {
704
+ return 1;
705
+ }
706
+ const mousePos = this.container.interactivity.mouse.position;
707
+ if (!mousePos) {
708
+ return 1;
709
+ }
710
+ const particlePos = particle.getPosition();
711
+ const dist = getDistance(mousePos, particlePos);
712
+ const radius = container.retina.slowModeRadius;
713
+ if (dist > radius) {
714
+ return 1;
715
+ }
716
+ const proximityFactor = dist / radius || 0;
717
+ const slowFactor = options.interactivity.modes.slow.factor;
718
+ return proximityFactor / slowFactor;
719
+ }
720
+ }
721
+ const plugins = null && [];
722
+ const interactorsInitializers = new Map;
723
+ const updatersInitializers = new Map;
724
+ const interactors = new Map;
725
+ const updaters = new Map;
726
+ const presets = new Map;
727
+ const drawers = new Map;
728
+ const pathGenerators = new Map;
729
+ class Plugins_Plugins {
730
+ static getPlugin(plugin) {
731
+ return plugins.find((t => t.id === plugin));
732
+ }
733
+ static addPlugin(plugin) {
734
+ if (!Plugins_Plugins.getPlugin(plugin.id)) {
735
+ plugins.push(plugin);
736
+ }
737
+ }
738
+ static getAvailablePlugins(container) {
739
+ const res = new Map;
740
+ for (const plugin of plugins) {
741
+ if (!plugin.needsPlugin(container.actualOptions)) {
742
+ continue;
743
+ }
744
+ res.set(plugin.id, plugin.getPlugin(container));
745
+ }
746
+ return res;
747
+ }
748
+ static loadOptions(options, sourceOptions) {
749
+ for (const plugin of plugins) {
750
+ plugin.loadOptions(options, sourceOptions);
751
+ }
752
+ }
753
+ static getPreset(preset) {
754
+ return presets.get(preset);
755
+ }
756
+ static addPreset(presetKey, options, override = false) {
757
+ if (override || !Plugins_Plugins.getPreset(presetKey)) {
758
+ presets.set(presetKey, options);
759
+ }
760
+ }
761
+ static addShapeDrawer(type, drawer) {
762
+ if (!Plugins_Plugins.getShapeDrawer(type)) {
763
+ drawers.set(type, drawer);
764
+ }
765
+ }
766
+ static getShapeDrawer(type) {
767
+ return drawers.get(type);
768
+ }
769
+ static getSupportedShapes() {
770
+ return drawers.keys();
771
+ }
772
+ static getPathGenerator(type) {
773
+ return pathGenerators.get(type);
774
+ }
775
+ static addPathGenerator(type, pathGenerator) {
776
+ if (!Plugins_Plugins.getPathGenerator(type)) {
777
+ pathGenerators.set(type, pathGenerator);
778
+ }
779
+ }
780
+ static getInteractors(container, force = false) {
781
+ let res = interactors.get(container);
782
+ if (!res || force) {
783
+ res = [ ...interactorsInitializers.values() ].map((t => t(container)));
784
+ interactors.set(container, res);
785
+ }
786
+ return res;
787
+ }
788
+ static addInteractor(name, initInteractor) {
789
+ interactorsInitializers.set(name, initInteractor);
790
+ }
791
+ static getUpdaters(container, force = false) {
792
+ let res = updaters.get(container);
793
+ if (!res || force) {
794
+ res = [ ...updatersInitializers.values() ].map((t => t(container)));
795
+ updaters.set(container, res);
796
+ }
797
+ return res;
798
+ }
799
+ static addParticleUpdater(name, initUpdater) {
800
+ updatersInitializers.set(name, initUpdater);
801
+ }
802
+ }
803
+ class QuadTree_QuadTree {
804
+ constructor(rectangle, capacity) {
805
+ this.rectangle = rectangle;
806
+ this.capacity = capacity;
807
+ this.points = [];
808
+ this.divided = false;
809
+ }
810
+ subdivide() {
811
+ const x = this.rectangle.position.x;
812
+ const y = this.rectangle.position.y;
813
+ const w = this.rectangle.size.width;
814
+ const h = this.rectangle.size.height;
815
+ const capacity = this.capacity;
816
+ this.northEast = new QuadTree_QuadTree(new Rectangle(x, y, w / 2, h / 2), capacity);
817
+ this.northWest = new QuadTree_QuadTree(new Rectangle(x + w / 2, y, w / 2, h / 2), capacity);
818
+ this.southEast = new QuadTree_QuadTree(new Rectangle(x, y + h / 2, w / 2, h / 2), capacity);
819
+ this.southWest = new QuadTree_QuadTree(new Rectangle(x + w / 2, y + h / 2, w / 2, h / 2), capacity);
820
+ this.divided = true;
821
+ }
822
+ insert(point) {
823
+ var _a, _b, _c, _d, _e;
824
+ if (!this.rectangle.contains(point.position)) {
825
+ return false;
826
+ }
827
+ if (this.points.length < this.capacity) {
828
+ this.points.push(point);
829
+ return true;
830
+ }
831
+ if (!this.divided) {
832
+ this.subdivide();
833
+ }
834
+ return (_e = ((_a = this.northEast) === null || _a === void 0 ? void 0 : _a.insert(point)) || ((_b = this.northWest) === null || _b === void 0 ? void 0 : _b.insert(point)) || ((_c = this.southEast) === null || _c === void 0 ? void 0 : _c.insert(point)) || ((_d = this.southWest) === null || _d === void 0 ? void 0 : _d.insert(point))) !== null && _e !== void 0 ? _e : false;
835
+ }
836
+ queryCircle(position, radius) {
837
+ return this.query(new Circle(position.x, position.y, radius));
838
+ }
839
+ queryCircleWarp(position, radius, containerOrSize) {
840
+ const container = containerOrSize;
841
+ const size = containerOrSize;
842
+ return this.query(new CircleWarp(position.x, position.y, radius, container.canvas !== undefined ? container.canvas.size : size));
843
+ }
844
+ queryRectangle(position, size) {
845
+ return this.query(new Rectangle(position.x, position.y, size.width, size.height));
846
+ }
847
+ query(range, found) {
848
+ var _a, _b, _c, _d;
849
+ const res = found !== null && found !== void 0 ? found : [];
850
+ if (!range.intersects(this.rectangle)) {
851
+ return [];
852
+ } else {
853
+ for (const p of this.points) {
854
+ if (!range.contains(p.position) && getDistance(range.position, p.position) > p.particle.getRadius()) {
855
+ continue;
856
+ }
857
+ res.push(p.particle);
858
+ }
859
+ if (this.divided) {
860
+ (_a = this.northEast) === null || _a === void 0 ? void 0 : _a.query(range, res);
861
+ (_b = this.northWest) === null || _b === void 0 ? void 0 : _b.query(range, res);
862
+ (_c = this.southEast) === null || _c === void 0 ? void 0 : _c.query(range, res);
863
+ (_d = this.southWest) === null || _d === void 0 ? void 0 : _d.query(range, res);
864
+ }
865
+ }
866
+ return res;
867
+ }
868
+ }
869
+ class Canvas_Canvas {
870
+ constructor(container) {
871
+ this.container = container;
872
+ this.size = {
873
+ height: 0,
874
+ width: 0
875
+ };
876
+ this.context = null;
877
+ this.generatedCanvas = false;
878
+ }
879
+ init() {
880
+ this.resize();
881
+ this.initStyle();
882
+ this.initCover();
883
+ this.initTrail();
884
+ this.initBackground();
885
+ this.paint();
886
+ }
887
+ loadCanvas(canvas) {
888
+ var _a;
889
+ if (this.generatedCanvas) {
890
+ (_a = this.element) === null || _a === void 0 ? void 0 : _a.remove();
891
+ }
892
+ this.generatedCanvas = canvas.dataset && Constants.generatedAttribute in canvas.dataset ? canvas.dataset[Constants.generatedAttribute] === "true" : this.generatedCanvas;
893
+ this.element = canvas;
894
+ this.originalStyle = deepExtend({}, this.element.style);
895
+ this.size.height = canvas.offsetHeight;
896
+ this.size.width = canvas.offsetWidth;
897
+ this.context = this.element.getContext("2d");
898
+ this.container.retina.init();
899
+ this.initBackground();
900
+ }
901
+ destroy() {
902
+ var _a;
903
+ if (this.generatedCanvas) {
904
+ (_a = this.element) === null || _a === void 0 ? void 0 : _a.remove();
905
+ }
906
+ this.draw((ctx => {
907
+ clear(ctx, this.size);
908
+ }));
909
+ }
910
+ paint() {
911
+ const options = this.container.actualOptions;
912
+ this.draw((ctx => {
913
+ if (options.backgroundMask.enable && options.backgroundMask.cover && this.coverColor) {
914
+ clear(ctx, this.size);
915
+ this.paintBase(getStyleFromRgb(this.coverColor, this.coverColor.a));
916
+ } else {
917
+ this.paintBase();
918
+ }
919
+ }));
920
+ }
921
+ clear() {
922
+ const options = this.container.actualOptions;
923
+ const trail = options.particles.move.trail;
924
+ if (options.backgroundMask.enable) {
925
+ this.paint();
926
+ } else if (trail.enable && trail.length > 0 && this.trailFillColor) {
927
+ this.paintBase(getStyleFromRgb(this.trailFillColor, 1 / trail.length));
928
+ } else {
929
+ this.draw((ctx => {
930
+ clear(ctx, this.size);
931
+ }));
932
+ }
933
+ }
934
+ async windowResize() {
935
+ if (!this.element) {
936
+ return;
937
+ }
938
+ const container = this.container;
939
+ this.resize();
940
+ const needsRefresh = container.updateActualOptions();
941
+ container.particles.setDensity();
942
+ for (const [, plugin] of container.plugins) {
943
+ if (plugin.resize !== undefined) {
944
+ plugin.resize();
945
+ }
946
+ }
947
+ if (needsRefresh) {
948
+ await container.refresh();
949
+ }
950
+ }
951
+ resize() {
952
+ if (!this.element) {
953
+ return;
954
+ }
955
+ const container = this.container;
956
+ const pxRatio = container.retina.pixelRatio;
957
+ const size = container.canvas.size;
958
+ const oldSize = {
959
+ width: size.width,
960
+ height: size.height
961
+ };
962
+ size.width = this.element.offsetWidth * pxRatio;
963
+ size.height = this.element.offsetHeight * pxRatio;
964
+ this.element.width = size.width;
965
+ this.element.height = size.height;
966
+ if (this.container.started) {
967
+ this.resizeFactor = {
968
+ width: size.width / oldSize.width,
969
+ height: size.height / oldSize.height
970
+ };
971
+ }
972
+ }
973
+ drawConnectLine(p1, p2) {
974
+ this.draw((ctx => {
975
+ var _a;
976
+ const lineStyle = this.lineStyle(p1, p2);
977
+ if (!lineStyle) {
978
+ return;
979
+ }
980
+ const pos1 = p1.getPosition();
981
+ const pos2 = p2.getPosition();
982
+ drawConnectLine(ctx, (_a = p1.retina.linksWidth) !== null && _a !== void 0 ? _a : this.container.retina.linksWidth, lineStyle, pos1, pos2);
983
+ }));
984
+ }
985
+ drawGrabLine(particle, lineColor, opacity, mousePos) {
986
+ const container = this.container;
987
+ this.draw((ctx => {
988
+ var _a;
989
+ const beginPos = particle.getPosition();
990
+ drawGrabLine(ctx, (_a = particle.retina.linksWidth) !== null && _a !== void 0 ? _a : container.retina.linksWidth, beginPos, mousePos, lineColor, opacity);
991
+ }));
992
+ }
993
+ drawParticle(particle, delta) {
994
+ var _a, _b, _c, _d, _e, _f;
995
+ if (particle.spawning || particle.destroyed) {
996
+ return;
997
+ }
998
+ const pfColor = particle.getFillColor();
999
+ const psColor = (_a = particle.getStrokeColor()) !== null && _a !== void 0 ? _a : pfColor;
1000
+ if (!pfColor && !psColor) {
1001
+ return;
1002
+ }
1003
+ let [fColor, sColor] = this.getPluginParticleColors(particle);
1004
+ const pOptions = particle.options;
1005
+ const twinkle = pOptions.twinkle.particles;
1006
+ const twinkling = twinkle.enable && Math.random() < twinkle.frequency;
1007
+ if (!fColor || !sColor) {
1008
+ const twinkleRgb = colorToHsl(twinkle.color);
1009
+ if (!fColor) {
1010
+ fColor = twinkling && twinkleRgb !== undefined ? twinkleRgb : pfColor ? pfColor : undefined;
1011
+ }
1012
+ if (!sColor) {
1013
+ sColor = twinkling && twinkleRgb !== undefined ? twinkleRgb : psColor ? psColor : undefined;
1014
+ }
1015
+ }
1016
+ const options = this.container.actualOptions;
1017
+ const zIndexOptions = particle.options.zIndex;
1018
+ const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
1019
+ const radius = particle.getRadius();
1020
+ const opacity = twinkling ? twinkle.opacity : (_d = (_b = particle.bubble.opacity) !== null && _b !== void 0 ? _b : (_c = particle.opacity) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : 1;
1021
+ const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
1022
+ const zOpacity = opacity * zOpacityFactor;
1023
+ const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
1024
+ if (!fillColorValue && !sColor) {
1025
+ return;
1026
+ }
1027
+ this.draw((ctx => {
1028
+ const zSizeFactor = (1 - particle.zIndexFactor) ** zIndexOptions.sizeRate;
1029
+ const zStrokeOpacity = strokeOpacity * zOpacityFactor;
1030
+ const strokeColorValue = sColor ? getStyleFromHsl(sColor, zStrokeOpacity) : fillColorValue;
1031
+ if (radius <= 0) {
1032
+ return;
1033
+ }
1034
+ const container = this.container;
1035
+ for (const updater of container.particles.updaters) {
1036
+ if (updater.beforeDraw) {
1037
+ updater.beforeDraw(particle);
1038
+ }
1039
+ }
1040
+ drawParticle(this.container, ctx, particle, delta, fillColorValue, strokeColorValue, options.backgroundMask.enable, options.backgroundMask.composite, radius * zSizeFactor, zOpacity, particle.options.shadow, particle.gradient);
1041
+ for (const updater of container.particles.updaters) {
1042
+ if (updater.afterDraw) {
1043
+ updater.afterDraw(particle);
1044
+ }
1045
+ }
1046
+ }));
1047
+ }
1048
+ drawPlugin(plugin, delta) {
1049
+ this.draw((ctx => {
1050
+ drawPlugin(ctx, plugin, delta);
1051
+ }));
1052
+ }
1053
+ drawParticlePlugin(plugin, particle, delta) {
1054
+ this.draw((ctx => {
1055
+ drawParticlePlugin(ctx, plugin, particle, delta);
1056
+ }));
1057
+ }
1058
+ initBackground() {
1059
+ const options = this.container.actualOptions;
1060
+ const background = options.background;
1061
+ const element = this.element;
1062
+ const elementStyle = element === null || element === void 0 ? void 0 : element.style;
1063
+ if (!elementStyle) {
1064
+ return;
1065
+ }
1066
+ if (background.color) {
1067
+ const color = colorToRgb(background.color);
1068
+ elementStyle.backgroundColor = color ? getStyleFromRgb(color, background.opacity) : "";
1069
+ } else {
1070
+ elementStyle.backgroundColor = "";
1071
+ }
1072
+ elementStyle.backgroundImage = background.image || "";
1073
+ elementStyle.backgroundPosition = background.position || "";
1074
+ elementStyle.backgroundRepeat = background.repeat || "";
1075
+ elementStyle.backgroundSize = background.size || "";
1076
+ }
1077
+ draw(cb) {
1078
+ if (!this.context) {
1079
+ return;
1080
+ }
1081
+ return cb(this.context);
1082
+ }
1083
+ initCover() {
1084
+ const options = this.container.actualOptions;
1085
+ const cover = options.backgroundMask.cover;
1086
+ const color = cover.color;
1087
+ const coverRgb = colorToRgb(color);
1088
+ if (coverRgb) {
1089
+ this.coverColor = {
1090
+ r: coverRgb.r,
1091
+ g: coverRgb.g,
1092
+ b: coverRgb.b,
1093
+ a: cover.opacity
1094
+ };
1095
+ }
1096
+ }
1097
+ initTrail() {
1098
+ const options = this.container.actualOptions;
1099
+ const trail = options.particles.move.trail;
1100
+ const fillColor = colorToRgb(trail.fillColor);
1101
+ if (fillColor) {
1102
+ const trail = options.particles.move.trail;
1103
+ this.trailFillColor = {
1104
+ r: fillColor.r,
1105
+ g: fillColor.g,
1106
+ b: fillColor.b,
1107
+ a: 1 / trail.length
1108
+ };
1109
+ }
1110
+ }
1111
+ getPluginParticleColors(particle) {
1112
+ let fColor;
1113
+ let sColor;
1114
+ for (const [, plugin] of this.container.plugins) {
1115
+ if (!fColor && plugin.particleFillColor) {
1116
+ fColor = colorToHsl(plugin.particleFillColor(particle));
1117
+ }
1118
+ if (!sColor && plugin.particleStrokeColor) {
1119
+ sColor = colorToHsl(plugin.particleStrokeColor(particle));
1120
+ }
1121
+ if (fColor && sColor) {
1122
+ break;
1123
+ }
1124
+ }
1125
+ return [ fColor, sColor ];
1126
+ }
1127
+ initStyle() {
1128
+ const element = this.element, options = this.container.actualOptions;
1129
+ if (!element) {
1130
+ return;
1131
+ }
1132
+ const originalStyle = this.originalStyle;
1133
+ if (options.fullScreen.enable) {
1134
+ this.originalStyle = deepExtend({}, element.style);
1135
+ element.style.setProperty("position", "fixed", "important");
1136
+ element.style.setProperty("z-index", options.fullScreen.zIndex.toString(10), "important");
1137
+ element.style.setProperty("top", "0", "important");
1138
+ element.style.setProperty("left", "0", "important");
1139
+ element.style.setProperty("width", "100%", "important");
1140
+ element.style.setProperty("height", "100%", "important");
1141
+ } else if (originalStyle) {
1142
+ element.style.position = originalStyle.position;
1143
+ element.style.zIndex = originalStyle.zIndex;
1144
+ element.style.top = originalStyle.top;
1145
+ element.style.left = originalStyle.left;
1146
+ element.style.width = originalStyle.width;
1147
+ element.style.height = originalStyle.height;
1148
+ }
1149
+ for (const key in options.style) {
1150
+ if (!key || !options.style) {
1151
+ continue;
1152
+ }
1153
+ const value = options.style[key];
1154
+ if (!value) {
1155
+ continue;
1156
+ }
1157
+ element.style.setProperty(key, value, "important");
1158
+ }
1159
+ }
1160
+ paintBase(baseColor) {
1161
+ this.draw((ctx => {
1162
+ paintBase(ctx, this.size, baseColor);
1163
+ }));
1164
+ }
1165
+ lineStyle(p1, p2) {
1166
+ return this.draw((ctx => {
1167
+ const options = this.container.actualOptions;
1168
+ const connectOptions = options.interactivity.modes.connect;
1169
+ return gradient(ctx, p1, p2, connectOptions.links.opacity);
1170
+ }));
1171
+ }
1172
+ }
1173
+ class Trail_Trail {
1174
+ constructor() {
1175
+ this.delay = 1;
1176
+ this.pauseOnStop = false;
1177
+ this.quantity = 1;
1178
+ }
1179
+ load(data) {
1180
+ if (data === undefined) {
1181
+ return;
1182
+ }
1183
+ if (data.delay !== undefined) {
1184
+ this.delay = data.delay;
1185
+ }
1186
+ if (data.quantity !== undefined) {
1187
+ this.quantity = data.quantity;
1188
+ }
1189
+ if (data.particles !== undefined) {
1190
+ this.particles = deepExtend({}, data.particles);
1191
+ }
1192
+ if (data.pauseOnStop !== undefined) {
1193
+ this.pauseOnStop = data.pauseOnStop;
1194
+ }
1195
+ }
1196
+ }
1197
+ class Modes_Modes {
1198
+ constructor() {
1199
+ this.attract = new Attract;
1200
+ this.bounce = new Bounce;
1201
+ this.bubble = new Bubble;
1202
+ this.connect = new Connect;
1203
+ this.grab = new Grab;
1204
+ this.light = new Light;
1205
+ this.push = new Push;
1206
+ this.remove = new Remove;
1207
+ this.repulse = new Repulse;
1208
+ this.slow = new Slow;
1209
+ this.trail = new Trail;
1210
+ }
1211
+ load(data) {
1212
+ if (data === undefined) {
1213
+ return;
1214
+ }
1215
+ this.attract.load(data.attract);
1216
+ this.bubble.load(data.bubble);
1217
+ this.connect.load(data.connect);
1218
+ this.grab.load(data.grab);
1219
+ this.light.load(data.light);
1220
+ this.push.load(data.push);
1221
+ this.remove.load(data.remove);
1222
+ this.repulse.load(data.repulse);
1223
+ this.slow.load(data.slow);
1224
+ this.trail.load(data.trail);
1225
+ }
1226
+ }
1227
+ class Interactivity_Interactivity {
1228
+ constructor() {
1229
+ this.detectsOn = "window";
1230
+ this.events = new Events;
1231
+ this.modes = new Modes;
1232
+ }
1233
+ get detect_on() {
1234
+ return this.detectsOn;
1235
+ }
1236
+ set detect_on(value) {
1237
+ this.detectsOn = value;
1238
+ }
1239
+ load(data) {
1240
+ var _a, _b, _c;
1241
+ if (data === undefined) {
1242
+ return;
1243
+ }
1244
+ const detectsOn = (_a = data.detectsOn) !== null && _a !== void 0 ? _a : data.detect_on;
1245
+ if (detectsOn !== undefined) {
1246
+ this.detectsOn = detectsOn;
1247
+ }
1248
+ this.events.load(data.events);
1249
+ this.modes.load(data.modes);
1250
+ if (((_c = (_b = data.modes) === null || _b === void 0 ? void 0 : _b.slow) === null || _c === void 0 ? void 0 : _c.active) === true) {
1251
+ if (this.events.onHover.mode instanceof Array) {
1252
+ if (this.events.onHover.mode.indexOf("slow") < 0) {
1253
+ this.events.onHover.mode.push("slow");
1254
+ }
1255
+ } else if (this.events.onHover.mode !== "slow") {
1256
+ this.events.onHover.mode = [ this.events.onHover.mode, "slow" ];
1257
+ }
1258
+ }
1259
+ }
1260
+ }
1261
+ class ManualParticle_ManualParticle {
1262
+ load(data) {
1263
+ var _a, _b;
1264
+ if (!data) {
1265
+ return;
1266
+ }
1267
+ if (data.position !== undefined) {
1268
+ this.position = {
1269
+ x: (_a = data.position.x) !== null && _a !== void 0 ? _a : 50,
1270
+ y: (_b = data.position.y) !== null && _b !== void 0 ? _b : 50
1271
+ };
1272
+ }
1273
+ if (data.options !== undefined) {
1274
+ this.options = deepExtend({}, data.options);
1275
+ }
1276
+ }
1277
+ }
1278
+ class ColorAnimation_ColorAnimation {
1279
+ constructor() {
1280
+ this.count = 0;
1281
+ this.enable = false;
1282
+ this.offset = 0;
1283
+ this.speed = 1;
1284
+ this.sync = true;
1285
+ }
1286
+ load(data) {
1287
+ if (data === undefined) {
1288
+ return;
1289
+ }
1290
+ if (data.count !== undefined) {
1291
+ this.count = data.count;
1292
+ }
1293
+ if (data.enable !== undefined) {
1294
+ this.enable = data.enable;
1295
+ }
1296
+ if (data.offset !== undefined) {
1297
+ this.offset = setRangeValue(data.offset);
1298
+ }
1299
+ if (data.speed !== undefined) {
1300
+ this.speed = data.speed;
1301
+ }
1302
+ if (data.sync !== undefined) {
1303
+ this.sync = data.sync;
1304
+ }
1305
+ }
1306
+ }
1307
+ class HslAnimation_HslAnimation {
1308
+ constructor() {
1309
+ this.h = new ColorAnimation;
1310
+ this.s = new ColorAnimation;
1311
+ this.l = new ColorAnimation;
1312
+ }
1313
+ load(data) {
1314
+ if (!data) {
1315
+ return;
1316
+ }
1317
+ this.h.load(data.h);
1318
+ this.s.load(data.s);
1319
+ this.l.load(data.l);
1320
+ }
1321
+ }
1322
+ class AnimatableColor_AnimatableColor extends(null && OptionsColor){
1323
+ constructor() {
1324
+ super();
1325
+ this.animation = new HslAnimation;
1326
+ }
1327
+ static create(source, data) {
1328
+ const color = new AnimatableColor_AnimatableColor;
1329
+ color.load(source);
1330
+ if (data !== undefined) {
1331
+ if (typeof data === "string" || data instanceof Array) {
1332
+ color.load({
1333
+ value: data
1334
+ });
1335
+ } else {
1336
+ color.load(data);
1337
+ }
1338
+ }
1339
+ return color;
1340
+ }
1341
+ load(data) {
1342
+ super.load(data);
1343
+ if (!data) {
1344
+ return;
1345
+ }
1346
+ const colorAnimation = data.animation;
1347
+ if (colorAnimation !== undefined) {
1348
+ if (colorAnimation.enable !== undefined) {
1349
+ this.animation.h.load(colorAnimation);
1350
+ } else {
1351
+ this.animation.load(data.animation);
1352
+ }
1353
+ }
1354
+ }
1355
+ }
1356
+ class AnimatableGradient_AnimatableGradient {
1357
+ constructor() {
1358
+ this.angle = new GradientAngle;
1359
+ this.colors = [];
1360
+ this.type = "random";
1361
+ }
1362
+ load(data) {
1363
+ if (!data) {
1364
+ return;
1365
+ }
1366
+ this.angle.load(data.angle);
1367
+ if (data.colors !== undefined) {
1368
+ this.colors = data.colors.map((s => {
1369
+ const tmp = new AnimatableGradientColor;
1370
+ tmp.load(s);
1371
+ return tmp;
1372
+ }));
1373
+ }
1374
+ if (data.type !== undefined) {
1375
+ this.type = data.type;
1376
+ }
1377
+ }
1378
+ }
1379
+ class GradientAngle {
1380
+ constructor() {
1381
+ this.value = 0;
1382
+ this.animation = new GradientAngleAnimation;
1383
+ this.direction = "clockwise";
1384
+ }
1385
+ load(data) {
1386
+ if (!data) {
1387
+ return;
1388
+ }
1389
+ this.animation.load(data.animation);
1390
+ if (data.value !== undefined) {
1391
+ this.value = data.value;
1392
+ }
1393
+ if (data.direction !== undefined) {
1394
+ this.direction = data.direction;
1395
+ }
1396
+ }
1397
+ }
1398
+ class GradientColorOpacity {
1399
+ constructor() {
1400
+ this.value = 0;
1401
+ this.animation = new GradientColorOpacityAnimation;
1402
+ }
1403
+ load(data) {
1404
+ if (!data) {
1405
+ return;
1406
+ }
1407
+ this.animation.load(data.animation);
1408
+ if (data.value !== undefined) {
1409
+ this.value = setRangeValue(data.value);
1410
+ }
1411
+ }
1412
+ }
1413
+ class AnimatableGradientColor {
1414
+ constructor() {
1415
+ this.stop = 0;
1416
+ this.value = new AnimatableColor;
1417
+ }
1418
+ load(data) {
1419
+ if (!data) {
1420
+ return;
1421
+ }
1422
+ if (data.stop !== undefined) {
1423
+ this.stop = data.stop;
1424
+ }
1425
+ this.value = AnimatableColor.create(this.value, data.value);
1426
+ if (data.opacity !== undefined) {
1427
+ this.opacity = new GradientColorOpacity;
1428
+ if (typeof data.opacity === "number") {
1429
+ this.opacity.value = data.opacity;
1430
+ } else {
1431
+ this.opacity.load(data.opacity);
1432
+ }
1433
+ }
1434
+ }
1435
+ }
1436
+ class GradientAngleAnimation {
1437
+ constructor() {
1438
+ this.count = 0;
1439
+ this.enable = false;
1440
+ this.speed = 0;
1441
+ this.sync = false;
1442
+ }
1443
+ load(data) {
1444
+ if (!data) {
1445
+ return;
1446
+ }
1447
+ if (data.count !== undefined) {
1448
+ this.count = data.count;
1449
+ }
1450
+ if (data.enable !== undefined) {
1451
+ this.enable = data.enable;
1452
+ }
1453
+ if (data.speed !== undefined) {
1454
+ this.speed = data.speed;
1455
+ }
1456
+ if (data.sync !== undefined) {
1457
+ this.sync = data.sync;
1458
+ }
1459
+ }
1460
+ }
1461
+ class GradientColorOpacityAnimation {
1462
+ constructor() {
1463
+ this.count = 0;
1464
+ this.enable = false;
1465
+ this.speed = 0;
1466
+ this.sync = false;
1467
+ this.startValue = "random";
1468
+ }
1469
+ load(data) {
1470
+ if (!data) {
1471
+ return;
1472
+ }
1473
+ if (data.count !== undefined) {
1474
+ this.count = data.count;
1475
+ }
1476
+ if (data.enable !== undefined) {
1477
+ this.enable = data.enable;
1478
+ }
1479
+ if (data.speed !== undefined) {
1480
+ this.speed = data.speed;
1481
+ }
1482
+ if (data.sync !== undefined) {
1483
+ this.sync = data.sync;
1484
+ }
1485
+ if (data.startValue !== undefined) {
1486
+ this.startValue = data.startValue;
1487
+ }
1488
+ }
1489
+ }
1490
+ class ValueWithRandom_ValueWithRandom {
1491
+ constructor() {
1492
+ this.random = new Random;
1493
+ this.value = 0;
1494
+ }
1495
+ load(data) {
1496
+ if (!data) {
1497
+ return;
1498
+ }
1499
+ if (typeof data.random === "boolean") {
1500
+ this.random.enable = data.random;
1501
+ } else {
1502
+ this.random.load(data.random);
1503
+ }
1504
+ if (data.value !== undefined) {
1505
+ this.value = setRangeValue(data.value, this.random.enable ? this.random.minimumValue : undefined);
1506
+ }
1507
+ }
1508
+ }
1509
+ class BounceFactor_BounceFactor extends(null && ValueWithRandom){
1510
+ constructor() {
1511
+ super();
1512
+ this.random.minimumValue = .1;
1513
+ this.value = 1;
1514
+ }
1515
+ }
1516
+ class Bounce_Bounce {
1517
+ constructor() {
1518
+ this.horizontal = new BounceFactor;
1519
+ this.vertical = new BounceFactor;
1520
+ }
1521
+ load(data) {
1522
+ if (!data) {
1523
+ return;
1524
+ }
1525
+ this.horizontal.load(data.horizontal);
1526
+ this.vertical.load(data.vertical);
1527
+ }
1528
+ }
1529
+ class Collisions_Collisions {
1530
+ constructor() {
1531
+ this.bounce = new Bounce;
1532
+ this.enable = false;
1533
+ this.mode = "bounce";
1534
+ this.overlap = new CollisionsOverlap;
1535
+ }
1536
+ load(data) {
1537
+ if (data === undefined) {
1538
+ return;
1539
+ }
1540
+ this.bounce.load(data.bounce);
1541
+ if (data.enable !== undefined) {
1542
+ this.enable = data.enable;
1543
+ }
1544
+ if (data.mode !== undefined) {
1545
+ this.mode = data.mode;
1546
+ }
1547
+ this.overlap.load(data.overlap);
1548
+ }
1549
+ }
1550
+ class SplitFactor_SplitFactor extends(null && ValueWithRandom){
1551
+ constructor() {
1552
+ super();
1553
+ this.value = 3;
1554
+ }
1555
+ }
1556
+ class SplitRate_SplitRate extends(null && ValueWithRandom){
1557
+ constructor() {
1558
+ super();
1559
+ this.value = {
1560
+ min: 4,
1561
+ max: 9
1562
+ };
1563
+ }
1564
+ }
1565
+ class Split_Split {
1566
+ constructor() {
1567
+ this.count = 1;
1568
+ this.factor = new SplitFactor;
1569
+ this.rate = new SplitRate;
1570
+ this.sizeOffset = true;
1571
+ }
1572
+ load(data) {
1573
+ if (!data) {
1574
+ return;
1575
+ }
1576
+ if (data.count !== undefined) {
1577
+ this.count = data.count;
1578
+ }
1579
+ this.factor.load(data.factor);
1580
+ this.rate.load(data.rate);
1581
+ if (data.particles !== undefined) {
1582
+ this.particles = deepExtend({}, data.particles);
1583
+ }
1584
+ if (data.sizeOffset !== undefined) {
1585
+ this.sizeOffset = data.sizeOffset;
1586
+ }
1587
+ }
1588
+ }
1589
+ class Destroy_Destroy {
1590
+ constructor() {
1591
+ this.mode = "none";
1592
+ this.split = new Split;
1593
+ }
1594
+ load(data) {
1595
+ if (!data) {
1596
+ return;
1597
+ }
1598
+ if (data.mode !== undefined) {
1599
+ this.mode = data.mode;
1600
+ }
1601
+ this.split.load(data.split);
1602
+ }
1603
+ }
1604
+ class LifeDelay_LifeDelay extends(null && ValueWithRandom){
1605
+ constructor() {
1606
+ super();
1607
+ this.sync = false;
1608
+ }
1609
+ load(data) {
1610
+ if (!data) {
1611
+ return;
1612
+ }
1613
+ super.load(data);
1614
+ if (data.sync !== undefined) {
1615
+ this.sync = data.sync;
1616
+ }
1617
+ }
1618
+ }
1619
+ class LifeDuration_LifeDuration extends(null && ValueWithRandom){
1620
+ constructor() {
1621
+ super();
1622
+ this.random.minimumValue = 1e-4;
1623
+ this.sync = false;
1624
+ }
1625
+ load(data) {
1626
+ if (data === undefined) {
1627
+ return;
1628
+ }
1629
+ super.load(data);
1630
+ if (data.sync !== undefined) {
1631
+ this.sync = data.sync;
1632
+ }
1633
+ }
1634
+ }
1635
+ class Life_Life {
1636
+ constructor() {
1637
+ this.count = 0;
1638
+ this.delay = new LifeDelay;
1639
+ this.duration = new LifeDuration;
1640
+ }
1641
+ load(data) {
1642
+ if (data === undefined) {
1643
+ return;
1644
+ }
1645
+ if (data.count !== undefined) {
1646
+ this.count = data.count;
1647
+ }
1648
+ this.delay.load(data.delay);
1649
+ this.duration.load(data.duration);
1650
+ }
1651
+ }
1652
+ class PathDelay_PathDelay extends(null && ValueWithRandom){
1653
+ constructor() {
1654
+ super();
1655
+ }
1656
+ }
1657
+ class Path_Path {
1658
+ constructor() {
1659
+ this.clamp = true;
1660
+ this.delay = new PathDelay;
1661
+ this.enable = false;
1662
+ this.options = {};
1663
+ }
1664
+ load(data) {
1665
+ if (data === undefined) {
1666
+ return;
1667
+ }
1668
+ if (data.clamp !== undefined) {
1669
+ this.clamp = data.clamp;
1670
+ }
1671
+ this.delay.load(data.delay);
1672
+ if (data.enable !== undefined) {
1673
+ this.enable = data.enable;
1674
+ }
1675
+ this.generator = data.generator;
1676
+ if (data.options) {
1677
+ this.options = deepExtend(this.options, data.options);
1678
+ }
1679
+ }
1680
+ }
1681
+ class Spin_Spin {
1682
+ constructor() {
1683
+ this.acceleration = 0;
1684
+ this.enable = false;
1685
+ }
1686
+ load(data) {
1687
+ if (!data) {
1688
+ return;
1689
+ }
1690
+ if (data.acceleration !== undefined) {
1691
+ this.acceleration = setRangeValue(data.acceleration);
1692
+ }
1693
+ if (data.enable !== undefined) {
1694
+ this.enable = data.enable;
1695
+ }
1696
+ this.position = data.position ? deepExtend({}, data.position) : undefined;
1697
+ }
1698
+ }
1699
+ class Move_Move {
1700
+ constructor() {
1701
+ this.angle = new MoveAngle;
1702
+ this.attract = new Attract;
1703
+ this.decay = 0;
1704
+ this.distance = {};
1705
+ this.direction = "none";
1706
+ this.drift = 0;
1707
+ this.enable = false;
1708
+ this.gravity = new MoveGravity;
1709
+ this.path = new Path;
1710
+ this.outModes = new OutModes;
1711
+ this.random = false;
1712
+ this.size = false;
1713
+ this.speed = 2;
1714
+ this.spin = new Spin;
1715
+ this.straight = false;
1716
+ this.trail = new Trail;
1717
+ this.vibrate = false;
1718
+ this.warp = false;
1719
+ }
1720
+ get collisions() {
1721
+ return false;
1722
+ }
1723
+ set collisions(value) {}
1724
+ get bounce() {
1725
+ return this.collisions;
1726
+ }
1727
+ set bounce(value) {
1728
+ this.collisions = value;
1729
+ }
1730
+ get out_mode() {
1731
+ return this.outMode;
1732
+ }
1733
+ set out_mode(value) {
1734
+ this.outMode = value;
1735
+ }
1736
+ get outMode() {
1737
+ return this.outModes.default;
1738
+ }
1739
+ set outMode(value) {
1740
+ this.outModes.default = value;
1741
+ }
1742
+ get noise() {
1743
+ return this.path;
1744
+ }
1745
+ set noise(value) {
1746
+ this.path = value;
1747
+ }
1748
+ load(data) {
1749
+ var _a, _b, _c;
1750
+ if (data === undefined) {
1751
+ return;
1752
+ }
1753
+ if (data.angle !== undefined) {
1754
+ if (typeof data.angle === "number") {
1755
+ this.angle.value = data.angle;
1756
+ } else {
1757
+ this.angle.load(data.angle);
1758
+ }
1759
+ }
1760
+ this.attract.load(data.attract);
1761
+ if (data.decay !== undefined) {
1762
+ this.decay = data.decay;
1763
+ }
1764
+ if (data.direction !== undefined) {
1765
+ this.direction = data.direction;
1766
+ }
1767
+ if (data.distance !== undefined) {
1768
+ this.distance = typeof data.distance === "number" ? {
1769
+ horizontal: data.distance,
1770
+ vertical: data.distance
1771
+ } : deepExtend({}, data.distance);
1772
+ }
1773
+ if (data.drift !== undefined) {
1774
+ this.drift = setRangeValue(data.drift);
1775
+ }
1776
+ if (data.enable !== undefined) {
1777
+ this.enable = data.enable;
1778
+ }
1779
+ this.gravity.load(data.gravity);
1780
+ const outMode = (_a = data.outMode) !== null && _a !== void 0 ? _a : data.out_mode;
1781
+ if (data.outModes !== undefined || outMode !== undefined) {
1782
+ if (typeof data.outModes === "string" || data.outModes === undefined && outMode !== undefined) {
1783
+ this.outModes.load({
1784
+ default: (_b = data.outModes) !== null && _b !== void 0 ? _b : outMode
1785
+ });
1786
+ } else {
1787
+ this.outModes.load(data.outModes);
1788
+ }
1789
+ }
1790
+ this.path.load((_c = data.path) !== null && _c !== void 0 ? _c : data.noise);
1791
+ if (data.random !== undefined) {
1792
+ this.random = data.random;
1793
+ }
1794
+ if (data.size !== undefined) {
1795
+ this.size = data.size;
1796
+ }
1797
+ if (data.speed !== undefined) {
1798
+ this.speed = setRangeValue(data.speed);
1799
+ }
1800
+ this.spin.load(data.spin);
1801
+ if (data.straight !== undefined) {
1802
+ this.straight = data.straight;
1803
+ }
1804
+ this.trail.load(data.trail);
1805
+ if (data.vibrate !== undefined) {
1806
+ this.vibrate = data.vibrate;
1807
+ }
1808
+ if (data.warp !== undefined) {
1809
+ this.warp = data.warp;
1810
+ }
1811
+ }
1812
+ }
1813
+ class Opacity_Opacity extends(null && ValueWithRandom){
1814
+ constructor() {
1815
+ super();
1816
+ this.animation = new OpacityAnimation;
1817
+ this.random.minimumValue = .1;
1818
+ this.value = 1;
1819
+ }
1820
+ get anim() {
1821
+ return this.animation;
1822
+ }
1823
+ set anim(value) {
1824
+ this.animation = value;
1825
+ }
1826
+ load(data) {
1827
+ var _a;
1828
+ if (!data) {
1829
+ return;
1830
+ }
1831
+ super.load(data);
1832
+ const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
1833
+ if (animation !== undefined) {
1834
+ this.animation.load(animation);
1835
+ this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
1836
+ }
1837
+ }
1838
+ }
1839
+ class OrbitRotation_OrbitRotation extends(null && ValueWithRandom){
1840
+ constructor() {
1841
+ super();
1842
+ this.value = 45;
1843
+ this.random.enable = false;
1844
+ this.random.minimumValue = 0;
1845
+ }
1846
+ load(data) {
1847
+ if (data === undefined) {
1848
+ return;
1849
+ }
1850
+ super.load(data);
1851
+ }
1852
+ }
1853
+ class Orbit_Orbit {
1854
+ constructor() {
1855
+ this.animation = new AnimationOptions;
1856
+ this.enable = false;
1857
+ this.opacity = 1;
1858
+ this.rotation = new OrbitRotation;
1859
+ this.width = 1;
1860
+ }
1861
+ load(data) {
1862
+ if (data === undefined) {
1863
+ return;
1864
+ }
1865
+ this.animation.load(data.animation);
1866
+ this.rotation.load(data.rotation);
1867
+ if (data.enable !== undefined) {
1868
+ this.enable = data.enable;
1869
+ }
1870
+ if (data.opacity !== undefined) {
1871
+ this.opacity = data.opacity;
1872
+ }
1873
+ if (data.width !== undefined) {
1874
+ this.width = data.width;
1875
+ }
1876
+ if (data.radius !== undefined) {
1877
+ this.radius = data.radius;
1878
+ }
1879
+ if (data.color !== undefined) {
1880
+ this.color = OptionsColor.create(this.color, data.color);
1881
+ }
1882
+ }
1883
+ }
1884
+ class Repulse_Repulse extends(null && ValueWithRandom){
1885
+ constructor() {
1886
+ super();
1887
+ this.enabled = false;
1888
+ this.distance = 1;
1889
+ this.duration = 1;
1890
+ this.factor = 1;
1891
+ this.speed = 1;
1892
+ }
1893
+ load(data) {
1894
+ super.load(data);
1895
+ if (!data) {
1896
+ return;
1897
+ }
1898
+ if (data.enabled !== undefined) {
1899
+ this.enabled = data.enabled;
1900
+ }
1901
+ if (data.distance !== undefined) {
1902
+ this.distance = data.distance;
1903
+ }
1904
+ if (data.duration !== undefined) {
1905
+ this.duration = data.duration;
1906
+ }
1907
+ if (data.factor !== undefined) {
1908
+ this.factor = data.factor;
1909
+ }
1910
+ if (data.speed !== undefined) {
1911
+ this.speed = data.speed;
1912
+ }
1913
+ }
1914
+ }
1915
+ class Roll_Roll {
1916
+ constructor() {
1917
+ this.darken = new RollLight;
1918
+ this.enable = false;
1919
+ this.enlighten = new RollLight;
1920
+ this.mode = "vertical";
1921
+ this.speed = 25;
1922
+ }
1923
+ load(data) {
1924
+ if (!data) {
1925
+ return;
1926
+ }
1927
+ if (data.backColor !== undefined) {
1928
+ this.backColor = OptionsColor.create(this.backColor, data.backColor);
1929
+ }
1930
+ this.darken.load(data.darken);
1931
+ if (data.enable !== undefined) {
1932
+ this.enable = data.enable;
1933
+ }
1934
+ this.enlighten.load(data.enlighten);
1935
+ if (data.mode !== undefined) {
1936
+ this.mode = data.mode;
1937
+ }
1938
+ if (data.speed !== undefined) {
1939
+ this.speed = setRangeValue(data.speed);
1940
+ }
1941
+ }
1942
+ }
1943
+ class Rotate_Rotate extends(null && ValueWithRandom){
1944
+ constructor() {
1945
+ super();
1946
+ this.animation = new RotateAnimation;
1947
+ this.direction = "clockwise";
1948
+ this.path = false;
1949
+ this.value = 0;
1950
+ }
1951
+ load(data) {
1952
+ if (!data) {
1953
+ return;
1954
+ }
1955
+ super.load(data);
1956
+ if (data.direction !== undefined) {
1957
+ this.direction = data.direction;
1958
+ }
1959
+ this.animation.load(data.animation);
1960
+ if (data.path !== undefined) {
1961
+ this.path = data.path;
1962
+ }
1963
+ }
1964
+ }
1965
+ class Shape_Shape {
1966
+ constructor() {
1967
+ this.options = {};
1968
+ this.type = "circle";
1969
+ }
1970
+ get image() {
1971
+ var _a;
1972
+ return (_a = this.options["image"]) !== null && _a !== void 0 ? _a : this.options["images"];
1973
+ }
1974
+ set image(value) {
1975
+ this.options["image"] = value;
1976
+ this.options["images"] = value;
1977
+ }
1978
+ get custom() {
1979
+ return this.options;
1980
+ }
1981
+ set custom(value) {
1982
+ this.options = value;
1983
+ }
1984
+ get images() {
1985
+ return this.image;
1986
+ }
1987
+ set images(value) {
1988
+ this.image = value;
1989
+ }
1990
+ get stroke() {
1991
+ return [];
1992
+ }
1993
+ set stroke(_value) {}
1994
+ get character() {
1995
+ var _a;
1996
+ return (_a = this.options["character"]) !== null && _a !== void 0 ? _a : this.options["char"];
1997
+ }
1998
+ set character(value) {
1999
+ this.options["character"] = value;
2000
+ this.options["char"] = value;
2001
+ }
2002
+ get polygon() {
2003
+ var _a;
2004
+ return (_a = this.options["polygon"]) !== null && _a !== void 0 ? _a : this.options["star"];
2005
+ }
2006
+ set polygon(value) {
2007
+ this.options["polygon"] = value;
2008
+ this.options["star"] = value;
2009
+ }
2010
+ load(data) {
2011
+ var _a, _b, _c;
2012
+ if (data === undefined) {
2013
+ return;
2014
+ }
2015
+ const options = (_a = data.options) !== null && _a !== void 0 ? _a : data.custom;
2016
+ if (options !== undefined) {
2017
+ for (const shape in options) {
2018
+ const item = options[shape];
2019
+ if (item !== undefined) {
2020
+ this.options[shape] = deepExtend((_b = this.options[shape]) !== null && _b !== void 0 ? _b : {}, item);
2021
+ }
2022
+ }
2023
+ }
2024
+ this.loadShape(data.character, "character", "char", true);
2025
+ this.loadShape(data.polygon, "polygon", "star", false);
2026
+ this.loadShape((_c = data.image) !== null && _c !== void 0 ? _c : data.images, "image", "images", true);
2027
+ if (data.type !== undefined) {
2028
+ this.type = data.type;
2029
+ }
2030
+ }
2031
+ loadShape(item, mainKey, altKey, altOverride) {
2032
+ var _a, _b, _c, _d;
2033
+ if (item === undefined) {
2034
+ return;
2035
+ }
2036
+ if (item instanceof Array) {
2037
+ if (!(this.options[mainKey] instanceof Array)) {
2038
+ this.options[mainKey] = [];
2039
+ if (!this.options[altKey] || altOverride) {
2040
+ this.options[altKey] = [];
2041
+ }
2042
+ }
2043
+ this.options[mainKey] = deepExtend((_a = this.options[mainKey]) !== null && _a !== void 0 ? _a : [], item);
2044
+ if (!this.options[altKey] || altOverride) {
2045
+ this.options[altKey] = deepExtend((_b = this.options[altKey]) !== null && _b !== void 0 ? _b : [], item);
2046
+ }
2047
+ } else {
2048
+ if (this.options[mainKey] instanceof Array) {
2049
+ this.options[mainKey] = {};
2050
+ if (!this.options[altKey] || altOverride) {
2051
+ this.options[altKey] = {};
2052
+ }
2053
+ }
2054
+ this.options[mainKey] = deepExtend((_c = this.options[mainKey]) !== null && _c !== void 0 ? _c : {}, item);
2055
+ if (!this.options[altKey] || altOverride) {
2056
+ this.options[altKey] = deepExtend((_d = this.options[altKey]) !== null && _d !== void 0 ? _d : {}, item);
2057
+ }
2058
+ }
2059
+ }
2060
+ }
2061
+ class Size_Size extends(null && ValueWithRandom){
2062
+ constructor() {
2063
+ super();
2064
+ this.animation = new SizeAnimation;
2065
+ this.random.minimumValue = 1;
2066
+ this.value = 3;
2067
+ }
2068
+ get anim() {
2069
+ return this.animation;
2070
+ }
2071
+ set anim(value) {
2072
+ this.animation = value;
2073
+ }
2074
+ load(data) {
2075
+ var _a;
2076
+ if (!data) {
2077
+ return;
2078
+ }
2079
+ super.load(data);
2080
+ const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
2081
+ if (animation !== undefined) {
2082
+ this.animation.load(animation);
2083
+ this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
2084
+ }
2085
+ }
2086
+ }
2087
+ class Stroke_Stroke {
2088
+ constructor() {
2089
+ this.width = 0;
2090
+ }
2091
+ load(data) {
2092
+ if (data === undefined) {
2093
+ return;
2094
+ }
2095
+ if (data.color !== undefined) {
2096
+ this.color = AnimatableColor.create(this.color, data.color);
2097
+ }
2098
+ if (data.width !== undefined) {
2099
+ this.width = data.width;
2100
+ }
2101
+ if (data.opacity !== undefined) {
2102
+ this.opacity = data.opacity;
2103
+ }
2104
+ }
2105
+ }
2106
+ class Tilt_Tilt extends(null && ValueWithRandom){
2107
+ constructor() {
2108
+ super();
2109
+ this.animation = new TiltAnimation;
2110
+ this.direction = "clockwise";
2111
+ this.enable = false;
2112
+ this.value = 0;
2113
+ }
2114
+ load(data) {
2115
+ if (!data) {
2116
+ return;
2117
+ }
2118
+ super.load(data);
2119
+ this.animation.load(data.animation);
2120
+ if (data.direction !== undefined) {
2121
+ this.direction = data.direction;
2122
+ }
2123
+ if (data.enable !== undefined) {
2124
+ this.enable = data.enable;
2125
+ }
2126
+ }
2127
+ }
2128
+ class Wobble_Wobble {
2129
+ constructor() {
2130
+ this.distance = 5;
2131
+ this.enable = false;
2132
+ this.speed = 50;
2133
+ }
2134
+ load(data) {
2135
+ if (!data) {
2136
+ return;
2137
+ }
2138
+ if (data.distance !== undefined) {
2139
+ this.distance = setRangeValue(data.distance);
2140
+ }
2141
+ if (data.enable !== undefined) {
2142
+ this.enable = data.enable;
2143
+ }
2144
+ if (data.speed !== undefined) {
2145
+ this.speed = setRangeValue(data.speed);
2146
+ }
2147
+ }
2148
+ }
2149
+ class ZIndex_ZIndex extends(null && ValueWithRandom){
2150
+ constructor() {
2151
+ super();
2152
+ this.opacityRate = 1;
2153
+ this.sizeRate = 1;
2154
+ this.velocityRate = 1;
2155
+ }
2156
+ load(data) {
2157
+ super.load(data);
2158
+ if (!data) {
2159
+ return;
2160
+ }
2161
+ if (data.opacityRate !== undefined) {
2162
+ this.opacityRate = data.opacityRate;
2163
+ }
2164
+ if (data.sizeRate !== undefined) {
2165
+ this.sizeRate = data.sizeRate;
2166
+ }
2167
+ if (data.velocityRate !== undefined) {
2168
+ this.velocityRate = data.velocityRate;
2169
+ }
2170
+ }
2171
+ }
2172
+ class ParticlesOptions_ParticlesOptions {
2173
+ constructor() {
2174
+ this.bounce = new Bounce;
2175
+ this.collisions = new Collisions;
2176
+ this.color = new AnimatableColor;
2177
+ this.destroy = new Destroy;
2178
+ this.gradient = [];
2179
+ this.groups = {};
2180
+ this.life = new Life;
2181
+ this.links = new Links;
2182
+ this.move = new Move;
2183
+ this.number = new ParticlesNumber;
2184
+ this.opacity = new Opacity;
2185
+ this.orbit = new Orbit;
2186
+ this.reduceDuplicates = false;
2187
+ this.repulse = new Repulse;
2188
+ this.roll = new Roll;
2189
+ this.rotate = new Rotate;
2190
+ this.shadow = new Shadow;
2191
+ this.shape = new Shape;
2192
+ this.size = new Size;
2193
+ this.stroke = new Stroke;
2194
+ this.tilt = new Tilt;
2195
+ this.twinkle = new Twinkle;
2196
+ this.wobble = new Wobble;
2197
+ this.zIndex = new ZIndex;
2198
+ }
2199
+ get line_linked() {
2200
+ return this.links;
2201
+ }
2202
+ set line_linked(value) {
2203
+ this.links = value;
2204
+ }
2205
+ get lineLinked() {
2206
+ return this.links;
2207
+ }
2208
+ set lineLinked(value) {
2209
+ this.links = value;
2210
+ }
2211
+ load(data) {
2212
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2213
+ if (data === undefined) {
2214
+ return;
2215
+ }
2216
+ this.bounce.load(data.bounce);
2217
+ this.color.load(AnimatableColor.create(this.color, data.color));
2218
+ this.destroy.load(data.destroy);
2219
+ this.life.load(data.life);
2220
+ const links = (_b = (_a = data.links) !== null && _a !== void 0 ? _a : data.lineLinked) !== null && _b !== void 0 ? _b : data.line_linked;
2221
+ if (links !== undefined) {
2222
+ this.links.load(links);
2223
+ }
2224
+ if (data.groups !== undefined) {
2225
+ for (const group in data.groups) {
2226
+ const item = data.groups[group];
2227
+ if (item !== undefined) {
2228
+ this.groups[group] = deepExtend((_c = this.groups[group]) !== null && _c !== void 0 ? _c : {}, item);
2229
+ }
2230
+ }
2231
+ }
2232
+ this.move.load(data.move);
2233
+ this.number.load(data.number);
2234
+ this.opacity.load(data.opacity);
2235
+ this.orbit.load(data.orbit);
2236
+ if (data.reduceDuplicates !== undefined) {
2237
+ this.reduceDuplicates = data.reduceDuplicates;
2238
+ }
2239
+ this.repulse.load(data.repulse);
2240
+ this.roll.load(data.roll);
2241
+ this.rotate.load(data.rotate);
2242
+ this.shape.load(data.shape);
2243
+ this.size.load(data.size);
2244
+ this.shadow.load(data.shadow);
2245
+ this.tilt.load(data.tilt);
2246
+ this.twinkle.load(data.twinkle);
2247
+ this.wobble.load(data.wobble);
2248
+ this.zIndex.load(data.zIndex);
2249
+ const collisions = (_e = (_d = data.move) === null || _d === void 0 ? void 0 : _d.collisions) !== null && _e !== void 0 ? _e : (_f = data.move) === null || _f === void 0 ? void 0 : _f.bounce;
2250
+ if (collisions !== undefined) {
2251
+ this.collisions.enable = collisions;
2252
+ }
2253
+ this.collisions.load(data.collisions);
2254
+ const strokeToLoad = (_g = data.stroke) !== null && _g !== void 0 ? _g : (_h = data.shape) === null || _h === void 0 ? void 0 : _h.stroke;
2255
+ if (strokeToLoad) {
2256
+ if (strokeToLoad instanceof Array) {
2257
+ this.stroke = strokeToLoad.map((s => {
2258
+ const tmp = new Stroke;
2259
+ tmp.load(s);
2260
+ return tmp;
2261
+ }));
2262
+ } else {
2263
+ if (this.stroke instanceof Array) {
2264
+ this.stroke = new Stroke;
2265
+ }
2266
+ this.stroke.load(strokeToLoad);
2267
+ }
2268
+ }
2269
+ const gradientToLoad = data.gradient;
2270
+ if (gradientToLoad) {
2271
+ if (gradientToLoad instanceof Array) {
2272
+ this.gradient = gradientToLoad.map((s => {
2273
+ const tmp = new AnimatableGradient;
2274
+ tmp.load(s);
2275
+ return tmp;
2276
+ }));
2277
+ } else {
2278
+ if (this.gradient instanceof Array) {
2279
+ this.gradient = new AnimatableGradient;
2280
+ }
2281
+ this.gradient.load(gradientToLoad);
2282
+ }
2283
+ }
2284
+ }
2285
+ }
2286
+ class Responsive_Responsive {
2287
+ constructor() {
2288
+ this.maxWidth = Infinity;
2289
+ this.options = {};
2290
+ this.mode = "canvas";
2291
+ }
2292
+ load(data) {
2293
+ if (!data) {
2294
+ return;
2295
+ }
2296
+ if (data.maxWidth !== undefined) {
2297
+ this.maxWidth = data.maxWidth;
2298
+ }
2299
+ if (data.mode !== undefined) {
2300
+ if (data.mode === "screen") {
2301
+ this.mode = "screen";
2302
+ } else {
2303
+ this.mode = "canvas";
2304
+ }
2305
+ }
2306
+ if (data.options !== undefined) {
2307
+ this.options = deepExtend({}, data.options);
2308
+ }
2309
+ }
2310
+ }
2311
+ class Theme_Theme {
2312
+ constructor() {
2313
+ this.name = "";
2314
+ this.default = new ThemeDefault;
2315
+ }
2316
+ load(data) {
2317
+ if (data === undefined) {
2318
+ return;
2319
+ }
2320
+ if (data.name !== undefined) {
2321
+ this.name = data.name;
2322
+ }
2323
+ this.default.load(data.default);
2324
+ if (data.options !== undefined) {
2325
+ this.options = deepExtend({}, data.options);
2326
+ }
2327
+ }
2328
+ }
2329
+ var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
2330
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
2331
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
2332
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
2333
+ };
2334
+ var _Options_instances, _Options_findDefaultTheme;
2335
+ class Options_Options {
2336
+ constructor() {
2337
+ _Options_instances.add(this);
2338
+ this.autoPlay = true;
2339
+ this.background = new Background;
2340
+ this.backgroundMask = new BackgroundMask;
2341
+ this.fullScreen = new FullScreen;
2342
+ this.detectRetina = true;
2343
+ this.duration = 0;
2344
+ this.fpsLimit = 60;
2345
+ this.interactivity = new Interactivity;
2346
+ this.manualParticles = [];
2347
+ this.motion = new Motion;
2348
+ this.particles = new ParticlesOptions;
2349
+ this.pauseOnBlur = true;
2350
+ this.pauseOnOutsideViewport = true;
2351
+ this.responsive = [];
2352
+ this.style = {};
2353
+ this.themes = [];
2354
+ this.zLayers = 100;
2355
+ }
2356
+ get fps_limit() {
2357
+ return this.fpsLimit;
2358
+ }
2359
+ set fps_limit(value) {
2360
+ this.fpsLimit = value;
2361
+ }
2362
+ get retina_detect() {
2363
+ return this.detectRetina;
2364
+ }
2365
+ set retina_detect(value) {
2366
+ this.detectRetina = value;
2367
+ }
2368
+ get backgroundMode() {
2369
+ return this.fullScreen;
2370
+ }
2371
+ set backgroundMode(value) {
2372
+ this.fullScreen.load(value);
2373
+ }
2374
+ load(data) {
2375
+ var _a, _b, _c, _d, _e;
2376
+ if (data === undefined) {
2377
+ return;
2378
+ }
2379
+ if (data.preset !== undefined) {
2380
+ if (data.preset instanceof Array) {
2381
+ for (const preset of data.preset) {
2382
+ this.importPreset(preset);
2383
+ }
2384
+ } else {
2385
+ this.importPreset(data.preset);
2386
+ }
2387
+ }
2388
+ if (data.autoPlay !== undefined) {
2389
+ this.autoPlay = data.autoPlay;
2390
+ }
2391
+ const detectRetina = (_a = data.detectRetina) !== null && _a !== void 0 ? _a : data.retina_detect;
2392
+ if (detectRetina !== undefined) {
2393
+ this.detectRetina = detectRetina;
2394
+ }
2395
+ if (data.duration !== undefined) {
2396
+ this.duration = data.duration;
2397
+ }
2398
+ const fpsLimit = (_b = data.fpsLimit) !== null && _b !== void 0 ? _b : data.fps_limit;
2399
+ if (fpsLimit !== undefined) {
2400
+ this.fpsLimit = fpsLimit;
2401
+ }
2402
+ if (data.pauseOnBlur !== undefined) {
2403
+ this.pauseOnBlur = data.pauseOnBlur;
2404
+ }
2405
+ if (data.pauseOnOutsideViewport !== undefined) {
2406
+ this.pauseOnOutsideViewport = data.pauseOnOutsideViewport;
2407
+ }
2408
+ if (data.zLayers !== undefined) {
2409
+ this.zLayers = data.zLayers;
2410
+ }
2411
+ this.background.load(data.background);
2412
+ const fullScreen = (_c = data.fullScreen) !== null && _c !== void 0 ? _c : data.backgroundMode;
2413
+ if (typeof fullScreen === "boolean") {
2414
+ this.fullScreen.enable = fullScreen;
2415
+ } else {
2416
+ this.fullScreen.load(fullScreen);
2417
+ }
2418
+ this.backgroundMask.load(data.backgroundMask);
2419
+ this.interactivity.load(data.interactivity);
2420
+ if (data.manualParticles !== undefined) {
2421
+ this.manualParticles = data.manualParticles.map((t => {
2422
+ const tmp = new ManualParticle;
2423
+ tmp.load(t);
2424
+ return tmp;
2425
+ }));
2426
+ }
2427
+ this.motion.load(data.motion);
2428
+ this.particles.load(data.particles);
2429
+ this.style = deepExtend(this.style, data.style);
2430
+ Plugins.loadOptions(this, data);
2431
+ if (data.responsive !== undefined) {
2432
+ for (const responsive of data.responsive) {
2433
+ const optResponsive = new Responsive;
2434
+ optResponsive.load(responsive);
2435
+ this.responsive.push(optResponsive);
2436
+ }
2437
+ }
2438
+ this.responsive.sort(((a, b) => a.maxWidth - b.maxWidth));
2439
+ if (data.themes !== undefined) {
2440
+ for (const theme of data.themes) {
2441
+ const optTheme = new Theme;
2442
+ optTheme.load(theme);
2443
+ this.themes.push(optTheme);
2444
+ }
2445
+ }
2446
+ this.defaultDarkTheme = (_d = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "dark")) === null || _d === void 0 ? void 0 : _d.name;
2447
+ this.defaultLightTheme = (_e = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "light")) === null || _e === void 0 ? void 0 : _e.name;
2448
+ }
2449
+ setTheme(name) {
2450
+ if (name) {
2451
+ const chosenTheme = this.themes.find((theme => theme.name === name));
2452
+ if (chosenTheme) {
2453
+ this.load(chosenTheme.options);
2454
+ }
2455
+ } else {
2456
+ const mediaMatch = typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch && mediaMatch.matches, defaultTheme = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, clientDarkMode ? "dark" : "light");
2457
+ if (defaultTheme) {
2458
+ this.load(defaultTheme.options);
2459
+ }
2460
+ }
2461
+ }
2462
+ setResponsive(width, pxRatio, defaultOptions) {
2463
+ this.load(defaultOptions);
2464
+ const responsiveOptions = this.responsive.find((t => t.mode === "screen" && screen ? t.maxWidth * pxRatio > screen.availWidth : t.maxWidth * pxRatio > width));
2465
+ this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
2466
+ return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
2467
+ }
2468
+ importPreset(preset) {
2469
+ this.load(Plugins.getPreset(preset));
2470
+ }
2471
+ }
2472
+ _Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
2473
+ var _a;
2474
+ return (_a = this.themes.find((theme => theme.default.value && theme.default.mode === mode))) !== null && _a !== void 0 ? _a : this.themes.find((theme => theme.default.value && theme.default.mode === "any"));
2475
+ };
2476
+ const fixOutMode = data => {
2477
+ if (isInArray(data.outMode, data.checkModes) || isInArray(data.outMode, data.checkModes)) {
2478
+ if (data.coord > data.maxCoord - data.radius * 2) {
2479
+ data.setCb(-data.radius);
2480
+ } else if (data.coord < data.radius * 2) {
2481
+ data.setCb(data.radius);
2482
+ }
2483
+ }
2484
+ };
2485
+ class Particle_Particle {
2486
+ constructor(id, container, position, overrideOptions, group) {
2487
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2488
+ this.id = id;
2489
+ this.container = container;
2490
+ this.group = group;
2491
+ this.fill = true;
2492
+ this.close = true;
2493
+ this.lastPathTime = 0;
2494
+ this.destroyed = false;
2495
+ this.unbreakable = false;
2496
+ this.splitCount = 0;
2497
+ this.misplaced = false;
2498
+ this.retina = {
2499
+ maxDistance: {}
2500
+ };
2501
+ const pxRatio = container.retina.pixelRatio;
2502
+ const mainOptions = container.actualOptions;
2503
+ const particlesOptions = new ParticlesOptions;
2504
+ particlesOptions.load(mainOptions.particles);
2505
+ const shapeType = particlesOptions.shape.type;
2506
+ const reduceDuplicates = particlesOptions.reduceDuplicates;
2507
+ this.shape = shapeType instanceof Array ? itemFromArray(shapeType, this.id, reduceDuplicates) : shapeType;
2508
+ if (overrideOptions === null || overrideOptions === void 0 ? void 0 : overrideOptions.shape) {
2509
+ if (overrideOptions.shape.type) {
2510
+ const overrideShapeType = overrideOptions.shape.type;
2511
+ this.shape = overrideShapeType instanceof Array ? itemFromArray(overrideShapeType, this.id, reduceDuplicates) : overrideShapeType;
2512
+ }
2513
+ const shapeOptions = new Shape;
2514
+ shapeOptions.load(overrideOptions.shape);
2515
+ if (this.shape) {
2516
+ this.shapeData = this.loadShapeData(shapeOptions, reduceDuplicates);
2517
+ }
2518
+ } else {
2519
+ this.shapeData = this.loadShapeData(particlesOptions.shape, reduceDuplicates);
2520
+ }
2521
+ if (overrideOptions !== undefined) {
2522
+ particlesOptions.load(overrideOptions);
2523
+ }
2524
+ if (((_a = this.shapeData) === null || _a === void 0 ? void 0 : _a.particles) !== undefined) {
2525
+ particlesOptions.load((_b = this.shapeData) === null || _b === void 0 ? void 0 : _b.particles);
2526
+ }
2527
+ this.fill = (_d = (_c = this.shapeData) === null || _c === void 0 ? void 0 : _c.fill) !== null && _d !== void 0 ? _d : this.fill;
2528
+ this.close = (_f = (_e = this.shapeData) === null || _e === void 0 ? void 0 : _e.close) !== null && _f !== void 0 ? _f : this.close;
2529
+ this.options = particlesOptions;
2530
+ this.pathDelay = getValue(this.options.move.path.delay) * 1e3;
2531
+ const zIndexValue = getRangeValue(this.options.zIndex.value);
2532
+ container.retina.initParticle(this);
2533
+ const sizeOptions = this.options.size, sizeRange = sizeOptions.value;
2534
+ this.size = {
2535
+ enable: sizeOptions.animation.enable,
2536
+ value: getValue(sizeOptions) * container.retina.pixelRatio,
2537
+ max: getRangeMax(sizeRange) * pxRatio,
2538
+ min: getRangeMin(sizeRange) * pxRatio,
2539
+ loops: 0,
2540
+ maxLoops: sizeOptions.animation.count
2541
+ };
2542
+ const sizeAnimation = sizeOptions.animation;
2543
+ if (sizeAnimation.enable) {
2544
+ this.size.status = 0;
2545
+ switch (sizeAnimation.startValue) {
2546
+ case "min":
2547
+ this.size.value = this.size.min;
2548
+ this.size.status = 0;
2549
+ break;
2550
+
2551
+ case "random":
2552
+ this.size.value = randomInRange(this.size) * pxRatio;
2553
+ this.size.status = Math.random() >= .5 ? 0 : 1;
2554
+ break;
2555
+
2556
+ case "max":
2557
+ default:
2558
+ this.size.value = this.size.max;
2559
+ this.size.status = 1;
2560
+ break;
2561
+ }
2562
+ this.size.velocity = ((_g = this.retina.sizeAnimationSpeed) !== null && _g !== void 0 ? _g : container.retina.sizeAnimationSpeed) / 100 * container.retina.reduceFactor;
2563
+ if (!sizeAnimation.sync) {
2564
+ this.size.velocity *= Math.random();
2565
+ }
2566
+ }
2567
+ this.direction = getParticleDirectionAngle(this.options.move.direction);
2568
+ this.bubble = {
2569
+ inRange: false
2570
+ };
2571
+ this.initialVelocity = this.calculateVelocity();
2572
+ this.velocity = this.initialVelocity.copy();
2573
+ this.moveDecay = 1 - getRangeValue(this.options.move.decay);
2574
+ this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
2575
+ this.initialPosition = this.position.copy();
2576
+ this.offset = Vector.origin;
2577
+ const particles = container.particles;
2578
+ particles.needsSort = particles.needsSort || particles.lastZIndex < this.position.z;
2579
+ particles.lastZIndex = this.position.z;
2580
+ this.zIndexFactor = this.position.z / container.zLayers;
2581
+ this.sides = 24;
2582
+ let drawer = container.drawers.get(this.shape);
2583
+ if (!drawer) {
2584
+ drawer = Plugins.getShapeDrawer(this.shape);
2585
+ if (drawer) {
2586
+ container.drawers.set(this.shape, drawer);
2587
+ }
2588
+ }
2589
+ if (drawer === null || drawer === void 0 ? void 0 : drawer.loadShape) {
2590
+ drawer === null || drawer === void 0 ? void 0 : drawer.loadShape(this);
2591
+ }
2592
+ const sideCountFunc = drawer === null || drawer === void 0 ? void 0 : drawer.getSidesCount;
2593
+ if (sideCountFunc) {
2594
+ this.sides = sideCountFunc(this);
2595
+ }
2596
+ this.life = this.loadLife();
2597
+ this.spawning = this.life.delay > 0;
2598
+ if (this.options.move.spin.enable) {
2599
+ const spinPos = (_h = this.options.move.spin.position) !== null && _h !== void 0 ? _h : {
2600
+ x: 50,
2601
+ y: 50
2602
+ };
2603
+ const spinCenter = {
2604
+ x: spinPos.x / 100 * container.canvas.size.width,
2605
+ y: spinPos.y / 100 * container.canvas.size.height
2606
+ };
2607
+ const pos = this.getPosition();
2608
+ const distance = getDistance(pos, spinCenter);
2609
+ this.spin = {
2610
+ center: spinCenter,
2611
+ direction: this.velocity.x >= 0 ? "clockwise" : "counter-clockwise",
2612
+ angle: this.velocity.angle,
2613
+ radius: distance,
2614
+ acceleration: (_j = this.retina.spinAcceleration) !== null && _j !== void 0 ? _j : getRangeValue(this.options.move.spin.acceleration)
2615
+ };
2616
+ }
2617
+ this.shadowColor = colorToRgb(this.options.shadow.color);
2618
+ for (const updater of container.particles.updaters) {
2619
+ if (updater.init) {
2620
+ updater.init(this);
2621
+ }
2622
+ }
2623
+ if (drawer && drawer.particleInit) {
2624
+ drawer.particleInit(container, this);
2625
+ }
2626
+ for (const [, plugin] of container.plugins) {
2627
+ if (plugin.particleCreated) {
2628
+ plugin.particleCreated(this);
2629
+ }
2630
+ }
2631
+ }
2632
+ isVisible() {
2633
+ return !this.destroyed && !this.spawning && this.isInsideCanvas();
2634
+ }
2635
+ isInsideCanvas() {
2636
+ const radius = this.getRadius();
2637
+ const canvasSize = this.container.canvas.size;
2638
+ return this.position.x >= -radius && this.position.y >= -radius && this.position.y <= canvasSize.height + radius && this.position.x <= canvasSize.width + radius;
2639
+ }
2640
+ draw(delta) {
2641
+ const container = this.container;
2642
+ for (const [, plugin] of container.plugins) {
2643
+ container.canvas.drawParticlePlugin(plugin, this, delta);
2644
+ }
2645
+ container.canvas.drawParticle(this, delta);
2646
+ }
2647
+ getPosition() {
2648
+ return {
2649
+ x: this.position.x + this.offset.x,
2650
+ y: this.position.y + this.offset.y,
2651
+ z: this.position.z
2652
+ };
2653
+ }
2654
+ getRadius() {
2655
+ var _a;
2656
+ return (_a = this.bubble.radius) !== null && _a !== void 0 ? _a : this.size.value;
2657
+ }
2658
+ getMass() {
2659
+ return this.getRadius() ** 2 * Math.PI / 2;
2660
+ }
2661
+ getFillColor() {
2662
+ var _a, _b, _c;
2663
+ const color = (_a = this.bubble.color) !== null && _a !== void 0 ? _a : getHslFromAnimation(this.color);
2664
+ if (color && this.roll && (this.backColor || this.roll.alter)) {
2665
+ const rolled = Math.floor(((_c = (_b = this.roll) === null || _b === void 0 ? void 0 : _b.angle) !== null && _c !== void 0 ? _c : 0) / (Math.PI / 2)) % 2;
2666
+ if (rolled) {
2667
+ if (this.backColor) {
2668
+ return this.backColor;
2669
+ }
2670
+ if (this.roll.alter) {
2671
+ return alterHsl(color, this.roll.alter.type, this.roll.alter.value);
2672
+ }
2673
+ }
2674
+ }
2675
+ return color;
2676
+ }
2677
+ getStrokeColor() {
2678
+ var _a, _b;
2679
+ return (_b = (_a = this.bubble.color) !== null && _a !== void 0 ? _a : getHslFromAnimation(this.strokeColor)) !== null && _b !== void 0 ? _b : this.getFillColor();
2680
+ }
2681
+ destroy(override) {
2682
+ this.destroyed = true;
2683
+ this.bubble.inRange = false;
2684
+ if (this.unbreakable) {
2685
+ return;
2686
+ }
2687
+ this.destroyed = true;
2688
+ this.bubble.inRange = false;
2689
+ for (const [, plugin] of this.container.plugins) {
2690
+ if (plugin.particleDestroyed) {
2691
+ plugin.particleDestroyed(this, override);
2692
+ }
2693
+ }
2694
+ if (override) {
2695
+ return;
2696
+ }
2697
+ const destroyOptions = this.options.destroy;
2698
+ if (destroyOptions.mode === "split") {
2699
+ this.split();
2700
+ }
2701
+ }
2702
+ reset() {
2703
+ if (this.opacity) {
2704
+ this.opacity.loops = 0;
2705
+ }
2706
+ this.size.loops = 0;
2707
+ }
2708
+ split() {
2709
+ const splitOptions = this.options.destroy.split;
2710
+ if (splitOptions.count >= 0 && this.splitCount++ > splitOptions.count) {
2711
+ return;
2712
+ }
2713
+ const rate = getRangeValue(splitOptions.rate.value);
2714
+ for (let i = 0; i < rate; i++) {
2715
+ this.container.particles.addSplitParticle(this);
2716
+ }
2717
+ }
2718
+ calcPosition(container, position, zIndex, tryCount = 0) {
2719
+ var _a, _b, _c, _d, _e, _f;
2720
+ for (const [, plugin] of container.plugins) {
2721
+ const pluginPos = plugin.particlePosition !== undefined ? plugin.particlePosition(position, this) : undefined;
2722
+ if (pluginPos !== undefined) {
2723
+ return Vector3d.create(pluginPos.x, pluginPos.y, zIndex);
2724
+ }
2725
+ }
2726
+ const canvasSize = container.canvas.size;
2727
+ const pos = Vector3d.create((_a = position === null || position === void 0 ? void 0 : position.x) !== null && _a !== void 0 ? _a : Math.random() * canvasSize.width, (_b = position === null || position === void 0 ? void 0 : position.y) !== null && _b !== void 0 ? _b : Math.random() * canvasSize.height, zIndex);
2728
+ const radius = this.getRadius();
2729
+ const outModes = this.options.move.outModes, fixHorizontal = outMode => {
2730
+ fixOutMode({
2731
+ outMode: outMode,
2732
+ checkModes: [ "bounce", "bounce-horizontal" ],
2733
+ coord: pos.x,
2734
+ maxCoord: container.canvas.size.width,
2735
+ setCb: value => pos.x += value,
2736
+ radius: radius
2737
+ });
2738
+ }, fixVertical = outMode => {
2739
+ fixOutMode({
2740
+ outMode: outMode,
2741
+ checkModes: [ "bounce", "bounce-vertical" ],
2742
+ coord: pos.y,
2743
+ maxCoord: container.canvas.size.height,
2744
+ setCb: value => pos.y += value,
2745
+ radius: radius
2746
+ });
2747
+ };
2748
+ fixHorizontal((_c = outModes.left) !== null && _c !== void 0 ? _c : outModes.default);
2749
+ fixHorizontal((_d = outModes.right) !== null && _d !== void 0 ? _d : outModes.default);
2750
+ fixVertical((_e = outModes.top) !== null && _e !== void 0 ? _e : outModes.default);
2751
+ fixVertical((_f = outModes.bottom) !== null && _f !== void 0 ? _f : outModes.default);
2752
+ if (this.checkOverlap(pos, tryCount)) {
2753
+ return this.calcPosition(container, undefined, zIndex, tryCount + 1);
2754
+ }
2755
+ return pos;
2756
+ }
2757
+ checkOverlap(pos, tryCount = 0) {
2758
+ const collisionsOptions = this.options.collisions;
2759
+ const radius = this.getRadius();
2760
+ if (!collisionsOptions.enable) {
2761
+ return false;
2762
+ }
2763
+ const overlapOptions = collisionsOptions.overlap;
2764
+ if (overlapOptions.enable) {
2765
+ return false;
2766
+ }
2767
+ const retries = overlapOptions.retries;
2768
+ if (retries >= 0 && tryCount > retries) {
2769
+ throw new Error("Particle is overlapping and can't be placed");
2770
+ }
2771
+ let overlaps = false;
2772
+ for (const particle of this.container.particles.array) {
2773
+ if (getDistance(pos, particle.position) < radius + particle.getRadius()) {
2774
+ overlaps = true;
2775
+ break;
2776
+ }
2777
+ }
2778
+ return overlaps;
2779
+ }
2780
+ calculateVelocity() {
2781
+ const baseVelocity = getParticleBaseVelocity(this.direction);
2782
+ const res = baseVelocity.copy();
2783
+ const moveOptions = this.options.move;
2784
+ const rad = Math.PI / 180 * moveOptions.angle.value;
2785
+ const radOffset = Math.PI / 180 * moveOptions.angle.offset;
2786
+ const range = {
2787
+ left: radOffset - rad / 2,
2788
+ right: radOffset + rad / 2
2789
+ };
2790
+ if (!moveOptions.straight) {
2791
+ res.angle += randomInRange(setRangeValue(range.left, range.right));
2792
+ }
2793
+ if (moveOptions.random && typeof moveOptions.speed === "number") {
2794
+ res.length *= Math.random();
2795
+ }
2796
+ return res;
2797
+ }
2798
+ loadShapeData(shapeOptions, reduceDuplicates) {
2799
+ const shapeData = shapeOptions.options[this.shape];
2800
+ if (shapeData) {
2801
+ return deepExtend({}, shapeData instanceof Array ? itemFromArray(shapeData, this.id, reduceDuplicates) : shapeData);
2802
+ }
2803
+ }
2804
+ loadLife() {
2805
+ const container = this.container;
2806
+ const particlesOptions = this.options;
2807
+ const lifeOptions = particlesOptions.life;
2808
+ const life = {
2809
+ delay: container.retina.reduceFactor ? getRangeValue(lifeOptions.delay.value) * (lifeOptions.delay.sync ? 1 : Math.random()) / container.retina.reduceFactor * 1e3 : 0,
2810
+ delayTime: 0,
2811
+ duration: container.retina.reduceFactor ? getRangeValue(lifeOptions.duration.value) * (lifeOptions.duration.sync ? 1 : Math.random()) / container.retina.reduceFactor * 1e3 : 0,
2812
+ time: 0,
2813
+ count: particlesOptions.life.count
2814
+ };
2815
+ if (life.duration <= 0) {
2816
+ life.duration = -1;
2817
+ }
2818
+ if (life.count <= 0) {
2819
+ life.count = -1;
2820
+ }
2821
+ return life;
2822
+ }
2823
+ }
2824
+ class Particles_Particles {
2825
+ constructor(container) {
2826
+ this.container = container;
2827
+ this.nextId = 0;
2828
+ this.array = [];
2829
+ this.zArray = [];
2830
+ this.mover = new ParticlesMover(container);
2831
+ this.limit = 0;
2832
+ this.needsSort = false;
2833
+ this.lastZIndex = 0;
2834
+ this.freqs = {
2835
+ links: new Map,
2836
+ triangles: new Map
2837
+ };
2838
+ this.interactionManager = new InteractionManager(container);
2839
+ const canvasSize = this.container.canvas.size;
2840
+ this.linksColors = new Map;
2841
+ this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
2842
+ this.updaters = Plugins.getUpdaters(container, true);
2843
+ }
2844
+ get count() {
2845
+ return this.array.length;
2846
+ }
2847
+ init() {
2848
+ var _a;
2849
+ const container = this.container;
2850
+ const options = container.actualOptions;
2851
+ this.lastZIndex = 0;
2852
+ this.needsSort = false;
2853
+ this.freqs.links = new Map;
2854
+ this.freqs.triangles = new Map;
2855
+ let handled = false;
2856
+ this.updaters = Plugins.getUpdaters(container, true);
2857
+ this.interactionManager.init();
2858
+ for (const [, plugin] of container.plugins) {
2859
+ if (plugin.particlesInitialization !== undefined) {
2860
+ handled = plugin.particlesInitialization();
2861
+ }
2862
+ if (handled) {
2863
+ break;
2864
+ }
2865
+ }
2866
+ this.addManualParticles();
2867
+ if (!handled) {
2868
+ for (const group in options.particles.groups) {
2869
+ const groupOptions = options.particles.groups[group];
2870
+ for (let i = this.count, j = 0; j < ((_a = groupOptions.number) === null || _a === void 0 ? void 0 : _a.value) && i < options.particles.number.value; i++,
2871
+ j++) {
2872
+ this.addParticle(undefined, groupOptions, group);
2873
+ }
2874
+ }
2875
+ for (let i = this.count; i < options.particles.number.value; i++) {
2876
+ this.addParticle();
2877
+ }
2878
+ }
2879
+ container.pathGenerator.init(container);
2880
+ }
2881
+ redraw() {
2882
+ this.clear();
2883
+ this.init();
2884
+ this.draw({
2885
+ value: 0,
2886
+ factor: 0
2887
+ });
2888
+ }
2889
+ removeAt(index, quantity = 1, group, override) {
2890
+ if (!(index >= 0 && index <= this.count)) {
2891
+ return;
2892
+ }
2893
+ let deleted = 0;
2894
+ for (let i = index; deleted < quantity && i < this.count; i++) {
2895
+ const particle = this.array[i];
2896
+ if (!particle || particle.group !== group) {
2897
+ continue;
2898
+ }
2899
+ particle.destroy(override);
2900
+ this.array.splice(i--, 1);
2901
+ const zIdx = this.zArray.indexOf(particle);
2902
+ this.zArray.splice(zIdx, 1);
2903
+ deleted++;
2904
+ }
2905
+ }
2906
+ remove(particle, group, override) {
2907
+ this.removeAt(this.array.indexOf(particle), undefined, group, override);
2908
+ }
2909
+ update(delta) {
2910
+ const container = this.container;
2911
+ const particlesToDelete = [];
2912
+ container.pathGenerator.update();
2913
+ for (const [, plugin] of container.plugins) {
2914
+ if (plugin.update !== undefined) {
2915
+ plugin.update(delta);
2916
+ }
2917
+ }
2918
+ for (const particle of this.array) {
2919
+ const resizeFactor = container.canvas.resizeFactor;
2920
+ if (resizeFactor) {
2921
+ particle.position.x *= resizeFactor.width;
2922
+ particle.position.y *= resizeFactor.height;
2923
+ }
2924
+ particle.bubble.inRange = false;
2925
+ for (const [, plugin] of this.container.plugins) {
2926
+ if (particle.destroyed) {
2927
+ break;
2928
+ }
2929
+ if (plugin.particleUpdate) {
2930
+ plugin.particleUpdate(particle, delta);
2931
+ }
2932
+ }
2933
+ this.mover.move(particle, delta);
2934
+ if (particle.destroyed) {
2935
+ particlesToDelete.push(particle);
2936
+ continue;
2937
+ }
2938
+ this.quadTree.insert(new Point(particle.getPosition(), particle));
2939
+ }
2940
+ for (const particle of particlesToDelete) {
2941
+ this.remove(particle);
2942
+ }
2943
+ this.interactionManager.externalInteract(delta);
2944
+ for (const particle of container.particles.array) {
2945
+ for (const updater of this.updaters) {
2946
+ updater.update(particle, delta);
2947
+ }
2948
+ if (!particle.destroyed && !particle.spawning) {
2949
+ this.interactionManager.particlesInteract(particle, delta);
2950
+ }
2951
+ }
2952
+ delete container.canvas.resizeFactor;
2953
+ }
2954
+ draw(delta) {
2955
+ const container = this.container;
2956
+ container.canvas.clear();
2957
+ const canvasSize = this.container.canvas.size;
2958
+ this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
2959
+ this.update(delta);
2960
+ if (this.needsSort) {
2961
+ this.zArray.sort(((a, b) => b.position.z - a.position.z || a.id - b.id));
2962
+ this.lastZIndex = this.zArray[this.zArray.length - 1].position.z;
2963
+ this.needsSort = false;
2964
+ }
2965
+ for (const [, plugin] of container.plugins) {
2966
+ container.canvas.drawPlugin(plugin, delta);
2967
+ }
2968
+ for (const p of this.zArray) {
2969
+ p.draw(delta);
2970
+ }
2971
+ }
2972
+ clear() {
2973
+ this.array = [];
2974
+ this.zArray = [];
2975
+ }
2976
+ push(nb, mouse, overrideOptions, group) {
2977
+ this.pushing = true;
2978
+ for (let i = 0; i < nb; i++) {
2979
+ this.addParticle(mouse === null || mouse === void 0 ? void 0 : mouse.position, overrideOptions, group);
2980
+ }
2981
+ this.pushing = false;
2982
+ }
2983
+ addParticle(position, overrideOptions, group) {
2984
+ const container = this.container, options = container.actualOptions, limit = options.particles.number.limit * container.density;
2985
+ if (limit > 0) {
2986
+ const countToRemove = this.count + 1 - limit;
2987
+ if (countToRemove > 0) {
2988
+ this.removeQuantity(countToRemove);
2989
+ }
2990
+ }
2991
+ return this.pushParticle(position, overrideOptions, group);
2992
+ }
2993
+ addSplitParticle(parent) {
2994
+ const splitOptions = parent.options.destroy.split, options = new ParticlesOptions;
2995
+ options.load(parent.options);
2996
+ const factor = getRangeValue(splitOptions.factor.value);
2997
+ options.color.load({
2998
+ value: {
2999
+ hsl: parent.getFillColor()
3000
+ }
3001
+ });
3002
+ if (typeof options.size.value === "number") {
3003
+ options.size.value /= factor;
3004
+ } else {
3005
+ options.size.value.min /= factor;
3006
+ options.size.value.max /= factor;
3007
+ }
3008
+ options.load(splitOptions.particles);
3009
+ const offset = splitOptions.sizeOffset ? setRangeValue(-parent.size.value, parent.size.value) : 0;
3010
+ const position = {
3011
+ x: parent.position.x + randomInRange(offset),
3012
+ y: parent.position.y + randomInRange(offset)
3013
+ };
3014
+ return this.pushParticle(position, options, parent.group, (particle => {
3015
+ if (particle.size.value < .5) {
3016
+ return false;
3017
+ }
3018
+ particle.velocity.length = randomInRange(setRangeValue(parent.velocity.length, particle.velocity.length));
3019
+ particle.splitCount = parent.splitCount + 1;
3020
+ particle.unbreakable = true;
3021
+ setTimeout((() => {
3022
+ particle.unbreakable = false;
3023
+ }), 500);
3024
+ return true;
3025
+ }));
3026
+ }
3027
+ removeQuantity(quantity, group) {
3028
+ this.removeAt(0, quantity, group);
3029
+ }
3030
+ getLinkFrequency(p1, p2) {
3031
+ const range = setRangeValue(p1.id, p2.id), key = `${getRangeMin(range)}_${getRangeMax(range)}`;
3032
+ let res = this.freqs.links.get(key);
3033
+ if (res === undefined) {
3034
+ res = Math.random();
3035
+ this.freqs.links.set(key, res);
3036
+ }
3037
+ return res;
3038
+ }
3039
+ getTriangleFrequency(p1, p2, p3) {
3040
+ let [id1, id2, id3] = [ p1.id, p2.id, p3.id ];
3041
+ if (id1 > id2) {
3042
+ [id2, id1] = [ id1, id2 ];
3043
+ }
3044
+ if (id2 > id3) {
3045
+ [id3, id2] = [ id2, id3 ];
3046
+ }
3047
+ if (id1 > id3) {
3048
+ [id3, id1] = [ id1, id3 ];
3049
+ }
3050
+ const key = `${id1}_${id2}_${id3}`;
3051
+ let res = this.freqs.triangles.get(key);
3052
+ if (res === undefined) {
3053
+ res = Math.random();
3054
+ this.freqs.triangles.set(key, res);
3055
+ }
3056
+ return res;
3057
+ }
3058
+ addManualParticles() {
3059
+ const container = this.container, options = container.actualOptions;
3060
+ for (const particle of options.manualParticles) {
3061
+ const pos = particle.position ? {
3062
+ x: particle.position.x * container.canvas.size.width / 100,
3063
+ y: particle.position.y * container.canvas.size.height / 100
3064
+ } : undefined;
3065
+ this.addParticle(pos, particle.options);
3066
+ }
3067
+ }
3068
+ setDensity() {
3069
+ const options = this.container.actualOptions;
3070
+ for (const group in options.particles.groups) {
3071
+ this.applyDensity(options.particles.groups[group], 0, group);
3072
+ }
3073
+ this.applyDensity(options.particles, options.manualParticles.length);
3074
+ }
3075
+ applyDensity(options, manualCount, group) {
3076
+ var _a;
3077
+ if (!((_a = options.number.density) === null || _a === void 0 ? void 0 : _a.enable)) {
3078
+ return;
3079
+ }
3080
+ const numberOptions = options.number;
3081
+ const densityFactor = this.initDensityFactor(numberOptions.density);
3082
+ const optParticlesNumber = numberOptions.value;
3083
+ const optParticlesLimit = numberOptions.limit > 0 ? numberOptions.limit : optParticlesNumber;
3084
+ const particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + manualCount;
3085
+ const particlesCount = Math.min(this.count, this.array.filter((t => t.group === group)).length);
3086
+ this.limit = numberOptions.limit * densityFactor;
3087
+ if (particlesCount < particlesNumber) {
3088
+ this.push(Math.abs(particlesNumber - particlesCount), undefined, options, group);
3089
+ } else if (particlesCount > particlesNumber) {
3090
+ this.removeQuantity(particlesCount - particlesNumber, group);
3091
+ }
3092
+ }
3093
+ initDensityFactor(densityOptions) {
3094
+ const container = this.container;
3095
+ if (!container.canvas.element || !densityOptions.enable) {
3096
+ return 1;
3097
+ }
3098
+ const canvas = container.canvas.element, pxRatio = container.retina.pixelRatio;
3099
+ return canvas.width * canvas.height / (densityOptions.factor * pxRatio ** 2 * densityOptions.area);
3100
+ }
3101
+ pushParticle(position, overrideOptions, group, initializer) {
3102
+ try {
3103
+ const particle = new Particle(this.nextId, this.container, position, overrideOptions, group);
3104
+ let canAdd = true;
3105
+ if (initializer) {
3106
+ canAdd = initializer(particle);
3107
+ }
3108
+ if (!canAdd) {
3109
+ return;
3110
+ }
3111
+ this.array.push(particle);
3112
+ this.zArray.push(particle);
3113
+ this.nextId++;
3114
+ return particle;
3115
+ } catch (e) {
3116
+ console.warn(`error adding particle: ${e}`);
3117
+ return;
3118
+ }
3119
+ }
3120
+ }
3121
+ class Retina_Retina {
3122
+ constructor(container) {
3123
+ this.container = container;
3124
+ }
3125
+ init() {
3126
+ const container = this.container;
3127
+ const options = container.actualOptions;
3128
+ this.pixelRatio = !options.detectRetina || isSsr() ? 1 : window.devicePixelRatio;
3129
+ const motionOptions = this.container.actualOptions.motion;
3130
+ if (motionOptions && (motionOptions.disable || motionOptions.reduce.value)) {
3131
+ if (isSsr() || typeof matchMedia === "undefined" || !matchMedia) {
3132
+ this.reduceFactor = 1;
3133
+ } else {
3134
+ const mediaQuery = matchMedia("(prefers-reduced-motion: reduce)");
3135
+ if (mediaQuery) {
3136
+ this.handleMotionChange(mediaQuery);
3137
+ const handleChange = () => {
3138
+ this.handleMotionChange(mediaQuery);
3139
+ container.refresh().catch((() => {}));
3140
+ };
3141
+ if (mediaQuery.addEventListener !== undefined) {
3142
+ mediaQuery.addEventListener("change", handleChange);
3143
+ } else if (mediaQuery.addListener !== undefined) {
3144
+ mediaQuery.addListener(handleChange);
3145
+ }
3146
+ }
3147
+ }
3148
+ } else {
3149
+ this.reduceFactor = 1;
3150
+ }
3151
+ const ratio = this.pixelRatio;
3152
+ if (container.canvas.element) {
3153
+ const element = container.canvas.element;
3154
+ container.canvas.size.width = element.offsetWidth * ratio;
3155
+ container.canvas.size.height = element.offsetHeight * ratio;
3156
+ }
3157
+ const particles = options.particles;
3158
+ this.attractDistance = particles.move.attract.distance * ratio;
3159
+ this.linksDistance = particles.links.distance * ratio;
3160
+ this.linksWidth = particles.links.width * ratio;
3161
+ this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
3162
+ this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
3163
+ if (particles.orbit.radius !== undefined) {
3164
+ this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
3165
+ }
3166
+ const modes = options.interactivity.modes;
3167
+ this.connectModeDistance = modes.connect.distance * ratio;
3168
+ this.connectModeRadius = modes.connect.radius * ratio;
3169
+ this.grabModeDistance = modes.grab.distance * ratio;
3170
+ this.repulseModeDistance = modes.repulse.distance * ratio;
3171
+ this.bounceModeDistance = modes.bounce.distance * ratio;
3172
+ this.attractModeDistance = modes.attract.distance * ratio;
3173
+ this.slowModeRadius = modes.slow.radius * ratio;
3174
+ this.bubbleModeDistance = modes.bubble.distance * ratio;
3175
+ if (modes.bubble.size) {
3176
+ this.bubbleModeSize = modes.bubble.size * ratio;
3177
+ }
3178
+ }
3179
+ initParticle(particle) {
3180
+ const options = particle.options;
3181
+ const ratio = this.pixelRatio;
3182
+ const moveDistance = options.move.distance;
3183
+ const props = particle.retina;
3184
+ props.attractDistance = options.move.attract.distance * ratio;
3185
+ props.linksDistance = options.links.distance * ratio;
3186
+ props.linksWidth = options.links.width * ratio;
3187
+ props.moveDrift = getRangeValue(options.move.drift) * ratio;
3188
+ props.moveSpeed = getRangeValue(options.move.speed) * ratio;
3189
+ props.sizeAnimationSpeed = options.size.animation.speed * ratio;
3190
+ if (particle.spin) {
3191
+ props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
3192
+ }
3193
+ const maxDistance = props.maxDistance;
3194
+ maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
3195
+ maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
3196
+ props.maxSpeed = options.move.gravity.maxSpeed * ratio;
3197
+ }
3198
+ handleMotionChange(mediaQuery) {
3199
+ const options = this.container.actualOptions;
3200
+ if (mediaQuery.matches) {
3201
+ const motion = options.motion;
3202
+ this.reduceFactor = motion.disable ? 0 : motion.reduce.value ? 1 / motion.reduce.factor : 1;
3203
+ } else {
3204
+ this.reduceFactor = 1;
3205
+ }
3206
+ }
3207
+ }
3208
+ class Container_Container {
3209
+ constructor(id, sourceOptions, ...presets) {
3210
+ this.id = id;
3211
+ this.fpsLimit = 60;
3212
+ this.duration = 0;
3213
+ this.lifeTime = 0;
3214
+ this.firstStart = true;
3215
+ this.started = false;
3216
+ this.destroyed = false;
3217
+ this.paused = true;
3218
+ this.lastFrameTime = 0;
3219
+ this.zLayers = 100;
3220
+ this.pageHidden = false;
3221
+ this._sourceOptions = sourceOptions;
3222
+ this._initialSourceOptions = sourceOptions;
3223
+ this.retina = new Retina(this);
3224
+ this.canvas = new Canvas(this);
3225
+ this.particles = new Particles(this);
3226
+ this.drawer = new FrameManager(this);
3227
+ this.presets = presets;
3228
+ this.pathGenerator = {
3229
+ generate: () => {
3230
+ const v = Vector.create(0, 0);
3231
+ v.length = Math.random();
3232
+ v.angle = Math.random() * Math.PI * 2;
3233
+ return v;
3234
+ },
3235
+ init: () => {},
3236
+ update: () => {}
3237
+ };
3238
+ this.interactivity = {
3239
+ mouse: {
3240
+ clicking: false,
3241
+ inside: false
3242
+ }
3243
+ };
3244
+ this.bubble = {};
3245
+ this.repulse = {
3246
+ particles: []
3247
+ };
3248
+ this.attract = {
3249
+ particles: []
3250
+ };
3251
+ this.plugins = new Map;
3252
+ this.drawers = new Map;
3253
+ this.density = 1;
3254
+ this._options = new Options;
3255
+ this.actualOptions = new Options;
3256
+ this.eventListeners = new EventListeners(this);
3257
+ if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
3258
+ this.intersectionObserver = new IntersectionObserver((entries => this.intersectionManager(entries)));
3259
+ }
3260
+ }
3261
+ get options() {
3262
+ return this._options;
3263
+ }
3264
+ get sourceOptions() {
3265
+ return this._sourceOptions;
3266
+ }
3267
+ play(force) {
3268
+ const needsUpdate = this.paused || force;
3269
+ if (this.firstStart && !this.actualOptions.autoPlay) {
3270
+ this.firstStart = false;
3271
+ return;
3272
+ }
3273
+ if (this.paused) {
3274
+ this.paused = false;
3275
+ }
3276
+ if (needsUpdate) {
3277
+ for (const [, plugin] of this.plugins) {
3278
+ if (plugin.play) {
3279
+ plugin.play();
3280
+ }
3281
+ }
3282
+ }
3283
+ this.draw(needsUpdate || false);
3284
+ }
3285
+ pause() {
3286
+ if (this.drawAnimationFrame !== undefined) {
3287
+ cancelAnimation()(this.drawAnimationFrame);
3288
+ delete this.drawAnimationFrame;
3289
+ }
3290
+ if (this.paused) {
3291
+ return;
3292
+ }
3293
+ for (const [, plugin] of this.plugins) {
3294
+ if (plugin.pause) {
3295
+ plugin.pause();
3296
+ }
3297
+ }
3298
+ if (!this.pageHidden) {
3299
+ this.paused = true;
3300
+ }
3301
+ }
3302
+ draw(force) {
3303
+ let refreshTime = force;
3304
+ this.drawAnimationFrame = animate()((timestamp => {
3305
+ if (refreshTime) {
3306
+ this.lastFrameTime = undefined;
3307
+ refreshTime = false;
3308
+ }
3309
+ this.drawer.nextFrame(timestamp);
3310
+ }));
3311
+ }
3312
+ getAnimationStatus() {
3313
+ return !this.paused && !this.pageHidden;
3314
+ }
3315
+ setNoise(noiseOrGenerator, init, update) {
3316
+ this.setPath(noiseOrGenerator, init, update);
3317
+ }
3318
+ setPath(pathOrGenerator, init, update) {
3319
+ if (!pathOrGenerator) {
3320
+ return;
3321
+ }
3322
+ if (typeof pathOrGenerator === "function") {
3323
+ this.pathGenerator.generate = pathOrGenerator;
3324
+ if (init) {
3325
+ this.pathGenerator.init = init;
3326
+ }
3327
+ if (update) {
3328
+ this.pathGenerator.update = update;
3329
+ }
3330
+ } else {
3331
+ if (pathOrGenerator.generate) {
3332
+ this.pathGenerator.generate = pathOrGenerator.generate;
3333
+ }
3334
+ if (pathOrGenerator.init) {
3335
+ this.pathGenerator.init = pathOrGenerator.init;
3336
+ }
3337
+ if (pathOrGenerator.update) {
3338
+ this.pathGenerator.update = pathOrGenerator.update;
3339
+ }
3340
+ }
3341
+ }
3342
+ destroy() {
3343
+ this.stop();
3344
+ this.canvas.destroy();
3345
+ for (const [, drawer] of this.drawers) {
3346
+ if (drawer.destroy) {
3347
+ drawer.destroy(this);
3348
+ }
3349
+ }
3350
+ for (const key of this.drawers.keys()) {
3351
+ this.drawers.delete(key);
3352
+ }
3353
+ this.destroyed = true;
3354
+ }
3355
+ exportImg(callback) {
3356
+ this.exportImage(callback);
3357
+ }
3358
+ exportImage(callback, type, quality) {
3359
+ var _a;
3360
+ return (_a = this.canvas.element) === null || _a === void 0 ? void 0 : _a.toBlob(callback, type !== null && type !== void 0 ? type : "image/png", quality);
3361
+ }
3362
+ exportConfiguration() {
3363
+ return JSON.stringify(this.actualOptions, undefined, 2);
3364
+ }
3365
+ refresh() {
3366
+ this.stop();
3367
+ return this.start();
3368
+ }
3369
+ reset() {
3370
+ this._options = new Options;
3371
+ return this.refresh();
3372
+ }
3373
+ stop() {
3374
+ if (!this.started) {
3375
+ return;
3376
+ }
3377
+ this.firstStart = true;
3378
+ this.started = false;
3379
+ this.eventListeners.removeListeners();
3380
+ this.pause();
3381
+ this.particles.clear();
3382
+ this.canvas.clear();
3383
+ if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
3384
+ this.intersectionObserver.observe(this.interactivity.element);
3385
+ }
3386
+ for (const [, plugin] of this.plugins) {
3387
+ if (plugin.stop) {
3388
+ plugin.stop();
3389
+ }
3390
+ }
3391
+ for (const key of this.plugins.keys()) {
3392
+ this.plugins.delete(key);
3393
+ }
3394
+ this.particles.linksColors = new Map;
3395
+ delete this.particles.grabLineColor;
3396
+ delete this.particles.linksColor;
3397
+ this._sourceOptions = this._options;
3398
+ }
3399
+ async loadTheme(name) {
3400
+ this.currentTheme = name;
3401
+ await this.refresh();
3402
+ }
3403
+ async start() {
3404
+ if (this.started) {
3405
+ return;
3406
+ }
3407
+ await this.init();
3408
+ this.started = true;
3409
+ this.eventListeners.addListeners();
3410
+ if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
3411
+ this.intersectionObserver.observe(this.interactivity.element);
3412
+ }
3413
+ for (const [, plugin] of this.plugins) {
3414
+ if (plugin.startAsync !== undefined) {
3415
+ await plugin.startAsync();
3416
+ } else if (plugin.start !== undefined) {
3417
+ plugin.start();
3418
+ }
3419
+ }
3420
+ this.play();
3421
+ }
3422
+ addClickHandler(callback) {
3423
+ const el = this.interactivity.element;
3424
+ if (!el) {
3425
+ return;
3426
+ }
3427
+ const clickOrTouchHandler = (e, pos, radius) => {
3428
+ if (this.destroyed) {
3429
+ return;
3430
+ }
3431
+ const pxRatio = this.retina.pixelRatio, posRetina = {
3432
+ x: pos.x * pxRatio,
3433
+ y: pos.y * pxRatio
3434
+ }, particles = this.particles.quadTree.queryCircle(posRetina, radius * pxRatio);
3435
+ callback(e, particles);
3436
+ };
3437
+ const clickHandler = e => {
3438
+ if (this.destroyed) {
3439
+ return;
3440
+ }
3441
+ const mouseEvent = e;
3442
+ const pos = {
3443
+ x: mouseEvent.offsetX || mouseEvent.clientX,
3444
+ y: mouseEvent.offsetY || mouseEvent.clientY
3445
+ };
3446
+ clickOrTouchHandler(e, pos, 1);
3447
+ };
3448
+ const touchStartHandler = () => {
3449
+ if (this.destroyed) {
3450
+ return;
3451
+ }
3452
+ touched = true;
3453
+ touchMoved = false;
3454
+ };
3455
+ const touchMoveHandler = () => {
3456
+ if (this.destroyed) {
3457
+ return;
3458
+ }
3459
+ touchMoved = true;
3460
+ };
3461
+ const touchEndHandler = e => {
3462
+ var _a, _b, _c;
3463
+ if (this.destroyed) {
3464
+ return;
3465
+ }
3466
+ if (touched && !touchMoved) {
3467
+ const touchEvent = e;
3468
+ let lastTouch = touchEvent.touches[touchEvent.touches.length - 1];
3469
+ if (!lastTouch) {
3470
+ lastTouch = touchEvent.changedTouches[touchEvent.changedTouches.length - 1];
3471
+ if (!lastTouch) {
3472
+ return;
3473
+ }
3474
+ }
3475
+ const canvasRect = (_a = this.canvas.element) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
3476
+ const pos = {
3477
+ x: lastTouch.clientX - ((_b = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.left) !== null && _b !== void 0 ? _b : 0),
3478
+ y: lastTouch.clientY - ((_c = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.top) !== null && _c !== void 0 ? _c : 0)
3479
+ };
3480
+ clickOrTouchHandler(e, pos, Math.max(lastTouch.radiusX, lastTouch.radiusY));
3481
+ }
3482
+ touched = false;
3483
+ touchMoved = false;
3484
+ };
3485
+ const touchCancelHandler = () => {
3486
+ if (this.destroyed) {
3487
+ return;
3488
+ }
3489
+ touched = false;
3490
+ touchMoved = false;
3491
+ };
3492
+ let touched = false;
3493
+ let touchMoved = false;
3494
+ el.addEventListener("click", clickHandler);
3495
+ el.addEventListener("touchstart", touchStartHandler);
3496
+ el.addEventListener("touchmove", touchMoveHandler);
3497
+ el.addEventListener("touchend", touchEndHandler);
3498
+ el.addEventListener("touchcancel", touchCancelHandler);
3499
+ }
3500
+ updateActualOptions() {
3501
+ this.actualOptions.responsive = [];
3502
+ const newMaxWidth = this.actualOptions.setResponsive(this.canvas.size.width, this.retina.pixelRatio, this._options);
3503
+ this.actualOptions.setTheme(this.currentTheme);
3504
+ if (this.responsiveMaxWidth != newMaxWidth) {
3505
+ this.responsiveMaxWidth = newMaxWidth;
3506
+ return true;
3507
+ }
3508
+ return false;
3509
+ }
3510
+ async init() {
3511
+ this._options = new Options;
3512
+ for (const preset of this.presets) {
3513
+ this._options.load(Plugins.getPreset(preset));
3514
+ }
3515
+ const shapes = Plugins.getSupportedShapes();
3516
+ for (const type of shapes) {
3517
+ const drawer = Plugins.getShapeDrawer(type);
3518
+ if (drawer) {
3519
+ this.drawers.set(type, drawer);
3520
+ }
3521
+ }
3522
+ this._options.load(this._initialSourceOptions);
3523
+ this._options.load(this._sourceOptions);
3524
+ this.actualOptions = new Options;
3525
+ this.actualOptions.load(this._options);
3526
+ this.retina.init();
3527
+ this.canvas.init();
3528
+ this.updateActualOptions();
3529
+ this.canvas.initBackground();
3530
+ this.canvas.resize();
3531
+ this.zLayers = this.actualOptions.zLayers;
3532
+ this.duration = getRangeValue(this.actualOptions.duration);
3533
+ this.lifeTime = 0;
3534
+ this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit : 60;
3535
+ const availablePlugins = Plugins.getAvailablePlugins(this);
3536
+ for (const [id, plugin] of availablePlugins) {
3537
+ this.plugins.set(id, plugin);
3538
+ }
3539
+ for (const [, drawer] of this.drawers) {
3540
+ if (drawer.init) {
3541
+ await drawer.init(this);
3542
+ }
3543
+ }
3544
+ for (const [, plugin] of this.plugins) {
3545
+ if (plugin.init) {
3546
+ plugin.init(this.actualOptions);
3547
+ } else if (plugin.initAsync !== undefined) {
3548
+ await plugin.initAsync(this.actualOptions);
3549
+ }
3550
+ }
3551
+ const pathOptions = this.actualOptions.particles.move.path;
3552
+ if (pathOptions.generator) {
3553
+ const customGenerator = Plugins.getPathGenerator(pathOptions.generator);
3554
+ if (customGenerator) {
3555
+ if (customGenerator.init) {
3556
+ this.pathGenerator.init = customGenerator.init;
3557
+ }
3558
+ if (customGenerator.generate) {
3559
+ this.pathGenerator.generate = customGenerator.generate;
3560
+ }
3561
+ if (customGenerator.update) {
3562
+ this.pathGenerator.update = customGenerator.update;
3563
+ }
3564
+ }
3565
+ }
3566
+ this.particles.init();
3567
+ this.particles.setDensity();
3568
+ for (const [, plugin] of this.plugins) {
3569
+ if (plugin.particlesSetup !== undefined) {
3570
+ plugin.particlesSetup();
3571
+ }
3572
+ }
3573
+ }
3574
+ intersectionManager(entries) {
3575
+ if (!this.actualOptions.pauseOnOutsideViewport) {
3576
+ return;
3577
+ }
3578
+ for (const entry of entries) {
3579
+ if (entry.target !== this.interactivity.element) {
3580
+ continue;
3581
+ }
3582
+ if (entry.isIntersecting) {
3583
+ this.play();
3584
+ } else {
3585
+ this.pause();
3586
+ }
3587
+ }
3588
+ }
3589
+ }
3590
+ const tsParticlesDom = null && [];
3591
+ function fetchError(statusCode) {
3592
+ console.error(`Error tsParticles - fetch status: ${statusCode}`);
3593
+ console.error("Error tsParticles - File config not found");
3594
+ }
3595
+ class Loader {
3596
+ static dom() {
3597
+ return tsParticlesDom;
3598
+ }
3599
+ static domItem(index) {
3600
+ const dom = Loader.dom();
3601
+ const item = dom[index];
3602
+ if (item && !item.destroyed) {
3603
+ return item;
3604
+ }
3605
+ dom.splice(index, 1);
3606
+ }
3607
+ static async loadOptions(params) {
3608
+ var _a, _b, _c;
3609
+ const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 1e4)}`;
3610
+ const {options: options, index: index} = params;
3611
+ let domContainer = (_b = params.element) !== null && _b !== void 0 ? _b : document.getElementById(tagId);
3612
+ if (!domContainer) {
3613
+ domContainer = document.createElement("div");
3614
+ domContainer.id = tagId;
3615
+ (_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
3616
+ }
3617
+ const currentOptions = options instanceof Array ? itemFromArray(options, index) : options;
3618
+ const dom = Loader.dom();
3619
+ const oldIndex = dom.findIndex((v => v.id === tagId));
3620
+ if (oldIndex >= 0) {
3621
+ const old = Loader.domItem(oldIndex);
3622
+ if (old && !old.destroyed) {
3623
+ old.destroy();
3624
+ dom.splice(oldIndex, 1);
3625
+ }
3626
+ }
3627
+ let canvasEl;
3628
+ if (domContainer.tagName.toLowerCase() === "canvas") {
3629
+ canvasEl = domContainer;
3630
+ canvasEl.dataset[Constants.generatedAttribute] = "false";
3631
+ } else {
3632
+ const existingCanvases = domContainer.getElementsByTagName("canvas");
3633
+ if (existingCanvases.length) {
3634
+ canvasEl = existingCanvases[0];
3635
+ canvasEl.dataset[Constants.generatedAttribute] = "false";
3636
+ } else {
3637
+ canvasEl = document.createElement("canvas");
3638
+ canvasEl.dataset[Constants.generatedAttribute] = "true";
3639
+ canvasEl.style.width = "100%";
3640
+ canvasEl.style.height = "100%";
3641
+ domContainer.appendChild(canvasEl);
3642
+ }
3643
+ }
3644
+ const newItem = new Container(tagId, currentOptions);
3645
+ if (oldIndex >= 0) {
3646
+ dom.splice(oldIndex, 0, newItem);
3647
+ } else {
3648
+ dom.push(newItem);
3649
+ }
3650
+ newItem.canvas.loadCanvas(canvasEl);
3651
+ await newItem.start();
3652
+ return newItem;
3653
+ }
3654
+ static async loadRemoteOptions(params) {
3655
+ const {url: jsonUrl, index: index} = params;
3656
+ const url = jsonUrl instanceof Array ? itemFromArray(jsonUrl, index) : jsonUrl;
3657
+ if (!url) {
3658
+ return;
3659
+ }
3660
+ const response = await fetch(url);
3661
+ if (!response.ok) {
3662
+ fetchError(response.status);
3663
+ return;
3664
+ }
3665
+ const data = await response.json();
3666
+ return await Loader.loadOptions({
3667
+ tagId: params.tagId,
3668
+ element: params.element,
3669
+ index: index,
3670
+ options: data
3671
+ });
3672
+ }
3673
+ static load(tagId, options, index) {
3674
+ const params = {
3675
+ index: index
3676
+ };
3677
+ if (typeof tagId === "string") {
3678
+ params.tagId = tagId;
3679
+ } else {
3680
+ params.options = tagId;
3681
+ }
3682
+ if (typeof options === "number") {
3683
+ params.index = options !== null && options !== void 0 ? options : params.index;
3684
+ } else {
3685
+ params.options = options !== null && options !== void 0 ? options : params.options;
3686
+ }
3687
+ return this.loadOptions(params);
3688
+ }
3689
+ static async set(id, domContainer, options, index) {
3690
+ const params = {
3691
+ index: index
3692
+ };
3693
+ if (typeof id === "string") {
3694
+ params.tagId = id;
3695
+ } else {
3696
+ params.element = id;
3697
+ }
3698
+ if (domContainer instanceof HTMLElement) {
3699
+ params.element = domContainer;
3700
+ } else {
3701
+ params.options = domContainer;
3702
+ }
3703
+ if (typeof options === "number") {
3704
+ params.index = options;
3705
+ } else {
3706
+ params.options = options !== null && options !== void 0 ? options : params.options;
3707
+ }
3708
+ return this.loadOptions(params);
3709
+ }
3710
+ static async loadJSON(tagId, jsonUrl, index) {
3711
+ let url, id;
3712
+ if (typeof jsonUrl === "number" || jsonUrl === undefined) {
3713
+ url = tagId;
3714
+ } else {
3715
+ id = tagId;
3716
+ url = jsonUrl;
3717
+ }
3718
+ return await Loader.loadRemoteOptions({
3719
+ tagId: id,
3720
+ url: url,
3721
+ index: index
3722
+ });
3723
+ }
3724
+ static async setJSON(id, domContainer, jsonUrl, index) {
3725
+ let url, newId, newIndex, element;
3726
+ if (id instanceof HTMLElement) {
3727
+ element = id;
3728
+ url = domContainer;
3729
+ newIndex = jsonUrl;
3730
+ } else {
3731
+ newId = id;
3732
+ element = domContainer;
3733
+ url = jsonUrl;
3734
+ newIndex = index;
3735
+ }
3736
+ return await Loader.loadRemoteOptions({
3737
+ tagId: newId,
3738
+ url: url,
3739
+ index: newIndex,
3740
+ element: element
3741
+ });
3742
+ }
3743
+ static setOnClickHandler(callback) {
3744
+ const dom = Loader.dom();
3745
+ if (dom.length === 0) {
3746
+ throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");
3747
+ }
3748
+ for (const domItem of dom) {
3749
+ domItem.addClickHandler(callback);
3750
+ }
3751
+ }
3752
+ }
3753
+ function NumberUtils_clamp(num, min, max) {
3754
+ return Math.min(Math.max(num, min), max);
3755
+ }
3756
+ function NumberUtils_mix(comp1, comp2, weight1, weight2) {
3757
+ return Math.floor((comp1 * weight1 + comp2 * weight2) / (weight1 + weight2));
3758
+ }
3759
+ function NumberUtils_randomInRange(r) {
3760
+ const max = NumberUtils_getRangeMax(r);
3761
+ let min = NumberUtils_getRangeMin(r);
3762
+ if (max === min) {
3763
+ min = 0;
3764
+ }
3765
+ return Math.random() * (max - min) + min;
3766
+ }
3767
+ function NumberUtils_getRangeValue(value) {
3768
+ return typeof value === "number" ? value : NumberUtils_randomInRange(value);
3769
+ }
3770
+ function NumberUtils_getRangeMin(value) {
3771
+ return typeof value === "number" ? value : value.min;
3772
+ }
3773
+ function NumberUtils_getRangeMax(value) {
3774
+ return typeof value === "number" ? value : value.max;
3775
+ }
3776
+ function NumberUtils_setRangeValue(source, value) {
3777
+ if (source === value || value === undefined && typeof source === "number") {
3778
+ return source;
3779
+ }
3780
+ const min = NumberUtils_getRangeMin(source), max = NumberUtils_getRangeMax(source);
3781
+ return value !== undefined ? {
3782
+ min: Math.min(min, value),
3783
+ max: Math.max(max, value)
3784
+ } : NumberUtils_setRangeValue(min, max);
3785
+ }
3786
+ function NumberUtils_getValue(options) {
3787
+ const random = options.random;
3788
+ const {enable: enable, minimumValue: minimumValue} = typeof random === "boolean" ? {
3789
+ enable: random,
3790
+ minimumValue: 0
3791
+ } : random;
3792
+ return enable ? NumberUtils_getRangeValue(NumberUtils_setRangeValue(options.value, minimumValue)) : NumberUtils_getRangeValue(options.value);
3793
+ }
3794
+ function NumberUtils_getDistances(pointA, pointB) {
3795
+ const dx = pointA.x - pointB.x;
3796
+ const dy = pointA.y - pointB.y;
3797
+ return {
3798
+ dx: dx,
3799
+ dy: dy,
3800
+ distance: Math.sqrt(dx * dx + dy * dy)
3801
+ };
3802
+ }
3803
+ function NumberUtils_getDistance(pointA, pointB) {
3804
+ return NumberUtils_getDistances(pointA, pointB).distance;
3805
+ }
3806
+ function NumberUtils_getParticleDirectionAngle(direction) {
3807
+ if (typeof direction === "number") {
3808
+ return direction * Math.PI / 180;
3809
+ } else {
3810
+ switch (direction) {
3811
+ case "top":
3812
+ return -Math.PI / 2;
3813
+
3814
+ case "top-right":
3815
+ return -Math.PI / 4;
3816
+
3817
+ case "right":
3818
+ return 0;
3819
+
3820
+ case "bottom-right":
3821
+ return Math.PI / 4;
3822
+
3823
+ case "bottom":
3824
+ return Math.PI / 2;
3825
+
3826
+ case "bottom-left":
3827
+ return 3 * Math.PI / 4;
3828
+
3829
+ case "left":
3830
+ return Math.PI;
3831
+
3832
+ case "top-left":
3833
+ return -3 * Math.PI / 4;
3834
+
3835
+ case "none":
3836
+ default:
3837
+ return Math.random() * Math.PI * 2;
3838
+ }
3839
+ }
3840
+ }
3841
+ function NumberUtils_getParticleBaseVelocity(direction) {
3842
+ const baseVelocity = Vector.origin;
3843
+ baseVelocity.length = 1;
3844
+ baseVelocity.angle = direction;
3845
+ return baseVelocity;
3846
+ }
3847
+ function NumberUtils_collisionVelocity(v1, v2, m1, m2) {
3848
+ return Vector.create(v1.x * (m1 - m2) / (m1 + m2) + v2.x * 2 * m2 / (m1 + m2), v1.y);
3849
+ }
3850
+ function calcEasing(value, type) {
3851
+ switch (type) {
3852
+ case "ease-out-quad":
3853
+ return 1 - (1 - value) ** 2;
3854
+
3855
+ case "ease-out-cubic":
3856
+ return 1 - (1 - value) ** 3;
3857
+
3858
+ case "ease-out-quart":
3859
+ return 1 - (1 - value) ** 4;
3860
+
3861
+ case "ease-out-quint":
3862
+ return 1 - (1 - value) ** 5;
3863
+
3864
+ case "ease-out-expo":
3865
+ return value === 1 ? 1 : 1 - Math.pow(2, -10 * value);
3866
+
3867
+ case "ease-out-sine":
3868
+ return Math.sin(value * Math.PI / 2);
3869
+
3870
+ case "ease-out-back":
3871
+ {
3872
+ const c1 = 1.70158;
3873
+ const c3 = c1 + 1;
3874
+ return 1 + c3 * Math.pow(value - 1, 3) + c1 * Math.pow(value - 1, 2);
3875
+ }
3876
+
3877
+ case "ease-out-circ":
3878
+ return Math.sqrt(1 - Math.pow(value - 1, 2));
3879
+
3880
+ default:
3881
+ return value;
3882
+ }
3883
+ }
3884
+ function rectSideBounce(pSide, pOtherSide, rectSide, rectOtherSide, velocity, factor) {
3885
+ const res = {
3886
+ bounced: false
3887
+ };
3888
+ if (pOtherSide.min >= rectOtherSide.min && pOtherSide.min <= rectOtherSide.max && pOtherSide.max >= rectOtherSide.min && pOtherSide.max <= rectOtherSide.max) {
3889
+ if (pSide.max >= rectSide.min && pSide.max <= (rectSide.max + rectSide.min) / 2 && velocity > 0 || pSide.min <= rectSide.max && pSide.min > (rectSide.max + rectSide.min) / 2 && velocity < 0) {
3890
+ res.velocity = velocity * -factor;
3891
+ res.bounced = true;
3892
+ }
3893
+ }
3894
+ return res;
3895
+ }
3896
+ function checkSelector(element, selectors) {
3897
+ if (selectors instanceof Array) {
3898
+ for (const selector of selectors) {
3899
+ if (element.matches(selector)) {
3900
+ return true;
3901
+ }
3902
+ }
3903
+ return false;
3904
+ } else {
3905
+ return element.matches(selectors);
3906
+ }
3907
+ }
3908
+ function Utils_isSsr() {
3909
+ return typeof window === "undefined" || !window || typeof window.document === "undefined" || !window.document;
3910
+ }
3911
+ function Utils_animate() {
3912
+ return Utils_isSsr() ? callback => setTimeout(callback) : callback => (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout)(callback);
3913
+ }
3914
+ function Utils_cancelAnimation() {
3915
+ return Utils_isSsr() ? handle => clearTimeout(handle) : handle => (window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.clearTimeout)(handle);
3916
+ }
3917
+ function Utils_isInArray(value, array) {
3918
+ return value === array || array instanceof Array && array.indexOf(value) > -1;
3919
+ }
3920
+ async function loadFont(character) {
3921
+ var _a, _b;
3922
+ try {
3923
+ await document.fonts.load(`${(_a = character.weight) !== null && _a !== void 0 ? _a : "400"} 36px '${(_b = character.font) !== null && _b !== void 0 ? _b : "Verdana"}'`);
3924
+ } catch (_c) {}
3925
+ }
3926
+ function arrayRandomIndex(array) {
3927
+ return Math.floor(Math.random() * array.length);
3928
+ }
3929
+ function Utils_itemFromArray(array, index, useIndex = true) {
3930
+ const fixedIndex = index !== undefined && useIndex ? index % array.length : arrayRandomIndex(array);
3931
+ return array[fixedIndex];
3932
+ }
3933
+ function isPointInside(point, size, radius, direction) {
3934
+ return areBoundsInside(calculateBounds(point, radius !== null && radius !== void 0 ? radius : 0), size, direction);
3935
+ }
3936
+ function areBoundsInside(bounds, size, direction) {
3937
+ let inside = true;
3938
+ if (!direction || direction === "bottom") {
3939
+ inside = bounds.top < size.height;
3940
+ }
3941
+ if (inside && (!direction || direction === "left")) {
3942
+ inside = bounds.right > 0;
3943
+ }
3944
+ if (inside && (!direction || direction === "right")) {
3945
+ inside = bounds.left < size.width;
3946
+ }
3947
+ if (inside && (!direction || direction === "top")) {
3948
+ inside = bounds.bottom > 0;
3949
+ }
3950
+ return inside;
3951
+ }
3952
+ function calculateBounds(point, radius) {
3953
+ return {
3954
+ bottom: point.y + radius,
3955
+ left: point.x - radius,
3956
+ right: point.x + radius,
3957
+ top: point.y - radius
3958
+ };
3959
+ }
3960
+ function Utils_deepExtend(destination, ...sources) {
3961
+ for (const source of sources) {
3962
+ if (source === undefined || source === null) {
3963
+ continue;
3964
+ }
3965
+ if (typeof source !== "object") {
3966
+ destination = source;
3967
+ continue;
3968
+ }
3969
+ const sourceIsArray = Array.isArray(source);
3970
+ if (sourceIsArray && (typeof destination !== "object" || !destination || !Array.isArray(destination))) {
3971
+ destination = [];
3972
+ } else if (!sourceIsArray && (typeof destination !== "object" || !destination || Array.isArray(destination))) {
3973
+ destination = {};
3974
+ }
3975
+ for (const key in source) {
3976
+ if (key === "__proto__") {
3977
+ continue;
3978
+ }
3979
+ const sourceDict = source;
3980
+ const value = sourceDict[key];
3981
+ const isObject = typeof value === "object";
3982
+ const destDict = destination;
3983
+ destDict[key] = isObject && Array.isArray(value) ? value.map((v => Utils_deepExtend(destDict[key], v))) : Utils_deepExtend(destDict[key], value);
3984
+ }
3985
+ }
3986
+ return destination;
3987
+ }
3988
+ function isDivModeEnabled(mode, divs) {
3989
+ return divs instanceof Array ? !!divs.find((t => t.enable && Utils_isInArray(mode, t.mode))) : Utils_isInArray(mode, divs.mode);
3990
+ }
3991
+ function divModeExecute(mode, divs, callback) {
3992
+ if (divs instanceof Array) {
3993
+ for (const div of divs) {
3994
+ const divMode = div.mode;
3995
+ const divEnabled = div.enable;
3996
+ if (divEnabled && Utils_isInArray(mode, divMode)) {
3997
+ singleDivModeExecute(div, callback);
3998
+ }
3999
+ }
4000
+ } else {
4001
+ const divMode = divs.mode;
4002
+ const divEnabled = divs.enable;
4003
+ if (divEnabled && Utils_isInArray(mode, divMode)) {
4004
+ singleDivModeExecute(divs, callback);
4005
+ }
4006
+ }
4007
+ }
4008
+ function singleDivModeExecute(div, callback) {
4009
+ const selectors = div.selectors;
4010
+ if (selectors instanceof Array) {
4011
+ for (const selector of selectors) {
4012
+ callback(selector, div);
4013
+ }
4014
+ } else {
4015
+ callback(selectors, div);
4016
+ }
4017
+ }
4018
+ function divMode(divs, element) {
4019
+ if (!element || !divs) {
4020
+ return;
4021
+ }
4022
+ if (divs instanceof Array) {
4023
+ return divs.find((d => checkSelector(element, d.selectors)));
4024
+ } else if (checkSelector(element, divs.selectors)) {
4025
+ return divs;
4026
+ }
4027
+ }
4028
+ function circleBounceDataFromParticle(p) {
4029
+ return {
4030
+ position: p.getPosition(),
4031
+ radius: p.getRadius(),
4032
+ mass: p.getMass(),
4033
+ velocity: p.velocity,
4034
+ factor: Vector.create(getValue(p.options.bounce.horizontal), getValue(p.options.bounce.vertical))
4035
+ };
4036
+ }
4037
+ function circleBounce(p1, p2) {
4038
+ const {x: xVelocityDiff, y: yVelocityDiff} = p1.velocity.sub(p2.velocity);
4039
+ const [pos1, pos2] = [ p1.position, p2.position ];
4040
+ const {dx: xDist, dy: yDist} = getDistances(pos2, pos1);
4041
+ if (xVelocityDiff * xDist + yVelocityDiff * yDist >= 0) {
4042
+ const angle = -Math.atan2(yDist, xDist);
4043
+ const m1 = p1.mass;
4044
+ const m2 = p2.mass;
4045
+ const u1 = p1.velocity.rotate(angle);
4046
+ const u2 = p2.velocity.rotate(angle);
4047
+ const v1 = collisionVelocity(u1, u2, m1, m2);
4048
+ const v2 = collisionVelocity(u2, u1, m1, m2);
4049
+ const vFinal1 = v1.rotate(-angle);
4050
+ const vFinal2 = v2.rotate(-angle);
4051
+ p1.velocity.x = vFinal1.x * p1.factor.x;
4052
+ p1.velocity.y = vFinal1.y * p1.factor.y;
4053
+ p2.velocity.x = vFinal2.x * p2.factor.x;
4054
+ p2.velocity.y = vFinal2.y * p2.factor.y;
4055
+ }
4056
+ }
4057
+ function rectBounce(particle, divBounds) {
4058
+ const pPos = particle.getPosition();
4059
+ const size = particle.getRadius();
4060
+ const bounds = calculateBounds(pPos, size);
4061
+ const resH = rectSideBounce({
4062
+ min: bounds.left,
4063
+ max: bounds.right
4064
+ }, {
4065
+ min: bounds.top,
4066
+ max: bounds.bottom
4067
+ }, {
4068
+ min: divBounds.left,
4069
+ max: divBounds.right
4070
+ }, {
4071
+ min: divBounds.top,
4072
+ max: divBounds.bottom
4073
+ }, particle.velocity.x, getValue(particle.options.bounce.horizontal));
4074
+ if (resH.bounced) {
4075
+ if (resH.velocity !== undefined) {
4076
+ particle.velocity.x = resH.velocity;
4077
+ }
4078
+ if (resH.position !== undefined) {
4079
+ particle.position.x = resH.position;
4080
+ }
4081
+ }
4082
+ const resV = rectSideBounce({
4083
+ min: bounds.top,
4084
+ max: bounds.bottom
4085
+ }, {
4086
+ min: bounds.left,
4087
+ max: bounds.right
4088
+ }, {
4089
+ min: divBounds.top,
4090
+ max: divBounds.bottom
4091
+ }, {
4092
+ min: divBounds.left,
4093
+ max: divBounds.right
4094
+ }, particle.velocity.y, getValue(particle.options.bounce.vertical));
4095
+ if (resV.bounced) {
4096
+ if (resV.velocity !== undefined) {
4097
+ particle.velocity.y = resV.velocity;
4098
+ }
4099
+ if (resV.position !== undefined) {
4100
+ particle.position.y = resV.position;
4101
+ }
4102
+ }
4103
+ }
4104
+ function hue2rgb(p, q, t) {
4105
+ let tCalc = t;
4106
+ if (tCalc < 0) {
4107
+ tCalc += 1;
4108
+ }
4109
+ if (tCalc > 1) {
4110
+ tCalc -= 1;
4111
+ }
4112
+ if (tCalc < 1 / 6) {
4113
+ return p + (q - p) * 6 * tCalc;
4114
+ }
4115
+ if (tCalc < 1 / 2) {
4116
+ return q;
4117
+ }
4118
+ if (tCalc < 2 / 3) {
4119
+ return p + (q - p) * (2 / 3 - tCalc) * 6;
4120
+ }
4121
+ return p;
4122
+ }
4123
+ function stringToRgba(input) {
4124
+ if (input.startsWith("rgb")) {
4125
+ const regex = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([\d.]+)\s*)?\)/i;
4126
+ const result = regex.exec(input);
4127
+ return result ? {
4128
+ a: result.length > 4 ? parseFloat(result[5]) : 1,
4129
+ b: parseInt(result[3], 10),
4130
+ g: parseInt(result[2], 10),
4131
+ r: parseInt(result[1], 10)
4132
+ } : undefined;
4133
+ } else if (input.startsWith("hsl")) {
4134
+ const regex = /hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.]+)\s*)?\)/i;
4135
+ const result = regex.exec(input);
4136
+ return result ? hslaToRgba({
4137
+ a: result.length > 4 ? parseFloat(result[5]) : 1,
4138
+ h: parseInt(result[1], 10),
4139
+ l: parseInt(result[3], 10),
4140
+ s: parseInt(result[2], 10)
4141
+ }) : undefined;
4142
+ } else if (input.startsWith("hsv")) {
4143
+ const regex = /hsva?\(\s*(\d+)°\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.]+)\s*)?\)/i;
4144
+ const result = regex.exec(input);
4145
+ return result ? hsvaToRgba({
4146
+ a: result.length > 4 ? parseFloat(result[5]) : 1,
4147
+ h: parseInt(result[1], 10),
4148
+ s: parseInt(result[2], 10),
4149
+ v: parseInt(result[3], 10)
4150
+ }) : undefined;
4151
+ } else {
4152
+ const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;
4153
+ const hexFixed = input.replace(shorthandRegex, ((_m, r, g, b, a) => r + r + g + g + b + b + (a !== undefined ? a + a : "")));
4154
+ const regex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;
4155
+ const result = regex.exec(hexFixed);
4156
+ return result ? {
4157
+ a: result[4] !== undefined ? parseInt(result[4], 16) / 255 : 1,
4158
+ b: parseInt(result[3], 16),
4159
+ g: parseInt(result[2], 16),
4160
+ r: parseInt(result[1], 16)
4161
+ } : undefined;
4162
+ }
4163
+ }
4164
+ function ColorUtils_colorToRgb(input, index, useIndex = true) {
4165
+ var _a, _b, _c;
4166
+ if (input === undefined) {
4167
+ return;
4168
+ }
4169
+ const color = typeof input === "string" ? {
4170
+ value: input
4171
+ } : input;
4172
+ let res;
4173
+ if (typeof color.value === "string") {
4174
+ if (color.value === Constants.randomColorValue) {
4175
+ res = getRandomRgbColor();
4176
+ } else {
4177
+ res = stringToRgb(color.value);
4178
+ }
4179
+ } else {
4180
+ if (color.value instanceof Array) {
4181
+ const colorSelected = itemFromArray(color.value, index, useIndex);
4182
+ res = ColorUtils_colorToRgb({
4183
+ value: colorSelected
4184
+ });
4185
+ } else {
4186
+ const colorValue = color.value;
4187
+ const rgbColor = (_a = colorValue.rgb) !== null && _a !== void 0 ? _a : color.value;
4188
+ if (rgbColor.r !== undefined) {
4189
+ res = rgbColor;
4190
+ } else {
4191
+ const hslColor = (_b = colorValue.hsl) !== null && _b !== void 0 ? _b : color.value;
4192
+ if (hslColor.h !== undefined && hslColor.l !== undefined) {
4193
+ res = hslToRgb(hslColor);
4194
+ } else {
4195
+ const hsvColor = (_c = colorValue.hsv) !== null && _c !== void 0 ? _c : color.value;
4196
+ if (hsvColor.h !== undefined && hsvColor.v !== undefined) {
4197
+ res = hsvToRgb(hsvColor);
4198
+ }
4199
+ }
4200
+ }
4201
+ }
4202
+ }
4203
+ return res;
4204
+ }
4205
+ function ColorUtils_colorToHsl(color, index, useIndex = true) {
4206
+ const rgb = ColorUtils_colorToRgb(color, index, useIndex);
4207
+ return rgb !== undefined ? rgbToHsl(rgb) : undefined;
4208
+ }
4209
+ function rgbToHsl(color) {
4210
+ const r1 = color.r / 255;
4211
+ const g1 = color.g / 255;
4212
+ const b1 = color.b / 255;
4213
+ const max = Math.max(r1, g1, b1);
4214
+ const min = Math.min(r1, g1, b1);
4215
+ const res = {
4216
+ h: 0,
4217
+ l: (max + min) / 2,
4218
+ s: 0
4219
+ };
4220
+ if (max != min) {
4221
+ res.s = res.l < .5 ? (max - min) / (max + min) : (max - min) / (2 - max - min);
4222
+ res.h = r1 === max ? (g1 - b1) / (max - min) : res.h = g1 === max ? 2 + (b1 - r1) / (max - min) : 4 + (r1 - g1) / (max - min);
4223
+ }
4224
+ res.l *= 100;
4225
+ res.s *= 100;
4226
+ res.h *= 60;
4227
+ if (res.h < 0) {
4228
+ res.h += 360;
4229
+ }
4230
+ return res;
4231
+ }
4232
+ function stringToAlpha(input) {
4233
+ var _a;
4234
+ return (_a = stringToRgba(input)) === null || _a === void 0 ? void 0 : _a.a;
4235
+ }
4236
+ function stringToRgb(input) {
4237
+ return stringToRgba(input);
4238
+ }
4239
+ function hslToRgb(hsl) {
4240
+ const result = {
4241
+ b: 0,
4242
+ g: 0,
4243
+ r: 0
4244
+ };
4245
+ const hslPercent = {
4246
+ h: hsl.h / 360,
4247
+ l: hsl.l / 100,
4248
+ s: hsl.s / 100
4249
+ };
4250
+ if (hslPercent.s === 0) {
4251
+ result.b = hslPercent.l;
4252
+ result.g = hslPercent.l;
4253
+ result.r = hslPercent.l;
4254
+ } else {
4255
+ const q = hslPercent.l < .5 ? hslPercent.l * (1 + hslPercent.s) : hslPercent.l + hslPercent.s - hslPercent.l * hslPercent.s;
4256
+ const p = 2 * hslPercent.l - q;
4257
+ result.r = hue2rgb(p, q, hslPercent.h + 1 / 3);
4258
+ result.g = hue2rgb(p, q, hslPercent.h);
4259
+ result.b = hue2rgb(p, q, hslPercent.h - 1 / 3);
4260
+ }
4261
+ result.r = Math.floor(result.r * 255);
4262
+ result.g = Math.floor(result.g * 255);
4263
+ result.b = Math.floor(result.b * 255);
4264
+ return result;
4265
+ }
4266
+ function hslaToRgba(hsla) {
4267
+ const rgbResult = hslToRgb(hsla);
4268
+ return {
4269
+ a: hsla.a,
4270
+ b: rgbResult.b,
4271
+ g: rgbResult.g,
4272
+ r: rgbResult.r
4273
+ };
4274
+ }
4275
+ function hslToHsv(hsl) {
4276
+ const l = hsl.l / 100, sl = hsl.s / 100;
4277
+ const v = l + sl * Math.min(l, 1 - l), sv = !v ? 0 : 2 * (1 - l / v);
4278
+ return {
4279
+ h: hsl.h,
4280
+ s: sv * 100,
4281
+ v: v * 100
4282
+ };
4283
+ }
4284
+ function hslaToHsva(hsla) {
4285
+ const hsvResult = hslToHsv(hsla);
4286
+ return {
4287
+ a: hsla.a,
4288
+ h: hsvResult.h,
4289
+ s: hsvResult.s,
4290
+ v: hsvResult.v
4291
+ };
4292
+ }
4293
+ function hsvToHsl(hsv) {
4294
+ const v = hsv.v / 100, sv = hsv.s / 100;
4295
+ const l = v * (1 - sv / 2), sl = l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l);
4296
+ return {
4297
+ h: hsv.h,
4298
+ l: l * 100,
4299
+ s: sl * 100
4300
+ };
4301
+ }
4302
+ function hsvaToHsla(hsva) {
4303
+ const hslResult = hsvToHsl(hsva);
4304
+ return {
4305
+ a: hsva.a,
4306
+ h: hslResult.h,
4307
+ l: hslResult.l,
4308
+ s: hslResult.s
4309
+ };
4310
+ }
4311
+ function hsvToRgb(hsv) {
4312
+ const result = {
4313
+ b: 0,
4314
+ g: 0,
4315
+ r: 0
4316
+ };
4317
+ const hsvPercent = {
4318
+ h: hsv.h / 60,
4319
+ s: hsv.s / 100,
4320
+ v: hsv.v / 100
4321
+ };
4322
+ const c = hsvPercent.v * hsvPercent.s, x = c * (1 - Math.abs(hsvPercent.h % 2 - 1));
4323
+ let tempRgb;
4324
+ if (hsvPercent.h >= 0 && hsvPercent.h <= 1) {
4325
+ tempRgb = {
4326
+ r: c,
4327
+ g: x,
4328
+ b: 0
4329
+ };
4330
+ } else if (hsvPercent.h > 1 && hsvPercent.h <= 2) {
4331
+ tempRgb = {
4332
+ r: x,
4333
+ g: c,
4334
+ b: 0
4335
+ };
4336
+ } else if (hsvPercent.h > 2 && hsvPercent.h <= 3) {
4337
+ tempRgb = {
4338
+ r: 0,
4339
+ g: c,
4340
+ b: x
4341
+ };
4342
+ } else if (hsvPercent.h > 3 && hsvPercent.h <= 4) {
4343
+ tempRgb = {
4344
+ r: 0,
4345
+ g: x,
4346
+ b: c
4347
+ };
4348
+ } else if (hsvPercent.h > 4 && hsvPercent.h <= 5) {
4349
+ tempRgb = {
4350
+ r: x,
4351
+ g: 0,
4352
+ b: c
4353
+ };
4354
+ } else if (hsvPercent.h > 5 && hsvPercent.h <= 6) {
4355
+ tempRgb = {
4356
+ r: c,
4357
+ g: 0,
4358
+ b: x
4359
+ };
4360
+ }
4361
+ if (tempRgb) {
4362
+ const m = hsvPercent.v - c;
4363
+ result.r = Math.floor((tempRgb.r + m) * 255);
4364
+ result.g = Math.floor((tempRgb.g + m) * 255);
4365
+ result.b = Math.floor((tempRgb.b + m) * 255);
4366
+ }
4367
+ return result;
4368
+ }
4369
+ function hsvaToRgba(hsva) {
4370
+ const rgbResult = hsvToRgb(hsva);
4371
+ return {
4372
+ a: hsva.a,
4373
+ b: rgbResult.b,
4374
+ g: rgbResult.g,
4375
+ r: rgbResult.r
4376
+ };
4377
+ }
4378
+ function rgbToHsv(rgb) {
4379
+ const rgbPercent = {
4380
+ r: rgb.r / 255,
4381
+ g: rgb.g / 255,
4382
+ b: rgb.b / 255
4383
+ }, xMax = Math.max(rgbPercent.r, rgbPercent.g, rgbPercent.b), xMin = Math.min(rgbPercent.r, rgbPercent.g, rgbPercent.b), v = xMax, c = xMax - xMin;
4384
+ let h = 0;
4385
+ if (v === rgbPercent.r) {
4386
+ h = 60 * ((rgbPercent.g - rgbPercent.b) / c);
4387
+ } else if (v === rgbPercent.g) {
4388
+ h = 60 * (2 + (rgbPercent.b - rgbPercent.r) / c);
4389
+ } else if (v === rgbPercent.b) {
4390
+ h = 60 * (4 + (rgbPercent.r - rgbPercent.g) / c);
4391
+ }
4392
+ const s = !v ? 0 : c / v;
4393
+ return {
4394
+ h: h,
4395
+ s: s * 100,
4396
+ v: v * 100
4397
+ };
4398
+ }
4399
+ function rgbaToHsva(rgba) {
4400
+ const hsvResult = rgbToHsv(rgba);
4401
+ return {
4402
+ a: rgba.a,
4403
+ h: hsvResult.h,
4404
+ s: hsvResult.s,
4405
+ v: hsvResult.v
4406
+ };
4407
+ }
4408
+ function getRandomRgbColor(min) {
4409
+ const fixedMin = min !== null && min !== void 0 ? min : 0;
4410
+ return {
4411
+ b: Math.floor(randomInRange(setRangeValue(fixedMin, 256))),
4412
+ g: Math.floor(randomInRange(setRangeValue(fixedMin, 256))),
4413
+ r: Math.floor(randomInRange(setRangeValue(fixedMin, 256)))
4414
+ };
4415
+ }
4416
+ function ColorUtils_getStyleFromRgb(color, opacity) {
4417
+ return `rgba(${color.r}, ${color.g}, ${color.b}, ${opacity !== null && opacity !== void 0 ? opacity : 1})`;
4418
+ }
4419
+ function ColorUtils_getStyleFromHsl(color, opacity) {
4420
+ return `hsla(${color.h}, ${color.s}%, ${color.l}%, ${opacity !== null && opacity !== void 0 ? opacity : 1})`;
4421
+ }
4422
+ function getStyleFromHsv(color, opacity) {
4423
+ return ColorUtils_getStyleFromHsl(hsvToHsl(color), opacity);
4424
+ }
4425
+ function ColorUtils_colorMix(color1, color2, size1, size2) {
4426
+ let rgb1 = color1;
4427
+ let rgb2 = color2;
4428
+ if (rgb1.r === undefined) {
4429
+ rgb1 = hslToRgb(color1);
4430
+ }
4431
+ if (rgb2.r === undefined) {
4432
+ rgb2 = hslToRgb(color2);
4433
+ }
4434
+ return {
4435
+ b: mix(rgb1.b, rgb2.b, size1, size2),
4436
+ g: mix(rgb1.g, rgb2.g, size1, size2),
4437
+ r: mix(rgb1.r, rgb2.r, size1, size2)
4438
+ };
4439
+ }
4440
+ function getLinkColor(p1, p2, linkColor) {
4441
+ var _a, _b;
4442
+ if (linkColor === Constants.randomColorValue) {
4443
+ return getRandomRgbColor();
4444
+ } else if (linkColor === "mid") {
4445
+ const sourceColor = (_a = p1.getFillColor()) !== null && _a !== void 0 ? _a : p1.getStrokeColor();
4446
+ const destColor = (_b = p2 === null || p2 === void 0 ? void 0 : p2.getFillColor()) !== null && _b !== void 0 ? _b : p2 === null || p2 === void 0 ? void 0 : p2.getStrokeColor();
4447
+ if (sourceColor && destColor && p2) {
4448
+ return ColorUtils_colorMix(sourceColor, destColor, p1.getRadius(), p2.getRadius());
4449
+ } else {
4450
+ const hslColor = sourceColor !== null && sourceColor !== void 0 ? sourceColor : destColor;
4451
+ if (hslColor) {
4452
+ return hslToRgb(hslColor);
4453
+ }
4454
+ }
4455
+ } else {
4456
+ return linkColor;
4457
+ }
4458
+ }
4459
+ function getLinkRandomColor(optColor, blink, consent) {
4460
+ const color = typeof optColor === "string" ? optColor : optColor.value;
4461
+ if (color === Constants.randomColorValue) {
4462
+ if (consent) {
4463
+ return ColorUtils_colorToRgb({
4464
+ value: color
4465
+ });
4466
+ } else if (blink) {
4467
+ return Constants.randomColorValue;
4468
+ } else {
4469
+ return Constants.midColorValue;
4470
+ }
4471
+ } else {
4472
+ return ColorUtils_colorToRgb({
4473
+ value: color
4474
+ });
4475
+ }
4476
+ }
4477
+ function ColorUtils_getHslFromAnimation(animation) {
4478
+ return animation !== undefined ? {
4479
+ h: animation.h.value,
4480
+ s: animation.s.value,
4481
+ l: animation.l.value
4482
+ } : undefined;
4483
+ }
4484
+ function getHslAnimationFromHsl(hsl, animationOptions, reduceFactor) {
4485
+ const resColor = {
4486
+ h: {
4487
+ enable: false,
4488
+ value: hsl.h
4489
+ },
4490
+ s: {
4491
+ enable: false,
4492
+ value: hsl.s
4493
+ },
4494
+ l: {
4495
+ enable: false,
4496
+ value: hsl.l
4497
+ }
4498
+ };
4499
+ if (animationOptions) {
4500
+ setColorAnimation(resColor.h, animationOptions.h, reduceFactor);
4501
+ setColorAnimation(resColor.s, animationOptions.s, reduceFactor);
4502
+ setColorAnimation(resColor.l, animationOptions.l, reduceFactor);
4503
+ }
4504
+ return resColor;
4505
+ }
4506
+ function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
4507
+ colorValue.enable = colorAnimation.enable;
4508
+ if (colorValue.enable) {
4509
+ colorValue.velocity = colorAnimation.speed / 100 * reduceFactor;
4510
+ if (colorAnimation.sync) {
4511
+ return;
4512
+ }
4513
+ colorValue.status = 0;
4514
+ colorValue.velocity *= Math.random();
4515
+ if (colorValue.value) {
4516
+ colorValue.value *= Math.random();
4517
+ }
4518
+ } else {
4519
+ colorValue.velocity = 0;
4520
+ }
4521
+ }
4522
+ function drawLine(context, begin, end) {
4523
+ context.beginPath();
4524
+ context.moveTo(begin.x, begin.y);
4525
+ context.lineTo(end.x, end.y);
4526
+ context.closePath();
4527
+ }
4528
+ function drawTriangle(context, p1, p2, p3) {
4529
+ context.beginPath();
4530
+ context.moveTo(p1.x, p1.y);
4531
+ context.lineTo(p2.x, p2.y);
4532
+ context.lineTo(p3.x, p3.y);
4533
+ context.closePath();
4534
+ }
4535
+ function CanvasUtils_paintBase(context, dimension, baseColor) {
4536
+ context.save();
4537
+ context.fillStyle = baseColor !== null && baseColor !== void 0 ? baseColor : "rgba(0,0,0,0)";
4538
+ context.fillRect(0, 0, dimension.width, dimension.height);
4539
+ context.restore();
4540
+ }
4541
+ function CanvasUtils_clear(context, dimension) {
4542
+ context.clearRect(0, 0, dimension.width, dimension.height);
4543
+ }
4544
+ function drawLinkLine(context, width, begin, end, maxDistance, canvasSize, warp, backgroundMask, composite, colorLine, opacity, shadow) {
4545
+ let drawn = false;
4546
+ if (getDistance(begin, end) <= maxDistance) {
4547
+ drawLine(context, begin, end);
4548
+ drawn = true;
4549
+ } else if (warp) {
4550
+ let pi1;
4551
+ let pi2;
4552
+ const endNE = {
4553
+ x: end.x - canvasSize.width,
4554
+ y: end.y
4555
+ };
4556
+ const d1 = getDistances(begin, endNE);
4557
+ if (d1.distance <= maxDistance) {
4558
+ const yi = begin.y - d1.dy / d1.dx * begin.x;
4559
+ pi1 = {
4560
+ x: 0,
4561
+ y: yi
4562
+ };
4563
+ pi2 = {
4564
+ x: canvasSize.width,
4565
+ y: yi
4566
+ };
4567
+ } else {
4568
+ const endSW = {
4569
+ x: end.x,
4570
+ y: end.y - canvasSize.height
4571
+ };
4572
+ const d2 = getDistances(begin, endSW);
4573
+ if (d2.distance <= maxDistance) {
4574
+ const yi = begin.y - d2.dy / d2.dx * begin.x;
4575
+ const xi = -yi / (d2.dy / d2.dx);
4576
+ pi1 = {
4577
+ x: xi,
4578
+ y: 0
4579
+ };
4580
+ pi2 = {
4581
+ x: xi,
4582
+ y: canvasSize.height
4583
+ };
4584
+ } else {
4585
+ const endSE = {
4586
+ x: end.x - canvasSize.width,
4587
+ y: end.y - canvasSize.height
4588
+ };
4589
+ const d3 = getDistances(begin, endSE);
4590
+ if (d3.distance <= maxDistance) {
4591
+ const yi = begin.y - d3.dy / d3.dx * begin.x;
4592
+ const xi = -yi / (d3.dy / d3.dx);
4593
+ pi1 = {
4594
+ x: xi,
4595
+ y: yi
4596
+ };
4597
+ pi2 = {
4598
+ x: pi1.x + canvasSize.width,
4599
+ y: pi1.y + canvasSize.height
4600
+ };
4601
+ }
4602
+ }
4603
+ }
4604
+ if (pi1 && pi2) {
4605
+ drawLine(context, begin, pi1);
4606
+ drawLine(context, end, pi2);
4607
+ drawn = true;
4608
+ }
4609
+ }
4610
+ if (!drawn) {
4611
+ return;
4612
+ }
4613
+ context.lineWidth = width;
4614
+ if (backgroundMask) {
4615
+ context.globalCompositeOperation = composite;
4616
+ }
4617
+ context.strokeStyle = getStyleFromRgb(colorLine, opacity);
4618
+ if (shadow.enable) {
4619
+ const shadowColor = colorToRgb(shadow.color);
4620
+ if (shadowColor) {
4621
+ context.shadowBlur = shadow.blur;
4622
+ context.shadowColor = getStyleFromRgb(shadowColor);
4623
+ }
4624
+ }
4625
+ context.stroke();
4626
+ }
4627
+ function drawLinkTriangle(context, pos1, pos2, pos3, backgroundMask, composite, colorTriangle, opacityTriangle) {
4628
+ drawTriangle(context, pos1, pos2, pos3);
4629
+ if (backgroundMask) {
4630
+ context.globalCompositeOperation = composite;
4631
+ }
4632
+ context.fillStyle = getStyleFromRgb(colorTriangle, opacityTriangle);
4633
+ context.fill();
4634
+ }
4635
+ function CanvasUtils_drawConnectLine(context, width, lineStyle, begin, end) {
4636
+ context.save();
4637
+ drawLine(context, begin, end);
4638
+ context.lineWidth = width;
4639
+ context.strokeStyle = lineStyle;
4640
+ context.stroke();
4641
+ context.restore();
4642
+ }
4643
+ function CanvasUtils_gradient(context, p1, p2, opacity) {
4644
+ const gradStop = Math.floor(p2.getRadius() / p1.getRadius());
4645
+ const color1 = p1.getFillColor();
4646
+ const color2 = p2.getFillColor();
4647
+ if (!color1 || !color2) {
4648
+ return;
4649
+ }
4650
+ const sourcePos = p1.getPosition();
4651
+ const destPos = p2.getPosition();
4652
+ const midRgb = colorMix(color1, color2, p1.getRadius(), p2.getRadius());
4653
+ const grad = context.createLinearGradient(sourcePos.x, sourcePos.y, destPos.x, destPos.y);
4654
+ grad.addColorStop(0, getStyleFromHsl(color1, opacity));
4655
+ grad.addColorStop(gradStop > 1 ? 1 : gradStop, getStyleFromRgb(midRgb, opacity));
4656
+ grad.addColorStop(1, getStyleFromHsl(color2, opacity));
4657
+ return grad;
4658
+ }
4659
+ function CanvasUtils_drawGrabLine(context, width, begin, end, colorLine, opacity) {
4660
+ context.save();
4661
+ drawLine(context, begin, end);
4662
+ context.strokeStyle = getStyleFromRgb(colorLine, opacity);
4663
+ context.lineWidth = width;
4664
+ context.stroke();
4665
+ context.restore();
4666
+ }
4667
+ function CanvasUtils_drawParticle(container, context, particle, delta, fillColorValue, strokeColorValue, backgroundMask, composite, radius, opacity, shadow, gradient) {
4668
+ var _a, _b, _c, _d, _e, _f;
4669
+ const pos = particle.getPosition();
4670
+ const tiltOptions = particle.options.tilt;
4671
+ const rollOptions = particle.options.roll;
4672
+ context.save();
4673
+ if (tiltOptions.enable || rollOptions.enable) {
4674
+ const roll = rollOptions.enable && particle.roll;
4675
+ const tilt = tiltOptions.enable && particle.tilt;
4676
+ const rollHorizontal = roll && (rollOptions.mode === "horizontal" || rollOptions.mode === "both");
4677
+ const rollVertical = roll && (rollOptions.mode === "vertical" || rollOptions.mode === "both");
4678
+ context.setTransform(rollHorizontal ? Math.cos(particle.roll.angle) : 1, tilt ? Math.cos(particle.tilt.value) * particle.tilt.cosDirection : 0, tilt ? Math.sin(particle.tilt.value) * particle.tilt.sinDirection : 0, rollVertical ? Math.sin(particle.roll.angle) : 1, pos.x, pos.y);
4679
+ } else {
4680
+ context.translate(pos.x, pos.y);
4681
+ }
4682
+ context.beginPath();
4683
+ const angle = ((_b = (_a = particle.rotate) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0) + (particle.options.rotate.path ? particle.velocity.angle : 0);
4684
+ if (angle !== 0) {
4685
+ context.rotate(angle);
4686
+ }
4687
+ if (backgroundMask) {
4688
+ context.globalCompositeOperation = composite;
4689
+ }
4690
+ const shadowColor = particle.shadowColor;
4691
+ if (shadow.enable && shadowColor) {
4692
+ context.shadowBlur = shadow.blur;
4693
+ context.shadowColor = getStyleFromRgb(shadowColor);
4694
+ context.shadowOffsetX = shadow.offset.x;
4695
+ context.shadowOffsetY = shadow.offset.y;
4696
+ }
4697
+ if (gradient) {
4698
+ const gradientAngle = gradient.angle.value;
4699
+ const fillGradient = gradient.type === "radial" ? context.createRadialGradient(0, 0, 0, 0, 0, radius) : context.createLinearGradient(Math.cos(gradientAngle) * -radius, Math.sin(gradientAngle) * -radius, Math.cos(gradientAngle) * radius, Math.sin(gradientAngle) * radius);
4700
+ for (const color of gradient.colors) {
4701
+ fillGradient.addColorStop(color.stop, getStyleFromHsl({
4702
+ h: color.value.h.value,
4703
+ s: color.value.s.value,
4704
+ l: color.value.l.value
4705
+ }, (_d = (_c = color.opacity) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : opacity));
4706
+ }
4707
+ context.fillStyle = fillGradient;
4708
+ } else {
4709
+ if (fillColorValue) {
4710
+ context.fillStyle = fillColorValue;
4711
+ }
4712
+ }
4713
+ const stroke = particle.stroke;
4714
+ context.lineWidth = (_e = particle.strokeWidth) !== null && _e !== void 0 ? _e : 0;
4715
+ if (strokeColorValue) {
4716
+ context.strokeStyle = strokeColorValue;
4717
+ }
4718
+ drawShape(container, context, particle, radius, opacity, delta);
4719
+ if (((_f = stroke === null || stroke === void 0 ? void 0 : stroke.width) !== null && _f !== void 0 ? _f : 0) > 0) {
4720
+ context.stroke();
4721
+ }
4722
+ if (particle.close) {
4723
+ context.closePath();
4724
+ }
4725
+ if (particle.fill) {
4726
+ context.fill();
4727
+ }
4728
+ context.restore();
4729
+ context.save();
4730
+ if (tiltOptions.enable && particle.tilt) {
4731
+ context.setTransform(1, Math.cos(particle.tilt.value) * particle.tilt.cosDirection, Math.sin(particle.tilt.value) * particle.tilt.sinDirection, 1, pos.x, pos.y);
4732
+ } else {
4733
+ context.translate(pos.x, pos.y);
4734
+ }
4735
+ if (angle !== 0) {
4736
+ context.rotate(angle);
4737
+ }
4738
+ if (backgroundMask) {
4739
+ context.globalCompositeOperation = composite;
4740
+ }
4741
+ drawShapeAfterEffect(container, context, particle, radius, opacity, delta);
4742
+ context.restore();
4743
+ }
4744
+ function drawShape(container, context, particle, radius, opacity, delta) {
4745
+ if (!particle.shape) {
4746
+ return;
4747
+ }
4748
+ const drawer = container.drawers.get(particle.shape);
4749
+ if (!drawer) {
4750
+ return;
4751
+ }
4752
+ drawer.draw(context, particle, radius, opacity, delta, container.retina.pixelRatio);
4753
+ }
4754
+ function drawShapeAfterEffect(container, context, particle, radius, opacity, delta) {
4755
+ if (!particle.shape) {
4756
+ return;
4757
+ }
4758
+ const drawer = container.drawers.get(particle.shape);
4759
+ if (!(drawer === null || drawer === void 0 ? void 0 : drawer.afterEffect)) {
4760
+ return;
4761
+ }
4762
+ drawer.afterEffect(context, particle, radius, opacity, delta, container.retina.pixelRatio);
4763
+ }
4764
+ function CanvasUtils_drawPlugin(context, plugin, delta) {
4765
+ if (!plugin.draw) {
4766
+ return;
4767
+ }
4768
+ context.save();
4769
+ plugin.draw(context, delta);
4770
+ context.restore();
4771
+ }
4772
+ function CanvasUtils_drawParticlePlugin(context, plugin, particle, delta) {
4773
+ if (plugin.drawParticle !== undefined) {
4774
+ context.save();
4775
+ plugin.drawParticle(context, particle, delta);
4776
+ context.restore();
4777
+ }
4778
+ }
4779
+ function drawEllipse(context, particle, fillColorValue, radius, opacity, width, rotation, start, end) {
4780
+ const pos = particle.getPosition();
4781
+ if (fillColorValue) {
4782
+ context.strokeStyle = getStyleFromHsl(fillColorValue, opacity);
4783
+ }
4784
+ if (width === 0) {
4785
+ return;
4786
+ }
4787
+ context.lineWidth = width;
4788
+ const rotationRadian = rotation * Math.PI / 180;
4789
+ context.beginPath();
4790
+ context.ellipse(pos.x, pos.y, radius / 2, radius * 2, rotationRadian, start, end);
4791
+ context.stroke();
4792
+ }
4793
+ function CanvasUtils_alterHsl(color, type, value) {
4794
+ return {
4795
+ h: color.h,
4796
+ s: color.s,
4797
+ l: color.l + (type === "darken" ? -1 : 1) * value
4798
+ };
4799
+ }
4800
+ function checkDestroy(particle, value, minValue, maxValue) {
4801
+ switch (particle.options.size.animation.destroy) {
4802
+ case "max":
4803
+ if (value >= maxValue) {
4804
+ particle.destroy();
4805
+ }
4806
+ break;
4807
+
4808
+ case "min":
4809
+ if (value <= minValue) {
4810
+ particle.destroy();
4811
+ }
4812
+ break;
4813
+ }
4814
+ }
4815
+ function updateSize(particle, delta) {
4816
+ var _a, _b, _c, _d;
4817
+ const sizeVelocity = ((_a = particle.size.velocity) !== null && _a !== void 0 ? _a : 0) * delta.factor;
4818
+ const minValue = particle.size.min;
4819
+ const maxValue = particle.size.max;
4820
+ if (!(!particle.destroyed && particle.size.enable && (((_b = particle.size.loops) !== null && _b !== void 0 ? _b : 0) <= 0 || ((_c = particle.size.loops) !== null && _c !== void 0 ? _c : 0) < ((_d = particle.size.maxLoops) !== null && _d !== void 0 ? _d : 0)))) {
4821
+ return;
4822
+ }
4823
+ switch (particle.size.status) {
4824
+ case 0:
4825
+ if (particle.size.value >= maxValue) {
4826
+ particle.size.status = 1;
4827
+ if (!particle.size.loops) {
4828
+ particle.size.loops = 0;
4829
+ }
4830
+ particle.size.loops++;
4831
+ } else {
4832
+ particle.size.value += sizeVelocity;
4833
+ }
4834
+ break;
4835
+
4836
+ case 1:
4837
+ if (particle.size.value <= minValue) {
4838
+ particle.size.status = 0;
4839
+ if (!particle.size.loops) {
4840
+ particle.size.loops = 0;
4841
+ }
4842
+ particle.size.loops++;
4843
+ } else {
4844
+ particle.size.value -= sizeVelocity;
4845
+ }
4846
+ }
4847
+ checkDestroy(particle, particle.size.value, minValue, maxValue);
4848
+ if (!particle.destroyed) {
4849
+ particle.size.value = NumberUtils_clamp(particle.size.value, minValue, maxValue);
4850
+ }
4851
+ }
4852
+ class SizeUpdater {
4853
+ init() {}
4854
+ isEnabled(particle) {
4855
+ var _a, _b, _c;
4856
+ return !particle.destroyed && !particle.spawning && particle.size.enable && (((_a = particle.size.loops) !== null && _a !== void 0 ? _a : 0) <= 0 || ((_b = particle.size.loops) !== null && _b !== void 0 ? _b : 0) < ((_c = particle.size.maxLoops) !== null && _c !== void 0 ? _c : 0));
4857
+ }
4858
+ update(particle, delta) {
4859
+ if (!this.isEnabled(particle)) {
4860
+ return;
4861
+ }
4862
+ updateSize(particle, delta);
4863
+ }
4864
+ }
4865
+ async function loadSizeUpdater(engine) {
4866
+ await engine.addParticleUpdater("size", (() => new SizeUpdater));
4867
+ }
4868
+ return __webpack_exports__;
4869
+ }();
4870
+ }));