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