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,4997 @@
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
+ loadExternalBounceInteraction: function() {
43
+ return loadExternalBounceInteraction;
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 collisionVelocity(v1, v2, m1, m2) {
141
+ return Vector_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_Vector.create(NumberUtils_getValue(p.options.bounce.horizontal), NumberUtils_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} = NumberUtils_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, NumberUtils_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, NumberUtils_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 Range {
1094
+ constructor(x, y) {
1095
+ this.position = {
1096
+ x: x,
1097
+ y: y
1098
+ };
1099
+ }
1100
+ }
1101
+ class Circle_Circle extends Range {
1102
+ constructor(x, y, radius) {
1103
+ super(x, y);
1104
+ this.radius = radius;
1105
+ }
1106
+ contains(point) {
1107
+ return NumberUtils_getDistance(point, this.position) <= this.radius;
1108
+ }
1109
+ intersects(range) {
1110
+ const rect = range;
1111
+ const circle = range;
1112
+ const pos1 = this.position;
1113
+ const pos2 = range.position;
1114
+ const xDist = Math.abs(pos2.x - pos1.x);
1115
+ const yDist = Math.abs(pos2.y - pos1.y);
1116
+ const r = this.radius;
1117
+ if (circle.radius !== undefined) {
1118
+ const rSum = r + circle.radius;
1119
+ const dist = Math.sqrt(xDist * xDist + yDist + yDist);
1120
+ return rSum > dist;
1121
+ } else if (rect.size !== undefined) {
1122
+ const w = rect.size.width;
1123
+ const h = rect.size.height;
1124
+ const edges = Math.pow(xDist - w, 2) + Math.pow(yDist - h, 2);
1125
+ if (xDist > r + w || yDist > r + h) {
1126
+ return false;
1127
+ }
1128
+ if (xDist <= w || yDist <= h) {
1129
+ return true;
1130
+ }
1131
+ return edges <= r * r;
1132
+ }
1133
+ return false;
1134
+ }
1135
+ }
1136
+ class CircleWarp_CircleWarp extends(null && Circle){
1137
+ constructor(x, y, radius, canvasSize) {
1138
+ super(x, y, radius);
1139
+ this.canvasSize = canvasSize;
1140
+ this.canvasSize = {
1141
+ height: canvasSize.height,
1142
+ width: canvasSize.width
1143
+ };
1144
+ }
1145
+ contains(point) {
1146
+ if (super.contains(point)) {
1147
+ return true;
1148
+ }
1149
+ const posNE = {
1150
+ x: point.x - this.canvasSize.width,
1151
+ y: point.y
1152
+ };
1153
+ if (super.contains(posNE)) {
1154
+ return true;
1155
+ }
1156
+ const posSE = {
1157
+ x: point.x - this.canvasSize.width,
1158
+ y: point.y - this.canvasSize.height
1159
+ };
1160
+ if (super.contains(posSE)) {
1161
+ return true;
1162
+ }
1163
+ const posSW = {
1164
+ x: point.x,
1165
+ y: point.y - this.canvasSize.height
1166
+ };
1167
+ return super.contains(posSW);
1168
+ }
1169
+ intersects(range) {
1170
+ if (super.intersects(range)) {
1171
+ return true;
1172
+ }
1173
+ const rect = range;
1174
+ const circle = range;
1175
+ const newPos = {
1176
+ x: range.position.x - this.canvasSize.width,
1177
+ y: range.position.y - this.canvasSize.height
1178
+ };
1179
+ if (circle.radius !== undefined) {
1180
+ const biggerCircle = new Circle(newPos.x, newPos.y, circle.radius * 2);
1181
+ return super.intersects(biggerCircle);
1182
+ } else if (rect.size !== undefined) {
1183
+ const rectSW = new Rectangle(newPos.x, newPos.y, rect.size.width * 2, rect.size.height * 2);
1184
+ return super.intersects(rectSW);
1185
+ }
1186
+ return false;
1187
+ }
1188
+ }
1189
+ class Constants_Constants {}
1190
+ Constants_Constants.generatedAttribute = "generated";
1191
+ Constants_Constants.randomColorValue = "random";
1192
+ Constants_Constants.midColorValue = "mid";
1193
+ Constants_Constants.touchEndEvent = "touchend";
1194
+ Constants_Constants.mouseDownEvent = "mousedown";
1195
+ Constants_Constants.mouseUpEvent = "mouseup";
1196
+ Constants_Constants.mouseMoveEvent = "mousemove";
1197
+ Constants_Constants.touchStartEvent = "touchstart";
1198
+ Constants_Constants.touchMoveEvent = "touchmove";
1199
+ Constants_Constants.mouseLeaveEvent = "mouseleave";
1200
+ Constants_Constants.mouseOutEvent = "mouseout";
1201
+ Constants_Constants.touchCancelEvent = "touchcancel";
1202
+ Constants_Constants.resizeEvent = "resize";
1203
+ Constants_Constants.visibilityChangeEvent = "visibilitychange";
1204
+ Constants_Constants.noPolygonDataLoaded = "No polygon data loaded.";
1205
+ Constants_Constants.noPolygonFound = "No polygon found, you need to specify SVG url in config.";
1206
+ function manageListener(element, event, handler, add, options) {
1207
+ if (add) {
1208
+ let addOptions = {
1209
+ passive: true
1210
+ };
1211
+ if (typeof options === "boolean") {
1212
+ addOptions.capture = options;
1213
+ } else if (options !== undefined) {
1214
+ addOptions = options;
1215
+ }
1216
+ element.addEventListener(event, handler, addOptions);
1217
+ } else {
1218
+ const removeOptions = options;
1219
+ element.removeEventListener(event, handler, removeOptions);
1220
+ }
1221
+ }
1222
+ class EventListeners_EventListeners {
1223
+ constructor(container) {
1224
+ this.container = container;
1225
+ this.canPush = true;
1226
+ this.mouseMoveHandler = e => this.mouseTouchMove(e);
1227
+ this.touchStartHandler = e => this.mouseTouchMove(e);
1228
+ this.touchMoveHandler = e => this.mouseTouchMove(e);
1229
+ this.touchEndHandler = () => this.mouseTouchFinish();
1230
+ this.mouseLeaveHandler = () => this.mouseTouchFinish();
1231
+ this.touchCancelHandler = () => this.mouseTouchFinish();
1232
+ this.touchEndClickHandler = e => this.mouseTouchClick(e);
1233
+ this.mouseUpHandler = e => this.mouseTouchClick(e);
1234
+ this.mouseDownHandler = () => this.mouseDown();
1235
+ this.visibilityChangeHandler = () => this.handleVisibilityChange();
1236
+ this.themeChangeHandler = e => this.handleThemeChange(e);
1237
+ this.oldThemeChangeHandler = e => this.handleThemeChange(e);
1238
+ this.resizeHandler = () => this.handleWindowResize();
1239
+ }
1240
+ addListeners() {
1241
+ this.manageListeners(true);
1242
+ }
1243
+ removeListeners() {
1244
+ this.manageListeners(false);
1245
+ }
1246
+ manageListeners(add) {
1247
+ var _a;
1248
+ const container = this.container;
1249
+ const options = container.actualOptions;
1250
+ const detectType = options.interactivity.detectsOn;
1251
+ let mouseLeaveEvent = Constants.mouseLeaveEvent;
1252
+ if (detectType === "window") {
1253
+ container.interactivity.element = window;
1254
+ mouseLeaveEvent = Constants.mouseOutEvent;
1255
+ } else if (detectType === "parent" && container.canvas.element) {
1256
+ const canvasEl = container.canvas.element;
1257
+ container.interactivity.element = (_a = canvasEl.parentElement) !== null && _a !== void 0 ? _a : canvasEl.parentNode;
1258
+ } else {
1259
+ container.interactivity.element = container.canvas.element;
1260
+ }
1261
+ const mediaMatch = !isSsr() && typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)");
1262
+ if (mediaMatch) {
1263
+ if (mediaMatch.addEventListener !== undefined) {
1264
+ manageListener(mediaMatch, "change", this.themeChangeHandler, add);
1265
+ } else if (mediaMatch.addListener !== undefined) {
1266
+ if (add) {
1267
+ mediaMatch.addListener(this.oldThemeChangeHandler);
1268
+ } else {
1269
+ mediaMatch.removeListener(this.oldThemeChangeHandler);
1270
+ }
1271
+ }
1272
+ }
1273
+ const interactivityEl = container.interactivity.element;
1274
+ if (!interactivityEl) {
1275
+ return;
1276
+ }
1277
+ const html = interactivityEl;
1278
+ if (options.interactivity.events.onHover.enable || options.interactivity.events.onClick.enable) {
1279
+ manageListener(interactivityEl, Constants.mouseMoveEvent, this.mouseMoveHandler, add);
1280
+ manageListener(interactivityEl, Constants.touchStartEvent, this.touchStartHandler, add);
1281
+ manageListener(interactivityEl, Constants.touchMoveEvent, this.touchMoveHandler, add);
1282
+ if (!options.interactivity.events.onClick.enable) {
1283
+ manageListener(interactivityEl, Constants.touchEndEvent, this.touchEndHandler, add);
1284
+ } else {
1285
+ manageListener(interactivityEl, Constants.touchEndEvent, this.touchEndClickHandler, add);
1286
+ manageListener(interactivityEl, Constants.mouseUpEvent, this.mouseUpHandler, add);
1287
+ manageListener(interactivityEl, Constants.mouseDownEvent, this.mouseDownHandler, add);
1288
+ }
1289
+ manageListener(interactivityEl, mouseLeaveEvent, this.mouseLeaveHandler, add);
1290
+ manageListener(interactivityEl, Constants.touchCancelEvent, this.touchCancelHandler, add);
1291
+ }
1292
+ if (container.canvas.element) {
1293
+ container.canvas.element.style.pointerEvents = html === container.canvas.element ? "initial" : "none";
1294
+ }
1295
+ if (options.interactivity.events.resize) {
1296
+ if (typeof ResizeObserver !== "undefined") {
1297
+ if (this.resizeObserver && !add) {
1298
+ if (container.canvas.element) {
1299
+ this.resizeObserver.unobserve(container.canvas.element);
1300
+ }
1301
+ this.resizeObserver.disconnect();
1302
+ delete this.resizeObserver;
1303
+ } else if (!this.resizeObserver && add && container.canvas.element) {
1304
+ this.resizeObserver = new ResizeObserver((entries => {
1305
+ const entry = entries.find((e => e.target === container.canvas.element));
1306
+ if (!entry) {
1307
+ return;
1308
+ }
1309
+ this.handleWindowResize();
1310
+ }));
1311
+ this.resizeObserver.observe(container.canvas.element);
1312
+ }
1313
+ } else {
1314
+ manageListener(window, Constants.resizeEvent, this.resizeHandler, add);
1315
+ }
1316
+ }
1317
+ if (document) {
1318
+ manageListener(document, Constants.visibilityChangeEvent, this.visibilityChangeHandler, add, false);
1319
+ }
1320
+ }
1321
+ handleWindowResize() {
1322
+ if (this.resizeTimeout) {
1323
+ clearTimeout(this.resizeTimeout);
1324
+ delete this.resizeTimeout;
1325
+ }
1326
+ this.resizeTimeout = setTimeout((async () => {
1327
+ var _a;
1328
+ return await ((_a = this.container.canvas) === null || _a === void 0 ? void 0 : _a.windowResize());
1329
+ }), 500);
1330
+ }
1331
+ handleVisibilityChange() {
1332
+ const container = this.container;
1333
+ const options = container.actualOptions;
1334
+ this.mouseTouchFinish();
1335
+ if (!options.pauseOnBlur) {
1336
+ return;
1337
+ }
1338
+ if (document === null || document === void 0 ? void 0 : document.hidden) {
1339
+ container.pageHidden = true;
1340
+ container.pause();
1341
+ } else {
1342
+ container.pageHidden = false;
1343
+ if (container.getAnimationStatus()) {
1344
+ container.play(true);
1345
+ } else {
1346
+ container.draw(true);
1347
+ }
1348
+ }
1349
+ }
1350
+ mouseDown() {
1351
+ const interactivity = this.container.interactivity;
1352
+ if (interactivity) {
1353
+ const mouse = interactivity.mouse;
1354
+ mouse.clicking = true;
1355
+ mouse.downPosition = mouse.position;
1356
+ }
1357
+ }
1358
+ mouseTouchMove(e) {
1359
+ var _a, _b, _c, _d, _e, _f, _g;
1360
+ const container = this.container;
1361
+ const options = container.actualOptions;
1362
+ if (((_a = container.interactivity) === null || _a === void 0 ? void 0 : _a.element) === undefined) {
1363
+ return;
1364
+ }
1365
+ container.interactivity.mouse.inside = true;
1366
+ let pos;
1367
+ const canvas = container.canvas.element;
1368
+ if (e.type.startsWith("mouse")) {
1369
+ this.canPush = true;
1370
+ const mouseEvent = e;
1371
+ if (container.interactivity.element === window) {
1372
+ if (canvas) {
1373
+ const clientRect = canvas.getBoundingClientRect();
1374
+ pos = {
1375
+ x: mouseEvent.clientX - clientRect.left,
1376
+ y: mouseEvent.clientY - clientRect.top
1377
+ };
1378
+ }
1379
+ } else if (options.interactivity.detectsOn === "parent") {
1380
+ const source = mouseEvent.target;
1381
+ const target = mouseEvent.currentTarget;
1382
+ const canvasEl = container.canvas.element;
1383
+ if (source && target && canvasEl) {
1384
+ const sourceRect = source.getBoundingClientRect();
1385
+ const targetRect = target.getBoundingClientRect();
1386
+ const canvasRect = canvasEl.getBoundingClientRect();
1387
+ pos = {
1388
+ x: mouseEvent.offsetX + 2 * sourceRect.left - (targetRect.left + canvasRect.left),
1389
+ y: mouseEvent.offsetY + 2 * sourceRect.top - (targetRect.top + canvasRect.top)
1390
+ };
1391
+ } else {
1392
+ pos = {
1393
+ x: (_b = mouseEvent.offsetX) !== null && _b !== void 0 ? _b : mouseEvent.clientX,
1394
+ y: (_c = mouseEvent.offsetY) !== null && _c !== void 0 ? _c : mouseEvent.clientY
1395
+ };
1396
+ }
1397
+ } else {
1398
+ if (mouseEvent.target === container.canvas.element) {
1399
+ pos = {
1400
+ x: (_d = mouseEvent.offsetX) !== null && _d !== void 0 ? _d : mouseEvent.clientX,
1401
+ y: (_e = mouseEvent.offsetY) !== null && _e !== void 0 ? _e : mouseEvent.clientY
1402
+ };
1403
+ }
1404
+ }
1405
+ } else {
1406
+ this.canPush = e.type !== "touchmove";
1407
+ const touchEvent = e;
1408
+ const lastTouch = touchEvent.touches[touchEvent.touches.length - 1];
1409
+ const canvasRect = canvas === null || canvas === void 0 ? void 0 : canvas.getBoundingClientRect();
1410
+ pos = {
1411
+ x: lastTouch.clientX - ((_f = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.left) !== null && _f !== void 0 ? _f : 0),
1412
+ y: lastTouch.clientY - ((_g = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.top) !== null && _g !== void 0 ? _g : 0)
1413
+ };
1414
+ }
1415
+ const pxRatio = container.retina.pixelRatio;
1416
+ if (pos) {
1417
+ pos.x *= pxRatio;
1418
+ pos.y *= pxRatio;
1419
+ }
1420
+ container.interactivity.mouse.position = pos;
1421
+ container.interactivity.status = Constants.mouseMoveEvent;
1422
+ }
1423
+ mouseTouchFinish() {
1424
+ const interactivity = this.container.interactivity;
1425
+ if (interactivity === undefined) {
1426
+ return;
1427
+ }
1428
+ const mouse = interactivity.mouse;
1429
+ delete mouse.position;
1430
+ delete mouse.clickPosition;
1431
+ delete mouse.downPosition;
1432
+ interactivity.status = Constants.mouseLeaveEvent;
1433
+ mouse.inside = false;
1434
+ mouse.clicking = false;
1435
+ }
1436
+ mouseTouchClick(e) {
1437
+ const container = this.container;
1438
+ const options = container.actualOptions;
1439
+ const mouse = container.interactivity.mouse;
1440
+ mouse.inside = true;
1441
+ let handled = false;
1442
+ const mousePosition = mouse.position;
1443
+ if (mousePosition === undefined || !options.interactivity.events.onClick.enable) {
1444
+ return;
1445
+ }
1446
+ for (const [, plugin] of container.plugins) {
1447
+ if (plugin.clickPositionValid !== undefined) {
1448
+ handled = plugin.clickPositionValid(mousePosition);
1449
+ if (handled) {
1450
+ break;
1451
+ }
1452
+ }
1453
+ }
1454
+ if (!handled) {
1455
+ this.doMouseTouchClick(e);
1456
+ }
1457
+ mouse.clicking = false;
1458
+ }
1459
+ doMouseTouchClick(e) {
1460
+ const container = this.container;
1461
+ const options = container.actualOptions;
1462
+ if (this.canPush) {
1463
+ const mousePos = container.interactivity.mouse.position;
1464
+ if (mousePos) {
1465
+ container.interactivity.mouse.clickPosition = {
1466
+ x: mousePos.x,
1467
+ y: mousePos.y
1468
+ };
1469
+ } else {
1470
+ return;
1471
+ }
1472
+ container.interactivity.mouse.clickTime = (new Date).getTime();
1473
+ const onClick = options.interactivity.events.onClick;
1474
+ if (onClick.mode instanceof Array) {
1475
+ for (const mode of onClick.mode) {
1476
+ this.handleClickMode(mode);
1477
+ }
1478
+ } else {
1479
+ this.handleClickMode(onClick.mode);
1480
+ }
1481
+ }
1482
+ if (e.type === "touchend") {
1483
+ setTimeout((() => this.mouseTouchFinish()), 500);
1484
+ }
1485
+ }
1486
+ handleThemeChange(e) {
1487
+ const mediaEvent = e;
1488
+ const themeName = mediaEvent.matches ? this.container.options.defaultDarkTheme : this.container.options.defaultLightTheme;
1489
+ const theme = this.container.options.themes.find((theme => theme.name === themeName));
1490
+ if (theme && theme.default.auto) {
1491
+ this.container.loadTheme(themeName);
1492
+ }
1493
+ }
1494
+ handleClickMode(mode) {
1495
+ const container = this.container;
1496
+ const options = container.actualOptions;
1497
+ const pushNb = options.interactivity.modes.push.quantity;
1498
+ const removeNb = options.interactivity.modes.remove.quantity;
1499
+ switch (mode) {
1500
+ case "push":
1501
+ {
1502
+ if (pushNb > 0) {
1503
+ const pushOptions = options.interactivity.modes.push;
1504
+ const group = itemFromArray([ undefined, ...pushOptions.groups ]);
1505
+ const groupOptions = group !== undefined ? container.actualOptions.particles.groups[group] : undefined;
1506
+ container.particles.push(pushNb, container.interactivity.mouse, groupOptions, group);
1507
+ }
1508
+ break;
1509
+ }
1510
+
1511
+ case "remove":
1512
+ container.particles.removeQuantity(removeNb);
1513
+ break;
1514
+
1515
+ case "bubble":
1516
+ container.bubble.clicking = true;
1517
+ break;
1518
+
1519
+ case "repulse":
1520
+ container.repulse.clicking = true;
1521
+ container.repulse.count = 0;
1522
+ for (const particle of container.repulse.particles) {
1523
+ particle.velocity.setTo(particle.initialVelocity);
1524
+ }
1525
+ container.repulse.particles = [];
1526
+ container.repulse.finish = false;
1527
+ setTimeout((() => {
1528
+ if (!container.destroyed) {
1529
+ container.repulse.clicking = false;
1530
+ }
1531
+ }), options.interactivity.modes.repulse.duration * 1e3);
1532
+ break;
1533
+
1534
+ case "attract":
1535
+ container.attract.clicking = true;
1536
+ container.attract.count = 0;
1537
+ for (const particle of container.attract.particles) {
1538
+ particle.velocity.setTo(particle.initialVelocity);
1539
+ }
1540
+ container.attract.particles = [];
1541
+ container.attract.finish = false;
1542
+ setTimeout((() => {
1543
+ if (!container.destroyed) {
1544
+ container.attract.clicking = false;
1545
+ }
1546
+ }), options.interactivity.modes.attract.duration * 1e3);
1547
+ break;
1548
+
1549
+ case "pause":
1550
+ if (container.getAnimationStatus()) {
1551
+ container.pause();
1552
+ } else {
1553
+ container.play();
1554
+ }
1555
+ break;
1556
+ }
1557
+ for (const [, plugin] of container.plugins) {
1558
+ if (plugin.handleClickMode) {
1559
+ plugin.handleClickMode(mode);
1560
+ }
1561
+ }
1562
+ }
1563
+ }
1564
+ class ExternalInteractorBase {
1565
+ constructor(container) {
1566
+ this.container = container;
1567
+ this.type = 0;
1568
+ }
1569
+ }
1570
+ class InteractionManager_InteractionManager {
1571
+ constructor(container) {
1572
+ this.container = container;
1573
+ this.externalInteractors = [];
1574
+ this.particleInteractors = [];
1575
+ this.init();
1576
+ }
1577
+ init() {
1578
+ const interactors = Plugins.getInteractors(this.container, true);
1579
+ for (const interactor of interactors) {
1580
+ switch (interactor.type) {
1581
+ case 0:
1582
+ this.externalInteractors.push(interactor);
1583
+ break;
1584
+
1585
+ case 1:
1586
+ this.particleInteractors.push(interactor);
1587
+ break;
1588
+ }
1589
+ }
1590
+ }
1591
+ externalInteract(delta) {
1592
+ for (const interactor of this.externalInteractors) {
1593
+ if (interactor.isEnabled()) {
1594
+ interactor.interact(delta);
1595
+ }
1596
+ }
1597
+ }
1598
+ particlesInteract(particle, delta) {
1599
+ for (const interactor of this.externalInteractors) {
1600
+ interactor.reset(particle);
1601
+ }
1602
+ for (const interactor of this.particleInteractors) {
1603
+ if (interactor.isEnabled(particle)) {
1604
+ interactor.interact(particle, delta);
1605
+ }
1606
+ }
1607
+ }
1608
+ }
1609
+ function applyDistance(particle) {
1610
+ const initialPosition = particle.initialPosition;
1611
+ const {dx: dx, dy: dy} = getDistances(initialPosition, particle.position);
1612
+ const dxFixed = Math.abs(dx), dyFixed = Math.abs(dy);
1613
+ const hDistance = particle.retina.maxDistance.horizontal;
1614
+ const vDistance = particle.retina.maxDistance.vertical;
1615
+ if (!hDistance && !vDistance) {
1616
+ return;
1617
+ }
1618
+ if ((hDistance && dxFixed >= hDistance || vDistance && dyFixed >= vDistance) && !particle.misplaced) {
1619
+ particle.misplaced = !!hDistance && dxFixed > hDistance || !!vDistance && dyFixed > vDistance;
1620
+ if (hDistance) {
1621
+ particle.velocity.x = particle.velocity.y / 2 - particle.velocity.x;
1622
+ }
1623
+ if (vDistance) {
1624
+ particle.velocity.y = particle.velocity.x / 2 - particle.velocity.y;
1625
+ }
1626
+ } else if ((!hDistance || dxFixed < hDistance) && (!vDistance || dyFixed < vDistance) && particle.misplaced) {
1627
+ particle.misplaced = false;
1628
+ } else if (particle.misplaced) {
1629
+ const pos = particle.position, vel = particle.velocity;
1630
+ if (hDistance && (pos.x < initialPosition.x && vel.x < 0 || pos.x > initialPosition.x && vel.x > 0)) {
1631
+ vel.x *= -Math.random();
1632
+ }
1633
+ if (vDistance && (pos.y < initialPosition.y && vel.y < 0 || pos.y > initialPosition.y && vel.y > 0)) {
1634
+ vel.y *= -Math.random();
1635
+ }
1636
+ }
1637
+ }
1638
+ class ParticlesMover_ParticlesMover {
1639
+ constructor(container) {
1640
+ this.container = container;
1641
+ }
1642
+ move(particle, delta) {
1643
+ if (particle.destroyed) {
1644
+ return;
1645
+ }
1646
+ this.moveParticle(particle, delta);
1647
+ this.moveParallax(particle);
1648
+ }
1649
+ moveParticle(particle, delta) {
1650
+ var _a, _b, _c;
1651
+ var _d, _e;
1652
+ const particleOptions = particle.options;
1653
+ const moveOptions = particleOptions.move;
1654
+ if (!moveOptions.enable) {
1655
+ return;
1656
+ }
1657
+ 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;
1658
+ this.applyPath(particle, delta);
1659
+ const gravityOptions = moveOptions.gravity;
1660
+ const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
1661
+ if (gravityOptions.enable && moveSpeed) {
1662
+ particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
1663
+ }
1664
+ if (moveDrift && moveSpeed) {
1665
+ particle.velocity.x += moveDrift * delta.factor / (60 * moveSpeed);
1666
+ }
1667
+ const decay = particle.moveDecay;
1668
+ if (decay != 1) {
1669
+ particle.velocity.multTo(decay);
1670
+ }
1671
+ const velocity = particle.velocity.mult(moveSpeed);
1672
+ const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
1673
+ if (gravityOptions.enable && gravityOptions.maxSpeed > 0 && (!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed)) {
1674
+ velocity.y = gravityFactor * maxSpeed;
1675
+ if (moveSpeed) {
1676
+ particle.velocity.y = velocity.y / moveSpeed;
1677
+ }
1678
+ }
1679
+ const zIndexOptions = particle.options.zIndex, zVelocityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.velocityRate;
1680
+ if (moveOptions.spin.enable) {
1681
+ this.spin(particle, moveSpeed);
1682
+ } else {
1683
+ if (zVelocityFactor != 1) {
1684
+ velocity.multTo(zVelocityFactor);
1685
+ }
1686
+ particle.position.addTo(velocity);
1687
+ if (moveOptions.vibrate) {
1688
+ particle.position.x += Math.sin(particle.position.x * Math.cos(particle.position.y));
1689
+ particle.position.y += Math.cos(particle.position.y * Math.sin(particle.position.x));
1690
+ }
1691
+ }
1692
+ applyDistance(particle);
1693
+ }
1694
+ spin(particle, moveSpeed) {
1695
+ const container = this.container;
1696
+ if (!particle.spin) {
1697
+ return;
1698
+ }
1699
+ const updateFunc = {
1700
+ x: particle.spin.direction === "clockwise" ? Math.cos : Math.sin,
1701
+ y: particle.spin.direction === "clockwise" ? Math.sin : Math.cos
1702
+ };
1703
+ particle.position.x = particle.spin.center.x + particle.spin.radius * updateFunc.x(particle.spin.angle);
1704
+ particle.position.y = particle.spin.center.y + particle.spin.radius * updateFunc.y(particle.spin.angle);
1705
+ particle.spin.radius += particle.spin.acceleration;
1706
+ const maxCanvasSize = Math.max(container.canvas.size.width, container.canvas.size.height);
1707
+ if (particle.spin.radius > maxCanvasSize / 2) {
1708
+ particle.spin.radius = maxCanvasSize / 2;
1709
+ particle.spin.acceleration *= -1;
1710
+ } else if (particle.spin.radius < 0) {
1711
+ particle.spin.radius = 0;
1712
+ particle.spin.acceleration *= -1;
1713
+ }
1714
+ particle.spin.angle += moveSpeed / 100 * (1 - particle.spin.radius / maxCanvasSize);
1715
+ }
1716
+ applyPath(particle, delta) {
1717
+ const particlesOptions = particle.options;
1718
+ const pathOptions = particlesOptions.move.path;
1719
+ const pathEnabled = pathOptions.enable;
1720
+ if (!pathEnabled) {
1721
+ return;
1722
+ }
1723
+ const container = this.container;
1724
+ if (particle.lastPathTime <= particle.pathDelay) {
1725
+ particle.lastPathTime += delta.value;
1726
+ return;
1727
+ }
1728
+ const path = container.pathGenerator.generate(particle);
1729
+ particle.velocity.addTo(path);
1730
+ if (pathOptions.clamp) {
1731
+ particle.velocity.x = clamp(particle.velocity.x, -1, 1);
1732
+ particle.velocity.y = clamp(particle.velocity.y, -1, 1);
1733
+ }
1734
+ particle.lastPathTime -= particle.pathDelay;
1735
+ }
1736
+ moveParallax(particle) {
1737
+ const container = this.container;
1738
+ const options = container.actualOptions;
1739
+ if (isSsr() || !options.interactivity.events.onHover.parallax.enable) {
1740
+ return;
1741
+ }
1742
+ const parallaxForce = options.interactivity.events.onHover.parallax.force;
1743
+ const mousePos = container.interactivity.mouse.position;
1744
+ if (!mousePos) {
1745
+ return;
1746
+ }
1747
+ const canvasCenter = {
1748
+ x: container.canvas.size.width / 2,
1749
+ y: container.canvas.size.height / 2
1750
+ };
1751
+ const parallaxSmooth = options.interactivity.events.onHover.parallax.smooth;
1752
+ const factor = particle.getRadius() / parallaxForce;
1753
+ const tmp = {
1754
+ x: (mousePos.x - canvasCenter.x) * factor,
1755
+ y: (mousePos.y - canvasCenter.y) * factor
1756
+ };
1757
+ particle.offset.x += (tmp.x - particle.offset.x) / parallaxSmooth;
1758
+ particle.offset.y += (tmp.y - particle.offset.y) / parallaxSmooth;
1759
+ }
1760
+ getProximitySpeedFactor(particle) {
1761
+ const container = this.container;
1762
+ const options = container.actualOptions;
1763
+ const active = isInArray("slow", options.interactivity.events.onHover.mode);
1764
+ if (!active) {
1765
+ return 1;
1766
+ }
1767
+ const mousePos = this.container.interactivity.mouse.position;
1768
+ if (!mousePos) {
1769
+ return 1;
1770
+ }
1771
+ const particlePos = particle.getPosition();
1772
+ const dist = getDistance(mousePos, particlePos);
1773
+ const radius = container.retina.slowModeRadius;
1774
+ if (dist > radius) {
1775
+ return 1;
1776
+ }
1777
+ const proximityFactor = dist / radius || 0;
1778
+ const slowFactor = options.interactivity.modes.slow.factor;
1779
+ return proximityFactor / slowFactor;
1780
+ }
1781
+ }
1782
+ const plugins = null && [];
1783
+ const interactorsInitializers = new Map;
1784
+ const updatersInitializers = new Map;
1785
+ const interactors = new Map;
1786
+ const updaters = new Map;
1787
+ const presets = new Map;
1788
+ const drawers = new Map;
1789
+ const pathGenerators = new Map;
1790
+ class Plugins_Plugins {
1791
+ static getPlugin(plugin) {
1792
+ return plugins.find((t => t.id === plugin));
1793
+ }
1794
+ static addPlugin(plugin) {
1795
+ if (!Plugins_Plugins.getPlugin(plugin.id)) {
1796
+ plugins.push(plugin);
1797
+ }
1798
+ }
1799
+ static getAvailablePlugins(container) {
1800
+ const res = new Map;
1801
+ for (const plugin of plugins) {
1802
+ if (!plugin.needsPlugin(container.actualOptions)) {
1803
+ continue;
1804
+ }
1805
+ res.set(plugin.id, plugin.getPlugin(container));
1806
+ }
1807
+ return res;
1808
+ }
1809
+ static loadOptions(options, sourceOptions) {
1810
+ for (const plugin of plugins) {
1811
+ plugin.loadOptions(options, sourceOptions);
1812
+ }
1813
+ }
1814
+ static getPreset(preset) {
1815
+ return presets.get(preset);
1816
+ }
1817
+ static addPreset(presetKey, options, override = false) {
1818
+ if (override || !Plugins_Plugins.getPreset(presetKey)) {
1819
+ presets.set(presetKey, options);
1820
+ }
1821
+ }
1822
+ static addShapeDrawer(type, drawer) {
1823
+ if (!Plugins_Plugins.getShapeDrawer(type)) {
1824
+ drawers.set(type, drawer);
1825
+ }
1826
+ }
1827
+ static getShapeDrawer(type) {
1828
+ return drawers.get(type);
1829
+ }
1830
+ static getSupportedShapes() {
1831
+ return drawers.keys();
1832
+ }
1833
+ static getPathGenerator(type) {
1834
+ return pathGenerators.get(type);
1835
+ }
1836
+ static addPathGenerator(type, pathGenerator) {
1837
+ if (!Plugins_Plugins.getPathGenerator(type)) {
1838
+ pathGenerators.set(type, pathGenerator);
1839
+ }
1840
+ }
1841
+ static getInteractors(container, force = false) {
1842
+ let res = interactors.get(container);
1843
+ if (!res || force) {
1844
+ res = [ ...interactorsInitializers.values() ].map((t => t(container)));
1845
+ interactors.set(container, res);
1846
+ }
1847
+ return res;
1848
+ }
1849
+ static addInteractor(name, initInteractor) {
1850
+ interactorsInitializers.set(name, initInteractor);
1851
+ }
1852
+ static getUpdaters(container, force = false) {
1853
+ let res = updaters.get(container);
1854
+ if (!res || force) {
1855
+ res = [ ...updatersInitializers.values() ].map((t => t(container)));
1856
+ updaters.set(container, res);
1857
+ }
1858
+ return res;
1859
+ }
1860
+ static addParticleUpdater(name, initUpdater) {
1861
+ updatersInitializers.set(name, initUpdater);
1862
+ }
1863
+ }
1864
+ class QuadTree_QuadTree {
1865
+ constructor(rectangle, capacity) {
1866
+ this.rectangle = rectangle;
1867
+ this.capacity = capacity;
1868
+ this.points = [];
1869
+ this.divided = false;
1870
+ }
1871
+ subdivide() {
1872
+ const x = this.rectangle.position.x;
1873
+ const y = this.rectangle.position.y;
1874
+ const w = this.rectangle.size.width;
1875
+ const h = this.rectangle.size.height;
1876
+ const capacity = this.capacity;
1877
+ this.northEast = new QuadTree_QuadTree(new Rectangle(x, y, w / 2, h / 2), capacity);
1878
+ this.northWest = new QuadTree_QuadTree(new Rectangle(x + w / 2, y, w / 2, h / 2), capacity);
1879
+ this.southEast = new QuadTree_QuadTree(new Rectangle(x, y + h / 2, w / 2, h / 2), capacity);
1880
+ this.southWest = new QuadTree_QuadTree(new Rectangle(x + w / 2, y + h / 2, w / 2, h / 2), capacity);
1881
+ this.divided = true;
1882
+ }
1883
+ insert(point) {
1884
+ var _a, _b, _c, _d, _e;
1885
+ if (!this.rectangle.contains(point.position)) {
1886
+ return false;
1887
+ }
1888
+ if (this.points.length < this.capacity) {
1889
+ this.points.push(point);
1890
+ return true;
1891
+ }
1892
+ if (!this.divided) {
1893
+ this.subdivide();
1894
+ }
1895
+ 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;
1896
+ }
1897
+ queryCircle(position, radius) {
1898
+ return this.query(new Circle(position.x, position.y, radius));
1899
+ }
1900
+ queryCircleWarp(position, radius, containerOrSize) {
1901
+ const container = containerOrSize;
1902
+ const size = containerOrSize;
1903
+ return this.query(new CircleWarp(position.x, position.y, radius, container.canvas !== undefined ? container.canvas.size : size));
1904
+ }
1905
+ queryRectangle(position, size) {
1906
+ return this.query(new Rectangle(position.x, position.y, size.width, size.height));
1907
+ }
1908
+ query(range, found) {
1909
+ var _a, _b, _c, _d;
1910
+ const res = found !== null && found !== void 0 ? found : [];
1911
+ if (!range.intersects(this.rectangle)) {
1912
+ return [];
1913
+ } else {
1914
+ for (const p of this.points) {
1915
+ if (!range.contains(p.position) && getDistance(range.position, p.position) > p.particle.getRadius()) {
1916
+ continue;
1917
+ }
1918
+ res.push(p.particle);
1919
+ }
1920
+ if (this.divided) {
1921
+ (_a = this.northEast) === null || _a === void 0 ? void 0 : _a.query(range, res);
1922
+ (_b = this.northWest) === null || _b === void 0 ? void 0 : _b.query(range, res);
1923
+ (_c = this.southEast) === null || _c === void 0 ? void 0 : _c.query(range, res);
1924
+ (_d = this.southWest) === null || _d === void 0 ? void 0 : _d.query(range, res);
1925
+ }
1926
+ }
1927
+ return res;
1928
+ }
1929
+ }
1930
+ class Rectangle_Rectangle extends Range {
1931
+ constructor(x, y, width, height) {
1932
+ super(x, y);
1933
+ this.size = {
1934
+ height: height,
1935
+ width: width
1936
+ };
1937
+ }
1938
+ contains(point) {
1939
+ const w = this.size.width;
1940
+ const h = this.size.height;
1941
+ const pos = this.position;
1942
+ return point.x >= pos.x && point.x <= pos.x + w && point.y >= pos.y && point.y <= pos.y + h;
1943
+ }
1944
+ intersects(range) {
1945
+ const rect = range;
1946
+ const circle = range;
1947
+ const w = this.size.width;
1948
+ const h = this.size.height;
1949
+ const pos1 = this.position;
1950
+ const pos2 = range.position;
1951
+ if (circle.radius !== undefined) {
1952
+ return circle.intersects(this);
1953
+ } else if (rect.size !== undefined) {
1954
+ const size2 = rect.size;
1955
+ const w2 = size2.width;
1956
+ const h2 = size2.height;
1957
+ return pos2.x < pos1.x + w && pos2.x + w2 > pos1.x && pos2.y < pos1.y + h && pos2.y + h2 > pos1.y;
1958
+ }
1959
+ return false;
1960
+ }
1961
+ }
1962
+ class Vector_Vector {
1963
+ constructor(x, y) {
1964
+ let defX, defY;
1965
+ if (y === undefined) {
1966
+ if (typeof x === "number") {
1967
+ throw new Error("tsParticles - Vector not initialized correctly");
1968
+ }
1969
+ const coords = x;
1970
+ [defX, defY] = [ coords.x, coords.y ];
1971
+ } else {
1972
+ [defX, defY] = [ x, y ];
1973
+ }
1974
+ this.x = defX;
1975
+ this.y = defY;
1976
+ }
1977
+ static clone(source) {
1978
+ return Vector_Vector.create(source.x, source.y);
1979
+ }
1980
+ static create(x, y) {
1981
+ return new Vector_Vector(x, y);
1982
+ }
1983
+ static get origin() {
1984
+ return Vector_Vector.create(0, 0);
1985
+ }
1986
+ get angle() {
1987
+ return Math.atan2(this.y, this.x);
1988
+ }
1989
+ set angle(angle) {
1990
+ this.updateFromAngle(angle, this.length);
1991
+ }
1992
+ get length() {
1993
+ return Math.sqrt(this.x ** 2 + this.y ** 2);
1994
+ }
1995
+ set length(length) {
1996
+ this.updateFromAngle(this.angle, length);
1997
+ }
1998
+ add(v) {
1999
+ return Vector_Vector.create(this.x + v.x, this.y + v.y);
2000
+ }
2001
+ addTo(v) {
2002
+ this.x += v.x;
2003
+ this.y += v.y;
2004
+ }
2005
+ sub(v) {
2006
+ return Vector_Vector.create(this.x - v.x, this.y - v.y);
2007
+ }
2008
+ subFrom(v) {
2009
+ this.x -= v.x;
2010
+ this.y -= v.y;
2011
+ }
2012
+ mult(n) {
2013
+ return Vector_Vector.create(this.x * n, this.y * n);
2014
+ }
2015
+ multTo(n) {
2016
+ this.x *= n;
2017
+ this.y *= n;
2018
+ }
2019
+ div(n) {
2020
+ return Vector_Vector.create(this.x / n, this.y / n);
2021
+ }
2022
+ divTo(n) {
2023
+ this.x /= n;
2024
+ this.y /= n;
2025
+ }
2026
+ distanceTo(v) {
2027
+ return this.sub(v).length;
2028
+ }
2029
+ getLengthSq() {
2030
+ return this.x ** 2 + this.y ** 2;
2031
+ }
2032
+ distanceToSq(v) {
2033
+ return this.sub(v).getLengthSq();
2034
+ }
2035
+ manhattanDistanceTo(v) {
2036
+ return Math.abs(v.x - this.x) + Math.abs(v.y - this.y);
2037
+ }
2038
+ copy() {
2039
+ return Vector_Vector.clone(this);
2040
+ }
2041
+ setTo(velocity) {
2042
+ this.x = velocity.x;
2043
+ this.y = velocity.y;
2044
+ }
2045
+ rotate(angle) {
2046
+ return Vector_Vector.create(this.x * Math.cos(angle) - this.y * Math.sin(angle), this.x * Math.sin(angle) + this.y * Math.cos(angle));
2047
+ }
2048
+ updateFromAngle(angle, length) {
2049
+ this.x = Math.cos(angle) * length;
2050
+ this.y = Math.sin(angle) * length;
2051
+ }
2052
+ }
2053
+ class Canvas_Canvas {
2054
+ constructor(container) {
2055
+ this.container = container;
2056
+ this.size = {
2057
+ height: 0,
2058
+ width: 0
2059
+ };
2060
+ this.context = null;
2061
+ this.generatedCanvas = false;
2062
+ }
2063
+ init() {
2064
+ this.resize();
2065
+ this.initStyle();
2066
+ this.initCover();
2067
+ this.initTrail();
2068
+ this.initBackground();
2069
+ this.paint();
2070
+ }
2071
+ loadCanvas(canvas) {
2072
+ var _a;
2073
+ if (this.generatedCanvas) {
2074
+ (_a = this.element) === null || _a === void 0 ? void 0 : _a.remove();
2075
+ }
2076
+ this.generatedCanvas = canvas.dataset && Constants.generatedAttribute in canvas.dataset ? canvas.dataset[Constants.generatedAttribute] === "true" : this.generatedCanvas;
2077
+ this.element = canvas;
2078
+ this.originalStyle = deepExtend({}, this.element.style);
2079
+ this.size.height = canvas.offsetHeight;
2080
+ this.size.width = canvas.offsetWidth;
2081
+ this.context = this.element.getContext("2d");
2082
+ this.container.retina.init();
2083
+ this.initBackground();
2084
+ }
2085
+ destroy() {
2086
+ var _a;
2087
+ if (this.generatedCanvas) {
2088
+ (_a = this.element) === null || _a === void 0 ? void 0 : _a.remove();
2089
+ }
2090
+ this.draw((ctx => {
2091
+ clear(ctx, this.size);
2092
+ }));
2093
+ }
2094
+ paint() {
2095
+ const options = this.container.actualOptions;
2096
+ this.draw((ctx => {
2097
+ if (options.backgroundMask.enable && options.backgroundMask.cover && this.coverColor) {
2098
+ clear(ctx, this.size);
2099
+ this.paintBase(getStyleFromRgb(this.coverColor, this.coverColor.a));
2100
+ } else {
2101
+ this.paintBase();
2102
+ }
2103
+ }));
2104
+ }
2105
+ clear() {
2106
+ const options = this.container.actualOptions;
2107
+ const trail = options.particles.move.trail;
2108
+ if (options.backgroundMask.enable) {
2109
+ this.paint();
2110
+ } else if (trail.enable && trail.length > 0 && this.trailFillColor) {
2111
+ this.paintBase(getStyleFromRgb(this.trailFillColor, 1 / trail.length));
2112
+ } else {
2113
+ this.draw((ctx => {
2114
+ clear(ctx, this.size);
2115
+ }));
2116
+ }
2117
+ }
2118
+ async windowResize() {
2119
+ if (!this.element) {
2120
+ return;
2121
+ }
2122
+ const container = this.container;
2123
+ this.resize();
2124
+ const needsRefresh = container.updateActualOptions();
2125
+ container.particles.setDensity();
2126
+ for (const [, plugin] of container.plugins) {
2127
+ if (plugin.resize !== undefined) {
2128
+ plugin.resize();
2129
+ }
2130
+ }
2131
+ if (needsRefresh) {
2132
+ await container.refresh();
2133
+ }
2134
+ }
2135
+ resize() {
2136
+ if (!this.element) {
2137
+ return;
2138
+ }
2139
+ const container = this.container;
2140
+ const pxRatio = container.retina.pixelRatio;
2141
+ const size = container.canvas.size;
2142
+ const oldSize = {
2143
+ width: size.width,
2144
+ height: size.height
2145
+ };
2146
+ size.width = this.element.offsetWidth * pxRatio;
2147
+ size.height = this.element.offsetHeight * pxRatio;
2148
+ this.element.width = size.width;
2149
+ this.element.height = size.height;
2150
+ if (this.container.started) {
2151
+ this.resizeFactor = {
2152
+ width: size.width / oldSize.width,
2153
+ height: size.height / oldSize.height
2154
+ };
2155
+ }
2156
+ }
2157
+ drawConnectLine(p1, p2) {
2158
+ this.draw((ctx => {
2159
+ var _a;
2160
+ const lineStyle = this.lineStyle(p1, p2);
2161
+ if (!lineStyle) {
2162
+ return;
2163
+ }
2164
+ const pos1 = p1.getPosition();
2165
+ const pos2 = p2.getPosition();
2166
+ drawConnectLine(ctx, (_a = p1.retina.linksWidth) !== null && _a !== void 0 ? _a : this.container.retina.linksWidth, lineStyle, pos1, pos2);
2167
+ }));
2168
+ }
2169
+ drawGrabLine(particle, lineColor, opacity, mousePos) {
2170
+ const container = this.container;
2171
+ this.draw((ctx => {
2172
+ var _a;
2173
+ const beginPos = particle.getPosition();
2174
+ drawGrabLine(ctx, (_a = particle.retina.linksWidth) !== null && _a !== void 0 ? _a : container.retina.linksWidth, beginPos, mousePos, lineColor, opacity);
2175
+ }));
2176
+ }
2177
+ drawParticle(particle, delta) {
2178
+ var _a, _b, _c, _d, _e, _f;
2179
+ if (particle.spawning || particle.destroyed) {
2180
+ return;
2181
+ }
2182
+ const pfColor = particle.getFillColor();
2183
+ const psColor = (_a = particle.getStrokeColor()) !== null && _a !== void 0 ? _a : pfColor;
2184
+ if (!pfColor && !psColor) {
2185
+ return;
2186
+ }
2187
+ let [fColor, sColor] = this.getPluginParticleColors(particle);
2188
+ const pOptions = particle.options;
2189
+ const twinkle = pOptions.twinkle.particles;
2190
+ const twinkling = twinkle.enable && Math.random() < twinkle.frequency;
2191
+ if (!fColor || !sColor) {
2192
+ const twinkleRgb = colorToHsl(twinkle.color);
2193
+ if (!fColor) {
2194
+ fColor = twinkling && twinkleRgb !== undefined ? twinkleRgb : pfColor ? pfColor : undefined;
2195
+ }
2196
+ if (!sColor) {
2197
+ sColor = twinkling && twinkleRgb !== undefined ? twinkleRgb : psColor ? psColor : undefined;
2198
+ }
2199
+ }
2200
+ const options = this.container.actualOptions;
2201
+ const zIndexOptions = particle.options.zIndex;
2202
+ const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
2203
+ const radius = particle.getRadius();
2204
+ 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;
2205
+ const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
2206
+ const zOpacity = opacity * zOpacityFactor;
2207
+ const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
2208
+ if (!fillColorValue && !sColor) {
2209
+ return;
2210
+ }
2211
+ this.draw((ctx => {
2212
+ const zSizeFactor = (1 - particle.zIndexFactor) ** zIndexOptions.sizeRate;
2213
+ const zStrokeOpacity = strokeOpacity * zOpacityFactor;
2214
+ const strokeColorValue = sColor ? getStyleFromHsl(sColor, zStrokeOpacity) : fillColorValue;
2215
+ if (radius <= 0) {
2216
+ return;
2217
+ }
2218
+ const container = this.container;
2219
+ for (const updater of container.particles.updaters) {
2220
+ if (updater.beforeDraw) {
2221
+ updater.beforeDraw(particle);
2222
+ }
2223
+ }
2224
+ drawParticle(this.container, ctx, particle, delta, fillColorValue, strokeColorValue, options.backgroundMask.enable, options.backgroundMask.composite, radius * zSizeFactor, zOpacity, particle.options.shadow, particle.gradient);
2225
+ for (const updater of container.particles.updaters) {
2226
+ if (updater.afterDraw) {
2227
+ updater.afterDraw(particle);
2228
+ }
2229
+ }
2230
+ }));
2231
+ }
2232
+ drawPlugin(plugin, delta) {
2233
+ this.draw((ctx => {
2234
+ drawPlugin(ctx, plugin, delta);
2235
+ }));
2236
+ }
2237
+ drawParticlePlugin(plugin, particle, delta) {
2238
+ this.draw((ctx => {
2239
+ drawParticlePlugin(ctx, plugin, particle, delta);
2240
+ }));
2241
+ }
2242
+ initBackground() {
2243
+ const options = this.container.actualOptions;
2244
+ const background = options.background;
2245
+ const element = this.element;
2246
+ const elementStyle = element === null || element === void 0 ? void 0 : element.style;
2247
+ if (!elementStyle) {
2248
+ return;
2249
+ }
2250
+ if (background.color) {
2251
+ const color = colorToRgb(background.color);
2252
+ elementStyle.backgroundColor = color ? getStyleFromRgb(color, background.opacity) : "";
2253
+ } else {
2254
+ elementStyle.backgroundColor = "";
2255
+ }
2256
+ elementStyle.backgroundImage = background.image || "";
2257
+ elementStyle.backgroundPosition = background.position || "";
2258
+ elementStyle.backgroundRepeat = background.repeat || "";
2259
+ elementStyle.backgroundSize = background.size || "";
2260
+ }
2261
+ draw(cb) {
2262
+ if (!this.context) {
2263
+ return;
2264
+ }
2265
+ return cb(this.context);
2266
+ }
2267
+ initCover() {
2268
+ const options = this.container.actualOptions;
2269
+ const cover = options.backgroundMask.cover;
2270
+ const color = cover.color;
2271
+ const coverRgb = colorToRgb(color);
2272
+ if (coverRgb) {
2273
+ this.coverColor = {
2274
+ r: coverRgb.r,
2275
+ g: coverRgb.g,
2276
+ b: coverRgb.b,
2277
+ a: cover.opacity
2278
+ };
2279
+ }
2280
+ }
2281
+ initTrail() {
2282
+ const options = this.container.actualOptions;
2283
+ const trail = options.particles.move.trail;
2284
+ const fillColor = colorToRgb(trail.fillColor);
2285
+ if (fillColor) {
2286
+ const trail = options.particles.move.trail;
2287
+ this.trailFillColor = {
2288
+ r: fillColor.r,
2289
+ g: fillColor.g,
2290
+ b: fillColor.b,
2291
+ a: 1 / trail.length
2292
+ };
2293
+ }
2294
+ }
2295
+ getPluginParticleColors(particle) {
2296
+ let fColor;
2297
+ let sColor;
2298
+ for (const [, plugin] of this.container.plugins) {
2299
+ if (!fColor && plugin.particleFillColor) {
2300
+ fColor = colorToHsl(plugin.particleFillColor(particle));
2301
+ }
2302
+ if (!sColor && plugin.particleStrokeColor) {
2303
+ sColor = colorToHsl(plugin.particleStrokeColor(particle));
2304
+ }
2305
+ if (fColor && sColor) {
2306
+ break;
2307
+ }
2308
+ }
2309
+ return [ fColor, sColor ];
2310
+ }
2311
+ initStyle() {
2312
+ const element = this.element, options = this.container.actualOptions;
2313
+ if (!element) {
2314
+ return;
2315
+ }
2316
+ const originalStyle = this.originalStyle;
2317
+ if (options.fullScreen.enable) {
2318
+ this.originalStyle = deepExtend({}, element.style);
2319
+ element.style.setProperty("position", "fixed", "important");
2320
+ element.style.setProperty("z-index", options.fullScreen.zIndex.toString(10), "important");
2321
+ element.style.setProperty("top", "0", "important");
2322
+ element.style.setProperty("left", "0", "important");
2323
+ element.style.setProperty("width", "100%", "important");
2324
+ element.style.setProperty("height", "100%", "important");
2325
+ } else if (originalStyle) {
2326
+ element.style.position = originalStyle.position;
2327
+ element.style.zIndex = originalStyle.zIndex;
2328
+ element.style.top = originalStyle.top;
2329
+ element.style.left = originalStyle.left;
2330
+ element.style.width = originalStyle.width;
2331
+ element.style.height = originalStyle.height;
2332
+ }
2333
+ for (const key in options.style) {
2334
+ if (!key || !options.style) {
2335
+ continue;
2336
+ }
2337
+ const value = options.style[key];
2338
+ if (!value) {
2339
+ continue;
2340
+ }
2341
+ element.style.setProperty(key, value, "important");
2342
+ }
2343
+ }
2344
+ paintBase(baseColor) {
2345
+ this.draw((ctx => {
2346
+ paintBase(ctx, this.size, baseColor);
2347
+ }));
2348
+ }
2349
+ lineStyle(p1, p2) {
2350
+ return this.draw((ctx => {
2351
+ const options = this.container.actualOptions;
2352
+ const connectOptions = options.interactivity.modes.connect;
2353
+ return gradient(ctx, p1, p2, connectOptions.links.opacity);
2354
+ }));
2355
+ }
2356
+ }
2357
+ class Trail_Trail {
2358
+ constructor() {
2359
+ this.delay = 1;
2360
+ this.pauseOnStop = false;
2361
+ this.quantity = 1;
2362
+ }
2363
+ load(data) {
2364
+ if (data === undefined) {
2365
+ return;
2366
+ }
2367
+ if (data.delay !== undefined) {
2368
+ this.delay = data.delay;
2369
+ }
2370
+ if (data.quantity !== undefined) {
2371
+ this.quantity = data.quantity;
2372
+ }
2373
+ if (data.particles !== undefined) {
2374
+ this.particles = deepExtend({}, data.particles);
2375
+ }
2376
+ if (data.pauseOnStop !== undefined) {
2377
+ this.pauseOnStop = data.pauseOnStop;
2378
+ }
2379
+ }
2380
+ }
2381
+ class Modes_Modes {
2382
+ constructor() {
2383
+ this.attract = new Attract;
2384
+ this.bounce = new Bounce;
2385
+ this.bubble = new Bubble;
2386
+ this.connect = new Connect;
2387
+ this.grab = new Grab;
2388
+ this.light = new Light;
2389
+ this.push = new Push;
2390
+ this.remove = new Remove;
2391
+ this.repulse = new Repulse;
2392
+ this.slow = new Slow;
2393
+ this.trail = new Trail;
2394
+ }
2395
+ load(data) {
2396
+ if (data === undefined) {
2397
+ return;
2398
+ }
2399
+ this.attract.load(data.attract);
2400
+ this.bubble.load(data.bubble);
2401
+ this.connect.load(data.connect);
2402
+ this.grab.load(data.grab);
2403
+ this.light.load(data.light);
2404
+ this.push.load(data.push);
2405
+ this.remove.load(data.remove);
2406
+ this.repulse.load(data.repulse);
2407
+ this.slow.load(data.slow);
2408
+ this.trail.load(data.trail);
2409
+ }
2410
+ }
2411
+ class Interactivity_Interactivity {
2412
+ constructor() {
2413
+ this.detectsOn = "window";
2414
+ this.events = new Events;
2415
+ this.modes = new Modes;
2416
+ }
2417
+ get detect_on() {
2418
+ return this.detectsOn;
2419
+ }
2420
+ set detect_on(value) {
2421
+ this.detectsOn = value;
2422
+ }
2423
+ load(data) {
2424
+ var _a, _b, _c;
2425
+ if (data === undefined) {
2426
+ return;
2427
+ }
2428
+ const detectsOn = (_a = data.detectsOn) !== null && _a !== void 0 ? _a : data.detect_on;
2429
+ if (detectsOn !== undefined) {
2430
+ this.detectsOn = detectsOn;
2431
+ }
2432
+ this.events.load(data.events);
2433
+ this.modes.load(data.modes);
2434
+ if (((_c = (_b = data.modes) === null || _b === void 0 ? void 0 : _b.slow) === null || _c === void 0 ? void 0 : _c.active) === true) {
2435
+ if (this.events.onHover.mode instanceof Array) {
2436
+ if (this.events.onHover.mode.indexOf("slow") < 0) {
2437
+ this.events.onHover.mode.push("slow");
2438
+ }
2439
+ } else if (this.events.onHover.mode !== "slow") {
2440
+ this.events.onHover.mode = [ this.events.onHover.mode, "slow" ];
2441
+ }
2442
+ }
2443
+ }
2444
+ }
2445
+ class ManualParticle_ManualParticle {
2446
+ load(data) {
2447
+ var _a, _b;
2448
+ if (!data) {
2449
+ return;
2450
+ }
2451
+ if (data.position !== undefined) {
2452
+ this.position = {
2453
+ x: (_a = data.position.x) !== null && _a !== void 0 ? _a : 50,
2454
+ y: (_b = data.position.y) !== null && _b !== void 0 ? _b : 50
2455
+ };
2456
+ }
2457
+ if (data.options !== undefined) {
2458
+ this.options = deepExtend({}, data.options);
2459
+ }
2460
+ }
2461
+ }
2462
+ class ColorAnimation_ColorAnimation {
2463
+ constructor() {
2464
+ this.count = 0;
2465
+ this.enable = false;
2466
+ this.offset = 0;
2467
+ this.speed = 1;
2468
+ this.sync = true;
2469
+ }
2470
+ load(data) {
2471
+ if (data === undefined) {
2472
+ return;
2473
+ }
2474
+ if (data.count !== undefined) {
2475
+ this.count = data.count;
2476
+ }
2477
+ if (data.enable !== undefined) {
2478
+ this.enable = data.enable;
2479
+ }
2480
+ if (data.offset !== undefined) {
2481
+ this.offset = setRangeValue(data.offset);
2482
+ }
2483
+ if (data.speed !== undefined) {
2484
+ this.speed = data.speed;
2485
+ }
2486
+ if (data.sync !== undefined) {
2487
+ this.sync = data.sync;
2488
+ }
2489
+ }
2490
+ }
2491
+ class HslAnimation_HslAnimation {
2492
+ constructor() {
2493
+ this.h = new ColorAnimation;
2494
+ this.s = new ColorAnimation;
2495
+ this.l = new ColorAnimation;
2496
+ }
2497
+ load(data) {
2498
+ if (!data) {
2499
+ return;
2500
+ }
2501
+ this.h.load(data.h);
2502
+ this.s.load(data.s);
2503
+ this.l.load(data.l);
2504
+ }
2505
+ }
2506
+ class AnimatableColor_AnimatableColor extends(null && OptionsColor){
2507
+ constructor() {
2508
+ super();
2509
+ this.animation = new HslAnimation;
2510
+ }
2511
+ static create(source, data) {
2512
+ const color = new AnimatableColor_AnimatableColor;
2513
+ color.load(source);
2514
+ if (data !== undefined) {
2515
+ if (typeof data === "string" || data instanceof Array) {
2516
+ color.load({
2517
+ value: data
2518
+ });
2519
+ } else {
2520
+ color.load(data);
2521
+ }
2522
+ }
2523
+ return color;
2524
+ }
2525
+ load(data) {
2526
+ super.load(data);
2527
+ if (!data) {
2528
+ return;
2529
+ }
2530
+ const colorAnimation = data.animation;
2531
+ if (colorAnimation !== undefined) {
2532
+ if (colorAnimation.enable !== undefined) {
2533
+ this.animation.h.load(colorAnimation);
2534
+ } else {
2535
+ this.animation.load(data.animation);
2536
+ }
2537
+ }
2538
+ }
2539
+ }
2540
+ class AnimatableGradient_AnimatableGradient {
2541
+ constructor() {
2542
+ this.angle = new GradientAngle;
2543
+ this.colors = [];
2544
+ this.type = "random";
2545
+ }
2546
+ load(data) {
2547
+ if (!data) {
2548
+ return;
2549
+ }
2550
+ this.angle.load(data.angle);
2551
+ if (data.colors !== undefined) {
2552
+ this.colors = data.colors.map((s => {
2553
+ const tmp = new AnimatableGradientColor;
2554
+ tmp.load(s);
2555
+ return tmp;
2556
+ }));
2557
+ }
2558
+ if (data.type !== undefined) {
2559
+ this.type = data.type;
2560
+ }
2561
+ }
2562
+ }
2563
+ class GradientAngle {
2564
+ constructor() {
2565
+ this.value = 0;
2566
+ this.animation = new GradientAngleAnimation;
2567
+ this.direction = "clockwise";
2568
+ }
2569
+ load(data) {
2570
+ if (!data) {
2571
+ return;
2572
+ }
2573
+ this.animation.load(data.animation);
2574
+ if (data.value !== undefined) {
2575
+ this.value = data.value;
2576
+ }
2577
+ if (data.direction !== undefined) {
2578
+ this.direction = data.direction;
2579
+ }
2580
+ }
2581
+ }
2582
+ class GradientColorOpacity {
2583
+ constructor() {
2584
+ this.value = 0;
2585
+ this.animation = new GradientColorOpacityAnimation;
2586
+ }
2587
+ load(data) {
2588
+ if (!data) {
2589
+ return;
2590
+ }
2591
+ this.animation.load(data.animation);
2592
+ if (data.value !== undefined) {
2593
+ this.value = setRangeValue(data.value);
2594
+ }
2595
+ }
2596
+ }
2597
+ class AnimatableGradientColor {
2598
+ constructor() {
2599
+ this.stop = 0;
2600
+ this.value = new AnimatableColor;
2601
+ }
2602
+ load(data) {
2603
+ if (!data) {
2604
+ return;
2605
+ }
2606
+ if (data.stop !== undefined) {
2607
+ this.stop = data.stop;
2608
+ }
2609
+ this.value = AnimatableColor.create(this.value, data.value);
2610
+ if (data.opacity !== undefined) {
2611
+ this.opacity = new GradientColorOpacity;
2612
+ if (typeof data.opacity === "number") {
2613
+ this.opacity.value = data.opacity;
2614
+ } else {
2615
+ this.opacity.load(data.opacity);
2616
+ }
2617
+ }
2618
+ }
2619
+ }
2620
+ class GradientAngleAnimation {
2621
+ constructor() {
2622
+ this.count = 0;
2623
+ this.enable = false;
2624
+ this.speed = 0;
2625
+ this.sync = false;
2626
+ }
2627
+ load(data) {
2628
+ if (!data) {
2629
+ return;
2630
+ }
2631
+ if (data.count !== undefined) {
2632
+ this.count = data.count;
2633
+ }
2634
+ if (data.enable !== undefined) {
2635
+ this.enable = data.enable;
2636
+ }
2637
+ if (data.speed !== undefined) {
2638
+ this.speed = data.speed;
2639
+ }
2640
+ if (data.sync !== undefined) {
2641
+ this.sync = data.sync;
2642
+ }
2643
+ }
2644
+ }
2645
+ class GradientColorOpacityAnimation {
2646
+ constructor() {
2647
+ this.count = 0;
2648
+ this.enable = false;
2649
+ this.speed = 0;
2650
+ this.sync = false;
2651
+ this.startValue = "random";
2652
+ }
2653
+ load(data) {
2654
+ if (!data) {
2655
+ return;
2656
+ }
2657
+ if (data.count !== undefined) {
2658
+ this.count = data.count;
2659
+ }
2660
+ if (data.enable !== undefined) {
2661
+ this.enable = data.enable;
2662
+ }
2663
+ if (data.speed !== undefined) {
2664
+ this.speed = data.speed;
2665
+ }
2666
+ if (data.sync !== undefined) {
2667
+ this.sync = data.sync;
2668
+ }
2669
+ if (data.startValue !== undefined) {
2670
+ this.startValue = data.startValue;
2671
+ }
2672
+ }
2673
+ }
2674
+ class ValueWithRandom_ValueWithRandom {
2675
+ constructor() {
2676
+ this.random = new Random;
2677
+ this.value = 0;
2678
+ }
2679
+ load(data) {
2680
+ if (!data) {
2681
+ return;
2682
+ }
2683
+ if (typeof data.random === "boolean") {
2684
+ this.random.enable = data.random;
2685
+ } else {
2686
+ this.random.load(data.random);
2687
+ }
2688
+ if (data.value !== undefined) {
2689
+ this.value = setRangeValue(data.value, this.random.enable ? this.random.minimumValue : undefined);
2690
+ }
2691
+ }
2692
+ }
2693
+ class BounceFactor_BounceFactor extends(null && ValueWithRandom){
2694
+ constructor() {
2695
+ super();
2696
+ this.random.minimumValue = .1;
2697
+ this.value = 1;
2698
+ }
2699
+ }
2700
+ class Bounce_Bounce {
2701
+ constructor() {
2702
+ this.horizontal = new BounceFactor;
2703
+ this.vertical = new BounceFactor;
2704
+ }
2705
+ load(data) {
2706
+ if (!data) {
2707
+ return;
2708
+ }
2709
+ this.horizontal.load(data.horizontal);
2710
+ this.vertical.load(data.vertical);
2711
+ }
2712
+ }
2713
+ class Collisions_Collisions {
2714
+ constructor() {
2715
+ this.bounce = new Bounce;
2716
+ this.enable = false;
2717
+ this.mode = "bounce";
2718
+ this.overlap = new CollisionsOverlap;
2719
+ }
2720
+ load(data) {
2721
+ if (data === undefined) {
2722
+ return;
2723
+ }
2724
+ this.bounce.load(data.bounce);
2725
+ if (data.enable !== undefined) {
2726
+ this.enable = data.enable;
2727
+ }
2728
+ if (data.mode !== undefined) {
2729
+ this.mode = data.mode;
2730
+ }
2731
+ this.overlap.load(data.overlap);
2732
+ }
2733
+ }
2734
+ class SplitFactor_SplitFactor extends(null && ValueWithRandom){
2735
+ constructor() {
2736
+ super();
2737
+ this.value = 3;
2738
+ }
2739
+ }
2740
+ class SplitRate_SplitRate extends(null && ValueWithRandom){
2741
+ constructor() {
2742
+ super();
2743
+ this.value = {
2744
+ min: 4,
2745
+ max: 9
2746
+ };
2747
+ }
2748
+ }
2749
+ class Split_Split {
2750
+ constructor() {
2751
+ this.count = 1;
2752
+ this.factor = new SplitFactor;
2753
+ this.rate = new SplitRate;
2754
+ this.sizeOffset = true;
2755
+ }
2756
+ load(data) {
2757
+ if (!data) {
2758
+ return;
2759
+ }
2760
+ if (data.count !== undefined) {
2761
+ this.count = data.count;
2762
+ }
2763
+ this.factor.load(data.factor);
2764
+ this.rate.load(data.rate);
2765
+ if (data.particles !== undefined) {
2766
+ this.particles = deepExtend({}, data.particles);
2767
+ }
2768
+ if (data.sizeOffset !== undefined) {
2769
+ this.sizeOffset = data.sizeOffset;
2770
+ }
2771
+ }
2772
+ }
2773
+ class Destroy_Destroy {
2774
+ constructor() {
2775
+ this.mode = "none";
2776
+ this.split = new Split;
2777
+ }
2778
+ load(data) {
2779
+ if (!data) {
2780
+ return;
2781
+ }
2782
+ if (data.mode !== undefined) {
2783
+ this.mode = data.mode;
2784
+ }
2785
+ this.split.load(data.split);
2786
+ }
2787
+ }
2788
+ class LifeDelay_LifeDelay extends(null && ValueWithRandom){
2789
+ constructor() {
2790
+ super();
2791
+ this.sync = false;
2792
+ }
2793
+ load(data) {
2794
+ if (!data) {
2795
+ return;
2796
+ }
2797
+ super.load(data);
2798
+ if (data.sync !== undefined) {
2799
+ this.sync = data.sync;
2800
+ }
2801
+ }
2802
+ }
2803
+ class LifeDuration_LifeDuration extends(null && ValueWithRandom){
2804
+ constructor() {
2805
+ super();
2806
+ this.random.minimumValue = 1e-4;
2807
+ this.sync = false;
2808
+ }
2809
+ load(data) {
2810
+ if (data === undefined) {
2811
+ return;
2812
+ }
2813
+ super.load(data);
2814
+ if (data.sync !== undefined) {
2815
+ this.sync = data.sync;
2816
+ }
2817
+ }
2818
+ }
2819
+ class Life_Life {
2820
+ constructor() {
2821
+ this.count = 0;
2822
+ this.delay = new LifeDelay;
2823
+ this.duration = new LifeDuration;
2824
+ }
2825
+ load(data) {
2826
+ if (data === undefined) {
2827
+ return;
2828
+ }
2829
+ if (data.count !== undefined) {
2830
+ this.count = data.count;
2831
+ }
2832
+ this.delay.load(data.delay);
2833
+ this.duration.load(data.duration);
2834
+ }
2835
+ }
2836
+ class PathDelay_PathDelay extends(null && ValueWithRandom){
2837
+ constructor() {
2838
+ super();
2839
+ }
2840
+ }
2841
+ class Path_Path {
2842
+ constructor() {
2843
+ this.clamp = true;
2844
+ this.delay = new PathDelay;
2845
+ this.enable = false;
2846
+ this.options = {};
2847
+ }
2848
+ load(data) {
2849
+ if (data === undefined) {
2850
+ return;
2851
+ }
2852
+ if (data.clamp !== undefined) {
2853
+ this.clamp = data.clamp;
2854
+ }
2855
+ this.delay.load(data.delay);
2856
+ if (data.enable !== undefined) {
2857
+ this.enable = data.enable;
2858
+ }
2859
+ this.generator = data.generator;
2860
+ if (data.options) {
2861
+ this.options = deepExtend(this.options, data.options);
2862
+ }
2863
+ }
2864
+ }
2865
+ class Spin_Spin {
2866
+ constructor() {
2867
+ this.acceleration = 0;
2868
+ this.enable = false;
2869
+ }
2870
+ load(data) {
2871
+ if (!data) {
2872
+ return;
2873
+ }
2874
+ if (data.acceleration !== undefined) {
2875
+ this.acceleration = setRangeValue(data.acceleration);
2876
+ }
2877
+ if (data.enable !== undefined) {
2878
+ this.enable = data.enable;
2879
+ }
2880
+ this.position = data.position ? deepExtend({}, data.position) : undefined;
2881
+ }
2882
+ }
2883
+ class Move_Move {
2884
+ constructor() {
2885
+ this.angle = new MoveAngle;
2886
+ this.attract = new Attract;
2887
+ this.decay = 0;
2888
+ this.distance = {};
2889
+ this.direction = "none";
2890
+ this.drift = 0;
2891
+ this.enable = false;
2892
+ this.gravity = new MoveGravity;
2893
+ this.path = new Path;
2894
+ this.outModes = new OutModes;
2895
+ this.random = false;
2896
+ this.size = false;
2897
+ this.speed = 2;
2898
+ this.spin = new Spin;
2899
+ this.straight = false;
2900
+ this.trail = new Trail;
2901
+ this.vibrate = false;
2902
+ this.warp = false;
2903
+ }
2904
+ get collisions() {
2905
+ return false;
2906
+ }
2907
+ set collisions(value) {}
2908
+ get bounce() {
2909
+ return this.collisions;
2910
+ }
2911
+ set bounce(value) {
2912
+ this.collisions = value;
2913
+ }
2914
+ get out_mode() {
2915
+ return this.outMode;
2916
+ }
2917
+ set out_mode(value) {
2918
+ this.outMode = value;
2919
+ }
2920
+ get outMode() {
2921
+ return this.outModes.default;
2922
+ }
2923
+ set outMode(value) {
2924
+ this.outModes.default = value;
2925
+ }
2926
+ get noise() {
2927
+ return this.path;
2928
+ }
2929
+ set noise(value) {
2930
+ this.path = value;
2931
+ }
2932
+ load(data) {
2933
+ var _a, _b, _c;
2934
+ if (data === undefined) {
2935
+ return;
2936
+ }
2937
+ if (data.angle !== undefined) {
2938
+ if (typeof data.angle === "number") {
2939
+ this.angle.value = data.angle;
2940
+ } else {
2941
+ this.angle.load(data.angle);
2942
+ }
2943
+ }
2944
+ this.attract.load(data.attract);
2945
+ if (data.decay !== undefined) {
2946
+ this.decay = data.decay;
2947
+ }
2948
+ if (data.direction !== undefined) {
2949
+ this.direction = data.direction;
2950
+ }
2951
+ if (data.distance !== undefined) {
2952
+ this.distance = typeof data.distance === "number" ? {
2953
+ horizontal: data.distance,
2954
+ vertical: data.distance
2955
+ } : deepExtend({}, data.distance);
2956
+ }
2957
+ if (data.drift !== undefined) {
2958
+ this.drift = setRangeValue(data.drift);
2959
+ }
2960
+ if (data.enable !== undefined) {
2961
+ this.enable = data.enable;
2962
+ }
2963
+ this.gravity.load(data.gravity);
2964
+ const outMode = (_a = data.outMode) !== null && _a !== void 0 ? _a : data.out_mode;
2965
+ if (data.outModes !== undefined || outMode !== undefined) {
2966
+ if (typeof data.outModes === "string" || data.outModes === undefined && outMode !== undefined) {
2967
+ this.outModes.load({
2968
+ default: (_b = data.outModes) !== null && _b !== void 0 ? _b : outMode
2969
+ });
2970
+ } else {
2971
+ this.outModes.load(data.outModes);
2972
+ }
2973
+ }
2974
+ this.path.load((_c = data.path) !== null && _c !== void 0 ? _c : data.noise);
2975
+ if (data.random !== undefined) {
2976
+ this.random = data.random;
2977
+ }
2978
+ if (data.size !== undefined) {
2979
+ this.size = data.size;
2980
+ }
2981
+ if (data.speed !== undefined) {
2982
+ this.speed = setRangeValue(data.speed);
2983
+ }
2984
+ this.spin.load(data.spin);
2985
+ if (data.straight !== undefined) {
2986
+ this.straight = data.straight;
2987
+ }
2988
+ this.trail.load(data.trail);
2989
+ if (data.vibrate !== undefined) {
2990
+ this.vibrate = data.vibrate;
2991
+ }
2992
+ if (data.warp !== undefined) {
2993
+ this.warp = data.warp;
2994
+ }
2995
+ }
2996
+ }
2997
+ class Opacity_Opacity extends(null && ValueWithRandom){
2998
+ constructor() {
2999
+ super();
3000
+ this.animation = new OpacityAnimation;
3001
+ this.random.minimumValue = .1;
3002
+ this.value = 1;
3003
+ }
3004
+ get anim() {
3005
+ return this.animation;
3006
+ }
3007
+ set anim(value) {
3008
+ this.animation = value;
3009
+ }
3010
+ load(data) {
3011
+ var _a;
3012
+ if (!data) {
3013
+ return;
3014
+ }
3015
+ super.load(data);
3016
+ const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
3017
+ if (animation !== undefined) {
3018
+ this.animation.load(animation);
3019
+ this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
3020
+ }
3021
+ }
3022
+ }
3023
+ class OrbitRotation_OrbitRotation extends(null && ValueWithRandom){
3024
+ constructor() {
3025
+ super();
3026
+ this.value = 45;
3027
+ this.random.enable = false;
3028
+ this.random.minimumValue = 0;
3029
+ }
3030
+ load(data) {
3031
+ if (data === undefined) {
3032
+ return;
3033
+ }
3034
+ super.load(data);
3035
+ }
3036
+ }
3037
+ class Orbit_Orbit {
3038
+ constructor() {
3039
+ this.animation = new AnimationOptions;
3040
+ this.enable = false;
3041
+ this.opacity = 1;
3042
+ this.rotation = new OrbitRotation;
3043
+ this.width = 1;
3044
+ }
3045
+ load(data) {
3046
+ if (data === undefined) {
3047
+ return;
3048
+ }
3049
+ this.animation.load(data.animation);
3050
+ this.rotation.load(data.rotation);
3051
+ if (data.enable !== undefined) {
3052
+ this.enable = data.enable;
3053
+ }
3054
+ if (data.opacity !== undefined) {
3055
+ this.opacity = data.opacity;
3056
+ }
3057
+ if (data.width !== undefined) {
3058
+ this.width = data.width;
3059
+ }
3060
+ if (data.radius !== undefined) {
3061
+ this.radius = data.radius;
3062
+ }
3063
+ if (data.color !== undefined) {
3064
+ this.color = OptionsColor.create(this.color, data.color);
3065
+ }
3066
+ }
3067
+ }
3068
+ class Repulse_Repulse extends(null && ValueWithRandom){
3069
+ constructor() {
3070
+ super();
3071
+ this.enabled = false;
3072
+ this.distance = 1;
3073
+ this.duration = 1;
3074
+ this.factor = 1;
3075
+ this.speed = 1;
3076
+ }
3077
+ load(data) {
3078
+ super.load(data);
3079
+ if (!data) {
3080
+ return;
3081
+ }
3082
+ if (data.enabled !== undefined) {
3083
+ this.enabled = data.enabled;
3084
+ }
3085
+ if (data.distance !== undefined) {
3086
+ this.distance = data.distance;
3087
+ }
3088
+ if (data.duration !== undefined) {
3089
+ this.duration = data.duration;
3090
+ }
3091
+ if (data.factor !== undefined) {
3092
+ this.factor = data.factor;
3093
+ }
3094
+ if (data.speed !== undefined) {
3095
+ this.speed = data.speed;
3096
+ }
3097
+ }
3098
+ }
3099
+ class Roll_Roll {
3100
+ constructor() {
3101
+ this.darken = new RollLight;
3102
+ this.enable = false;
3103
+ this.enlighten = new RollLight;
3104
+ this.mode = "vertical";
3105
+ this.speed = 25;
3106
+ }
3107
+ load(data) {
3108
+ if (!data) {
3109
+ return;
3110
+ }
3111
+ if (data.backColor !== undefined) {
3112
+ this.backColor = OptionsColor.create(this.backColor, data.backColor);
3113
+ }
3114
+ this.darken.load(data.darken);
3115
+ if (data.enable !== undefined) {
3116
+ this.enable = data.enable;
3117
+ }
3118
+ this.enlighten.load(data.enlighten);
3119
+ if (data.mode !== undefined) {
3120
+ this.mode = data.mode;
3121
+ }
3122
+ if (data.speed !== undefined) {
3123
+ this.speed = setRangeValue(data.speed);
3124
+ }
3125
+ }
3126
+ }
3127
+ class Rotate_Rotate extends(null && ValueWithRandom){
3128
+ constructor() {
3129
+ super();
3130
+ this.animation = new RotateAnimation;
3131
+ this.direction = "clockwise";
3132
+ this.path = false;
3133
+ this.value = 0;
3134
+ }
3135
+ load(data) {
3136
+ if (!data) {
3137
+ return;
3138
+ }
3139
+ super.load(data);
3140
+ if (data.direction !== undefined) {
3141
+ this.direction = data.direction;
3142
+ }
3143
+ this.animation.load(data.animation);
3144
+ if (data.path !== undefined) {
3145
+ this.path = data.path;
3146
+ }
3147
+ }
3148
+ }
3149
+ class Shape_Shape {
3150
+ constructor() {
3151
+ this.options = {};
3152
+ this.type = "circle";
3153
+ }
3154
+ get image() {
3155
+ var _a;
3156
+ return (_a = this.options["image"]) !== null && _a !== void 0 ? _a : this.options["images"];
3157
+ }
3158
+ set image(value) {
3159
+ this.options["image"] = value;
3160
+ this.options["images"] = value;
3161
+ }
3162
+ get custom() {
3163
+ return this.options;
3164
+ }
3165
+ set custom(value) {
3166
+ this.options = value;
3167
+ }
3168
+ get images() {
3169
+ return this.image;
3170
+ }
3171
+ set images(value) {
3172
+ this.image = value;
3173
+ }
3174
+ get stroke() {
3175
+ return [];
3176
+ }
3177
+ set stroke(_value) {}
3178
+ get character() {
3179
+ var _a;
3180
+ return (_a = this.options["character"]) !== null && _a !== void 0 ? _a : this.options["char"];
3181
+ }
3182
+ set character(value) {
3183
+ this.options["character"] = value;
3184
+ this.options["char"] = value;
3185
+ }
3186
+ get polygon() {
3187
+ var _a;
3188
+ return (_a = this.options["polygon"]) !== null && _a !== void 0 ? _a : this.options["star"];
3189
+ }
3190
+ set polygon(value) {
3191
+ this.options["polygon"] = value;
3192
+ this.options["star"] = value;
3193
+ }
3194
+ load(data) {
3195
+ var _a, _b, _c;
3196
+ if (data === undefined) {
3197
+ return;
3198
+ }
3199
+ const options = (_a = data.options) !== null && _a !== void 0 ? _a : data.custom;
3200
+ if (options !== undefined) {
3201
+ for (const shape in options) {
3202
+ const item = options[shape];
3203
+ if (item !== undefined) {
3204
+ this.options[shape] = deepExtend((_b = this.options[shape]) !== null && _b !== void 0 ? _b : {}, item);
3205
+ }
3206
+ }
3207
+ }
3208
+ this.loadShape(data.character, "character", "char", true);
3209
+ this.loadShape(data.polygon, "polygon", "star", false);
3210
+ this.loadShape((_c = data.image) !== null && _c !== void 0 ? _c : data.images, "image", "images", true);
3211
+ if (data.type !== undefined) {
3212
+ this.type = data.type;
3213
+ }
3214
+ }
3215
+ loadShape(item, mainKey, altKey, altOverride) {
3216
+ var _a, _b, _c, _d;
3217
+ if (item === undefined) {
3218
+ return;
3219
+ }
3220
+ if (item instanceof Array) {
3221
+ if (!(this.options[mainKey] instanceof Array)) {
3222
+ this.options[mainKey] = [];
3223
+ if (!this.options[altKey] || altOverride) {
3224
+ this.options[altKey] = [];
3225
+ }
3226
+ }
3227
+ this.options[mainKey] = deepExtend((_a = this.options[mainKey]) !== null && _a !== void 0 ? _a : [], item);
3228
+ if (!this.options[altKey] || altOverride) {
3229
+ this.options[altKey] = deepExtend((_b = this.options[altKey]) !== null && _b !== void 0 ? _b : [], item);
3230
+ }
3231
+ } else {
3232
+ if (this.options[mainKey] instanceof Array) {
3233
+ this.options[mainKey] = {};
3234
+ if (!this.options[altKey] || altOverride) {
3235
+ this.options[altKey] = {};
3236
+ }
3237
+ }
3238
+ this.options[mainKey] = deepExtend((_c = this.options[mainKey]) !== null && _c !== void 0 ? _c : {}, item);
3239
+ if (!this.options[altKey] || altOverride) {
3240
+ this.options[altKey] = deepExtend((_d = this.options[altKey]) !== null && _d !== void 0 ? _d : {}, item);
3241
+ }
3242
+ }
3243
+ }
3244
+ }
3245
+ class Size_Size extends(null && ValueWithRandom){
3246
+ constructor() {
3247
+ super();
3248
+ this.animation = new SizeAnimation;
3249
+ this.random.minimumValue = 1;
3250
+ this.value = 3;
3251
+ }
3252
+ get anim() {
3253
+ return this.animation;
3254
+ }
3255
+ set anim(value) {
3256
+ this.animation = value;
3257
+ }
3258
+ load(data) {
3259
+ var _a;
3260
+ if (!data) {
3261
+ return;
3262
+ }
3263
+ super.load(data);
3264
+ const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
3265
+ if (animation !== undefined) {
3266
+ this.animation.load(animation);
3267
+ this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
3268
+ }
3269
+ }
3270
+ }
3271
+ class Stroke_Stroke {
3272
+ constructor() {
3273
+ this.width = 0;
3274
+ }
3275
+ load(data) {
3276
+ if (data === undefined) {
3277
+ return;
3278
+ }
3279
+ if (data.color !== undefined) {
3280
+ this.color = AnimatableColor.create(this.color, data.color);
3281
+ }
3282
+ if (data.width !== undefined) {
3283
+ this.width = data.width;
3284
+ }
3285
+ if (data.opacity !== undefined) {
3286
+ this.opacity = data.opacity;
3287
+ }
3288
+ }
3289
+ }
3290
+ class Tilt_Tilt extends(null && ValueWithRandom){
3291
+ constructor() {
3292
+ super();
3293
+ this.animation = new TiltAnimation;
3294
+ this.direction = "clockwise";
3295
+ this.enable = false;
3296
+ this.value = 0;
3297
+ }
3298
+ load(data) {
3299
+ if (!data) {
3300
+ return;
3301
+ }
3302
+ super.load(data);
3303
+ this.animation.load(data.animation);
3304
+ if (data.direction !== undefined) {
3305
+ this.direction = data.direction;
3306
+ }
3307
+ if (data.enable !== undefined) {
3308
+ this.enable = data.enable;
3309
+ }
3310
+ }
3311
+ }
3312
+ class Wobble_Wobble {
3313
+ constructor() {
3314
+ this.distance = 5;
3315
+ this.enable = false;
3316
+ this.speed = 50;
3317
+ }
3318
+ load(data) {
3319
+ if (!data) {
3320
+ return;
3321
+ }
3322
+ if (data.distance !== undefined) {
3323
+ this.distance = setRangeValue(data.distance);
3324
+ }
3325
+ if (data.enable !== undefined) {
3326
+ this.enable = data.enable;
3327
+ }
3328
+ if (data.speed !== undefined) {
3329
+ this.speed = setRangeValue(data.speed);
3330
+ }
3331
+ }
3332
+ }
3333
+ class ZIndex_ZIndex extends(null && ValueWithRandom){
3334
+ constructor() {
3335
+ super();
3336
+ this.opacityRate = 1;
3337
+ this.sizeRate = 1;
3338
+ this.velocityRate = 1;
3339
+ }
3340
+ load(data) {
3341
+ super.load(data);
3342
+ if (!data) {
3343
+ return;
3344
+ }
3345
+ if (data.opacityRate !== undefined) {
3346
+ this.opacityRate = data.opacityRate;
3347
+ }
3348
+ if (data.sizeRate !== undefined) {
3349
+ this.sizeRate = data.sizeRate;
3350
+ }
3351
+ if (data.velocityRate !== undefined) {
3352
+ this.velocityRate = data.velocityRate;
3353
+ }
3354
+ }
3355
+ }
3356
+ class ParticlesOptions_ParticlesOptions {
3357
+ constructor() {
3358
+ this.bounce = new Bounce;
3359
+ this.collisions = new Collisions;
3360
+ this.color = new AnimatableColor;
3361
+ this.destroy = new Destroy;
3362
+ this.gradient = [];
3363
+ this.groups = {};
3364
+ this.life = new Life;
3365
+ this.links = new Links;
3366
+ this.move = new Move;
3367
+ this.number = new ParticlesNumber;
3368
+ this.opacity = new Opacity;
3369
+ this.orbit = new Orbit;
3370
+ this.reduceDuplicates = false;
3371
+ this.repulse = new Repulse;
3372
+ this.roll = new Roll;
3373
+ this.rotate = new Rotate;
3374
+ this.shadow = new Shadow;
3375
+ this.shape = new Shape;
3376
+ this.size = new Size;
3377
+ this.stroke = new Stroke;
3378
+ this.tilt = new Tilt;
3379
+ this.twinkle = new Twinkle;
3380
+ this.wobble = new Wobble;
3381
+ this.zIndex = new ZIndex;
3382
+ }
3383
+ get line_linked() {
3384
+ return this.links;
3385
+ }
3386
+ set line_linked(value) {
3387
+ this.links = value;
3388
+ }
3389
+ get lineLinked() {
3390
+ return this.links;
3391
+ }
3392
+ set lineLinked(value) {
3393
+ this.links = value;
3394
+ }
3395
+ load(data) {
3396
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3397
+ if (data === undefined) {
3398
+ return;
3399
+ }
3400
+ this.bounce.load(data.bounce);
3401
+ this.color.load(AnimatableColor.create(this.color, data.color));
3402
+ this.destroy.load(data.destroy);
3403
+ this.life.load(data.life);
3404
+ const links = (_b = (_a = data.links) !== null && _a !== void 0 ? _a : data.lineLinked) !== null && _b !== void 0 ? _b : data.line_linked;
3405
+ if (links !== undefined) {
3406
+ this.links.load(links);
3407
+ }
3408
+ if (data.groups !== undefined) {
3409
+ for (const group in data.groups) {
3410
+ const item = data.groups[group];
3411
+ if (item !== undefined) {
3412
+ this.groups[group] = deepExtend((_c = this.groups[group]) !== null && _c !== void 0 ? _c : {}, item);
3413
+ }
3414
+ }
3415
+ }
3416
+ this.move.load(data.move);
3417
+ this.number.load(data.number);
3418
+ this.opacity.load(data.opacity);
3419
+ this.orbit.load(data.orbit);
3420
+ if (data.reduceDuplicates !== undefined) {
3421
+ this.reduceDuplicates = data.reduceDuplicates;
3422
+ }
3423
+ this.repulse.load(data.repulse);
3424
+ this.roll.load(data.roll);
3425
+ this.rotate.load(data.rotate);
3426
+ this.shape.load(data.shape);
3427
+ this.size.load(data.size);
3428
+ this.shadow.load(data.shadow);
3429
+ this.tilt.load(data.tilt);
3430
+ this.twinkle.load(data.twinkle);
3431
+ this.wobble.load(data.wobble);
3432
+ this.zIndex.load(data.zIndex);
3433
+ 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;
3434
+ if (collisions !== undefined) {
3435
+ this.collisions.enable = collisions;
3436
+ }
3437
+ this.collisions.load(data.collisions);
3438
+ const strokeToLoad = (_g = data.stroke) !== null && _g !== void 0 ? _g : (_h = data.shape) === null || _h === void 0 ? void 0 : _h.stroke;
3439
+ if (strokeToLoad) {
3440
+ if (strokeToLoad instanceof Array) {
3441
+ this.stroke = strokeToLoad.map((s => {
3442
+ const tmp = new Stroke;
3443
+ tmp.load(s);
3444
+ return tmp;
3445
+ }));
3446
+ } else {
3447
+ if (this.stroke instanceof Array) {
3448
+ this.stroke = new Stroke;
3449
+ }
3450
+ this.stroke.load(strokeToLoad);
3451
+ }
3452
+ }
3453
+ const gradientToLoad = data.gradient;
3454
+ if (gradientToLoad) {
3455
+ if (gradientToLoad instanceof Array) {
3456
+ this.gradient = gradientToLoad.map((s => {
3457
+ const tmp = new AnimatableGradient;
3458
+ tmp.load(s);
3459
+ return tmp;
3460
+ }));
3461
+ } else {
3462
+ if (this.gradient instanceof Array) {
3463
+ this.gradient = new AnimatableGradient;
3464
+ }
3465
+ this.gradient.load(gradientToLoad);
3466
+ }
3467
+ }
3468
+ }
3469
+ }
3470
+ class Responsive_Responsive {
3471
+ constructor() {
3472
+ this.maxWidth = Infinity;
3473
+ this.options = {};
3474
+ this.mode = "canvas";
3475
+ }
3476
+ load(data) {
3477
+ if (!data) {
3478
+ return;
3479
+ }
3480
+ if (data.maxWidth !== undefined) {
3481
+ this.maxWidth = data.maxWidth;
3482
+ }
3483
+ if (data.mode !== undefined) {
3484
+ if (data.mode === "screen") {
3485
+ this.mode = "screen";
3486
+ } else {
3487
+ this.mode = "canvas";
3488
+ }
3489
+ }
3490
+ if (data.options !== undefined) {
3491
+ this.options = deepExtend({}, data.options);
3492
+ }
3493
+ }
3494
+ }
3495
+ class Theme_Theme {
3496
+ constructor() {
3497
+ this.name = "";
3498
+ this.default = new ThemeDefault;
3499
+ }
3500
+ load(data) {
3501
+ if (data === undefined) {
3502
+ return;
3503
+ }
3504
+ if (data.name !== undefined) {
3505
+ this.name = data.name;
3506
+ }
3507
+ this.default.load(data.default);
3508
+ if (data.options !== undefined) {
3509
+ this.options = deepExtend({}, data.options);
3510
+ }
3511
+ }
3512
+ }
3513
+ var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
3514
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3515
+ 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");
3516
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
3517
+ };
3518
+ var _Options_instances, _Options_findDefaultTheme;
3519
+ class Options_Options {
3520
+ constructor() {
3521
+ _Options_instances.add(this);
3522
+ this.autoPlay = true;
3523
+ this.background = new Background;
3524
+ this.backgroundMask = new BackgroundMask;
3525
+ this.fullScreen = new FullScreen;
3526
+ this.detectRetina = true;
3527
+ this.duration = 0;
3528
+ this.fpsLimit = 60;
3529
+ this.interactivity = new Interactivity;
3530
+ this.manualParticles = [];
3531
+ this.motion = new Motion;
3532
+ this.particles = new ParticlesOptions;
3533
+ this.pauseOnBlur = true;
3534
+ this.pauseOnOutsideViewport = true;
3535
+ this.responsive = [];
3536
+ this.style = {};
3537
+ this.themes = [];
3538
+ this.zLayers = 100;
3539
+ }
3540
+ get fps_limit() {
3541
+ return this.fpsLimit;
3542
+ }
3543
+ set fps_limit(value) {
3544
+ this.fpsLimit = value;
3545
+ }
3546
+ get retina_detect() {
3547
+ return this.detectRetina;
3548
+ }
3549
+ set retina_detect(value) {
3550
+ this.detectRetina = value;
3551
+ }
3552
+ get backgroundMode() {
3553
+ return this.fullScreen;
3554
+ }
3555
+ set backgroundMode(value) {
3556
+ this.fullScreen.load(value);
3557
+ }
3558
+ load(data) {
3559
+ var _a, _b, _c, _d, _e;
3560
+ if (data === undefined) {
3561
+ return;
3562
+ }
3563
+ if (data.preset !== undefined) {
3564
+ if (data.preset instanceof Array) {
3565
+ for (const preset of data.preset) {
3566
+ this.importPreset(preset);
3567
+ }
3568
+ } else {
3569
+ this.importPreset(data.preset);
3570
+ }
3571
+ }
3572
+ if (data.autoPlay !== undefined) {
3573
+ this.autoPlay = data.autoPlay;
3574
+ }
3575
+ const detectRetina = (_a = data.detectRetina) !== null && _a !== void 0 ? _a : data.retina_detect;
3576
+ if (detectRetina !== undefined) {
3577
+ this.detectRetina = detectRetina;
3578
+ }
3579
+ if (data.duration !== undefined) {
3580
+ this.duration = data.duration;
3581
+ }
3582
+ const fpsLimit = (_b = data.fpsLimit) !== null && _b !== void 0 ? _b : data.fps_limit;
3583
+ if (fpsLimit !== undefined) {
3584
+ this.fpsLimit = fpsLimit;
3585
+ }
3586
+ if (data.pauseOnBlur !== undefined) {
3587
+ this.pauseOnBlur = data.pauseOnBlur;
3588
+ }
3589
+ if (data.pauseOnOutsideViewport !== undefined) {
3590
+ this.pauseOnOutsideViewport = data.pauseOnOutsideViewport;
3591
+ }
3592
+ if (data.zLayers !== undefined) {
3593
+ this.zLayers = data.zLayers;
3594
+ }
3595
+ this.background.load(data.background);
3596
+ const fullScreen = (_c = data.fullScreen) !== null && _c !== void 0 ? _c : data.backgroundMode;
3597
+ if (typeof fullScreen === "boolean") {
3598
+ this.fullScreen.enable = fullScreen;
3599
+ } else {
3600
+ this.fullScreen.load(fullScreen);
3601
+ }
3602
+ this.backgroundMask.load(data.backgroundMask);
3603
+ this.interactivity.load(data.interactivity);
3604
+ if (data.manualParticles !== undefined) {
3605
+ this.manualParticles = data.manualParticles.map((t => {
3606
+ const tmp = new ManualParticle;
3607
+ tmp.load(t);
3608
+ return tmp;
3609
+ }));
3610
+ }
3611
+ this.motion.load(data.motion);
3612
+ this.particles.load(data.particles);
3613
+ this.style = deepExtend(this.style, data.style);
3614
+ Plugins.loadOptions(this, data);
3615
+ if (data.responsive !== undefined) {
3616
+ for (const responsive of data.responsive) {
3617
+ const optResponsive = new Responsive;
3618
+ optResponsive.load(responsive);
3619
+ this.responsive.push(optResponsive);
3620
+ }
3621
+ }
3622
+ this.responsive.sort(((a, b) => a.maxWidth - b.maxWidth));
3623
+ if (data.themes !== undefined) {
3624
+ for (const theme of data.themes) {
3625
+ const optTheme = new Theme;
3626
+ optTheme.load(theme);
3627
+ this.themes.push(optTheme);
3628
+ }
3629
+ }
3630
+ this.defaultDarkTheme = (_d = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "dark")) === null || _d === void 0 ? void 0 : _d.name;
3631
+ this.defaultLightTheme = (_e = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "light")) === null || _e === void 0 ? void 0 : _e.name;
3632
+ }
3633
+ setTheme(name) {
3634
+ if (name) {
3635
+ const chosenTheme = this.themes.find((theme => theme.name === name));
3636
+ if (chosenTheme) {
3637
+ this.load(chosenTheme.options);
3638
+ }
3639
+ } else {
3640
+ 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");
3641
+ if (defaultTheme) {
3642
+ this.load(defaultTheme.options);
3643
+ }
3644
+ }
3645
+ }
3646
+ setResponsive(width, pxRatio, defaultOptions) {
3647
+ this.load(defaultOptions);
3648
+ const responsiveOptions = this.responsive.find((t => t.mode === "screen" && screen ? t.maxWidth * pxRatio > screen.availWidth : t.maxWidth * pxRatio > width));
3649
+ this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
3650
+ return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
3651
+ }
3652
+ importPreset(preset) {
3653
+ this.load(Plugins.getPreset(preset));
3654
+ }
3655
+ }
3656
+ _Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
3657
+ var _a;
3658
+ 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"));
3659
+ };
3660
+ const fixOutMode = data => {
3661
+ if (isInArray(data.outMode, data.checkModes) || isInArray(data.outMode, data.checkModes)) {
3662
+ if (data.coord > data.maxCoord - data.radius * 2) {
3663
+ data.setCb(-data.radius);
3664
+ } else if (data.coord < data.radius * 2) {
3665
+ data.setCb(data.radius);
3666
+ }
3667
+ }
3668
+ };
3669
+ class Particle_Particle {
3670
+ constructor(id, container, position, overrideOptions, group) {
3671
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
3672
+ this.id = id;
3673
+ this.container = container;
3674
+ this.group = group;
3675
+ this.fill = true;
3676
+ this.close = true;
3677
+ this.lastPathTime = 0;
3678
+ this.destroyed = false;
3679
+ this.unbreakable = false;
3680
+ this.splitCount = 0;
3681
+ this.misplaced = false;
3682
+ this.retina = {
3683
+ maxDistance: {}
3684
+ };
3685
+ const pxRatio = container.retina.pixelRatio;
3686
+ const mainOptions = container.actualOptions;
3687
+ const particlesOptions = new ParticlesOptions;
3688
+ particlesOptions.load(mainOptions.particles);
3689
+ const shapeType = particlesOptions.shape.type;
3690
+ const reduceDuplicates = particlesOptions.reduceDuplicates;
3691
+ this.shape = shapeType instanceof Array ? itemFromArray(shapeType, this.id, reduceDuplicates) : shapeType;
3692
+ if (overrideOptions === null || overrideOptions === void 0 ? void 0 : overrideOptions.shape) {
3693
+ if (overrideOptions.shape.type) {
3694
+ const overrideShapeType = overrideOptions.shape.type;
3695
+ this.shape = overrideShapeType instanceof Array ? itemFromArray(overrideShapeType, this.id, reduceDuplicates) : overrideShapeType;
3696
+ }
3697
+ const shapeOptions = new Shape;
3698
+ shapeOptions.load(overrideOptions.shape);
3699
+ if (this.shape) {
3700
+ this.shapeData = this.loadShapeData(shapeOptions, reduceDuplicates);
3701
+ }
3702
+ } else {
3703
+ this.shapeData = this.loadShapeData(particlesOptions.shape, reduceDuplicates);
3704
+ }
3705
+ if (overrideOptions !== undefined) {
3706
+ particlesOptions.load(overrideOptions);
3707
+ }
3708
+ if (((_a = this.shapeData) === null || _a === void 0 ? void 0 : _a.particles) !== undefined) {
3709
+ particlesOptions.load((_b = this.shapeData) === null || _b === void 0 ? void 0 : _b.particles);
3710
+ }
3711
+ this.fill = (_d = (_c = this.shapeData) === null || _c === void 0 ? void 0 : _c.fill) !== null && _d !== void 0 ? _d : this.fill;
3712
+ this.close = (_f = (_e = this.shapeData) === null || _e === void 0 ? void 0 : _e.close) !== null && _f !== void 0 ? _f : this.close;
3713
+ this.options = particlesOptions;
3714
+ this.pathDelay = getValue(this.options.move.path.delay) * 1e3;
3715
+ const zIndexValue = getRangeValue(this.options.zIndex.value);
3716
+ container.retina.initParticle(this);
3717
+ const sizeOptions = this.options.size, sizeRange = sizeOptions.value;
3718
+ this.size = {
3719
+ enable: sizeOptions.animation.enable,
3720
+ value: getValue(sizeOptions) * container.retina.pixelRatio,
3721
+ max: getRangeMax(sizeRange) * pxRatio,
3722
+ min: getRangeMin(sizeRange) * pxRatio,
3723
+ loops: 0,
3724
+ maxLoops: sizeOptions.animation.count
3725
+ };
3726
+ const sizeAnimation = sizeOptions.animation;
3727
+ if (sizeAnimation.enable) {
3728
+ this.size.status = 0;
3729
+ switch (sizeAnimation.startValue) {
3730
+ case "min":
3731
+ this.size.value = this.size.min;
3732
+ this.size.status = 0;
3733
+ break;
3734
+
3735
+ case "random":
3736
+ this.size.value = randomInRange(this.size) * pxRatio;
3737
+ this.size.status = Math.random() >= .5 ? 0 : 1;
3738
+ break;
3739
+
3740
+ case "max":
3741
+ default:
3742
+ this.size.value = this.size.max;
3743
+ this.size.status = 1;
3744
+ break;
3745
+ }
3746
+ this.size.velocity = ((_g = this.retina.sizeAnimationSpeed) !== null && _g !== void 0 ? _g : container.retina.sizeAnimationSpeed) / 100 * container.retina.reduceFactor;
3747
+ if (!sizeAnimation.sync) {
3748
+ this.size.velocity *= Math.random();
3749
+ }
3750
+ }
3751
+ this.direction = getParticleDirectionAngle(this.options.move.direction);
3752
+ this.bubble = {
3753
+ inRange: false
3754
+ };
3755
+ this.initialVelocity = this.calculateVelocity();
3756
+ this.velocity = this.initialVelocity.copy();
3757
+ this.moveDecay = 1 - getRangeValue(this.options.move.decay);
3758
+ this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
3759
+ this.initialPosition = this.position.copy();
3760
+ this.offset = Vector.origin;
3761
+ const particles = container.particles;
3762
+ particles.needsSort = particles.needsSort || particles.lastZIndex < this.position.z;
3763
+ particles.lastZIndex = this.position.z;
3764
+ this.zIndexFactor = this.position.z / container.zLayers;
3765
+ this.sides = 24;
3766
+ let drawer = container.drawers.get(this.shape);
3767
+ if (!drawer) {
3768
+ drawer = Plugins.getShapeDrawer(this.shape);
3769
+ if (drawer) {
3770
+ container.drawers.set(this.shape, drawer);
3771
+ }
3772
+ }
3773
+ if (drawer === null || drawer === void 0 ? void 0 : drawer.loadShape) {
3774
+ drawer === null || drawer === void 0 ? void 0 : drawer.loadShape(this);
3775
+ }
3776
+ const sideCountFunc = drawer === null || drawer === void 0 ? void 0 : drawer.getSidesCount;
3777
+ if (sideCountFunc) {
3778
+ this.sides = sideCountFunc(this);
3779
+ }
3780
+ this.life = this.loadLife();
3781
+ this.spawning = this.life.delay > 0;
3782
+ if (this.options.move.spin.enable) {
3783
+ const spinPos = (_h = this.options.move.spin.position) !== null && _h !== void 0 ? _h : {
3784
+ x: 50,
3785
+ y: 50
3786
+ };
3787
+ const spinCenter = {
3788
+ x: spinPos.x / 100 * container.canvas.size.width,
3789
+ y: spinPos.y / 100 * container.canvas.size.height
3790
+ };
3791
+ const pos = this.getPosition();
3792
+ const distance = getDistance(pos, spinCenter);
3793
+ this.spin = {
3794
+ center: spinCenter,
3795
+ direction: this.velocity.x >= 0 ? "clockwise" : "counter-clockwise",
3796
+ angle: this.velocity.angle,
3797
+ radius: distance,
3798
+ acceleration: (_j = this.retina.spinAcceleration) !== null && _j !== void 0 ? _j : getRangeValue(this.options.move.spin.acceleration)
3799
+ };
3800
+ }
3801
+ this.shadowColor = colorToRgb(this.options.shadow.color);
3802
+ for (const updater of container.particles.updaters) {
3803
+ if (updater.init) {
3804
+ updater.init(this);
3805
+ }
3806
+ }
3807
+ if (drawer && drawer.particleInit) {
3808
+ drawer.particleInit(container, this);
3809
+ }
3810
+ for (const [, plugin] of container.plugins) {
3811
+ if (plugin.particleCreated) {
3812
+ plugin.particleCreated(this);
3813
+ }
3814
+ }
3815
+ }
3816
+ isVisible() {
3817
+ return !this.destroyed && !this.spawning && this.isInsideCanvas();
3818
+ }
3819
+ isInsideCanvas() {
3820
+ const radius = this.getRadius();
3821
+ const canvasSize = this.container.canvas.size;
3822
+ return this.position.x >= -radius && this.position.y >= -radius && this.position.y <= canvasSize.height + radius && this.position.x <= canvasSize.width + radius;
3823
+ }
3824
+ draw(delta) {
3825
+ const container = this.container;
3826
+ for (const [, plugin] of container.plugins) {
3827
+ container.canvas.drawParticlePlugin(plugin, this, delta);
3828
+ }
3829
+ container.canvas.drawParticle(this, delta);
3830
+ }
3831
+ getPosition() {
3832
+ return {
3833
+ x: this.position.x + this.offset.x,
3834
+ y: this.position.y + this.offset.y,
3835
+ z: this.position.z
3836
+ };
3837
+ }
3838
+ getRadius() {
3839
+ var _a;
3840
+ return (_a = this.bubble.radius) !== null && _a !== void 0 ? _a : this.size.value;
3841
+ }
3842
+ getMass() {
3843
+ return this.getRadius() ** 2 * Math.PI / 2;
3844
+ }
3845
+ getFillColor() {
3846
+ var _a, _b, _c;
3847
+ const color = (_a = this.bubble.color) !== null && _a !== void 0 ? _a : getHslFromAnimation(this.color);
3848
+ if (color && this.roll && (this.backColor || this.roll.alter)) {
3849
+ 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;
3850
+ if (rolled) {
3851
+ if (this.backColor) {
3852
+ return this.backColor;
3853
+ }
3854
+ if (this.roll.alter) {
3855
+ return alterHsl(color, this.roll.alter.type, this.roll.alter.value);
3856
+ }
3857
+ }
3858
+ }
3859
+ return color;
3860
+ }
3861
+ getStrokeColor() {
3862
+ var _a, _b;
3863
+ return (_b = (_a = this.bubble.color) !== null && _a !== void 0 ? _a : getHslFromAnimation(this.strokeColor)) !== null && _b !== void 0 ? _b : this.getFillColor();
3864
+ }
3865
+ destroy(override) {
3866
+ this.destroyed = true;
3867
+ this.bubble.inRange = false;
3868
+ if (this.unbreakable) {
3869
+ return;
3870
+ }
3871
+ this.destroyed = true;
3872
+ this.bubble.inRange = false;
3873
+ for (const [, plugin] of this.container.plugins) {
3874
+ if (plugin.particleDestroyed) {
3875
+ plugin.particleDestroyed(this, override);
3876
+ }
3877
+ }
3878
+ if (override) {
3879
+ return;
3880
+ }
3881
+ const destroyOptions = this.options.destroy;
3882
+ if (destroyOptions.mode === "split") {
3883
+ this.split();
3884
+ }
3885
+ }
3886
+ reset() {
3887
+ if (this.opacity) {
3888
+ this.opacity.loops = 0;
3889
+ }
3890
+ this.size.loops = 0;
3891
+ }
3892
+ split() {
3893
+ const splitOptions = this.options.destroy.split;
3894
+ if (splitOptions.count >= 0 && this.splitCount++ > splitOptions.count) {
3895
+ return;
3896
+ }
3897
+ const rate = getRangeValue(splitOptions.rate.value);
3898
+ for (let i = 0; i < rate; i++) {
3899
+ this.container.particles.addSplitParticle(this);
3900
+ }
3901
+ }
3902
+ calcPosition(container, position, zIndex, tryCount = 0) {
3903
+ var _a, _b, _c, _d, _e, _f;
3904
+ for (const [, plugin] of container.plugins) {
3905
+ const pluginPos = plugin.particlePosition !== undefined ? plugin.particlePosition(position, this) : undefined;
3906
+ if (pluginPos !== undefined) {
3907
+ return Vector3d.create(pluginPos.x, pluginPos.y, zIndex);
3908
+ }
3909
+ }
3910
+ const canvasSize = container.canvas.size;
3911
+ 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);
3912
+ const radius = this.getRadius();
3913
+ const outModes = this.options.move.outModes, fixHorizontal = outMode => {
3914
+ fixOutMode({
3915
+ outMode: outMode,
3916
+ checkModes: [ "bounce", "bounce-horizontal" ],
3917
+ coord: pos.x,
3918
+ maxCoord: container.canvas.size.width,
3919
+ setCb: value => pos.x += value,
3920
+ radius: radius
3921
+ });
3922
+ }, fixVertical = outMode => {
3923
+ fixOutMode({
3924
+ outMode: outMode,
3925
+ checkModes: [ "bounce", "bounce-vertical" ],
3926
+ coord: pos.y,
3927
+ maxCoord: container.canvas.size.height,
3928
+ setCb: value => pos.y += value,
3929
+ radius: radius
3930
+ });
3931
+ };
3932
+ fixHorizontal((_c = outModes.left) !== null && _c !== void 0 ? _c : outModes.default);
3933
+ fixHorizontal((_d = outModes.right) !== null && _d !== void 0 ? _d : outModes.default);
3934
+ fixVertical((_e = outModes.top) !== null && _e !== void 0 ? _e : outModes.default);
3935
+ fixVertical((_f = outModes.bottom) !== null && _f !== void 0 ? _f : outModes.default);
3936
+ if (this.checkOverlap(pos, tryCount)) {
3937
+ return this.calcPosition(container, undefined, zIndex, tryCount + 1);
3938
+ }
3939
+ return pos;
3940
+ }
3941
+ checkOverlap(pos, tryCount = 0) {
3942
+ const collisionsOptions = this.options.collisions;
3943
+ const radius = this.getRadius();
3944
+ if (!collisionsOptions.enable) {
3945
+ return false;
3946
+ }
3947
+ const overlapOptions = collisionsOptions.overlap;
3948
+ if (overlapOptions.enable) {
3949
+ return false;
3950
+ }
3951
+ const retries = overlapOptions.retries;
3952
+ if (retries >= 0 && tryCount > retries) {
3953
+ throw new Error("Particle is overlapping and can't be placed");
3954
+ }
3955
+ let overlaps = false;
3956
+ for (const particle of this.container.particles.array) {
3957
+ if (getDistance(pos, particle.position) < radius + particle.getRadius()) {
3958
+ overlaps = true;
3959
+ break;
3960
+ }
3961
+ }
3962
+ return overlaps;
3963
+ }
3964
+ calculateVelocity() {
3965
+ const baseVelocity = getParticleBaseVelocity(this.direction);
3966
+ const res = baseVelocity.copy();
3967
+ const moveOptions = this.options.move;
3968
+ const rad = Math.PI / 180 * moveOptions.angle.value;
3969
+ const radOffset = Math.PI / 180 * moveOptions.angle.offset;
3970
+ const range = {
3971
+ left: radOffset - rad / 2,
3972
+ right: radOffset + rad / 2
3973
+ };
3974
+ if (!moveOptions.straight) {
3975
+ res.angle += randomInRange(setRangeValue(range.left, range.right));
3976
+ }
3977
+ if (moveOptions.random && typeof moveOptions.speed === "number") {
3978
+ res.length *= Math.random();
3979
+ }
3980
+ return res;
3981
+ }
3982
+ loadShapeData(shapeOptions, reduceDuplicates) {
3983
+ const shapeData = shapeOptions.options[this.shape];
3984
+ if (shapeData) {
3985
+ return deepExtend({}, shapeData instanceof Array ? itemFromArray(shapeData, this.id, reduceDuplicates) : shapeData);
3986
+ }
3987
+ }
3988
+ loadLife() {
3989
+ const container = this.container;
3990
+ const particlesOptions = this.options;
3991
+ const lifeOptions = particlesOptions.life;
3992
+ const life = {
3993
+ delay: container.retina.reduceFactor ? getRangeValue(lifeOptions.delay.value) * (lifeOptions.delay.sync ? 1 : Math.random()) / container.retina.reduceFactor * 1e3 : 0,
3994
+ delayTime: 0,
3995
+ duration: container.retina.reduceFactor ? getRangeValue(lifeOptions.duration.value) * (lifeOptions.duration.sync ? 1 : Math.random()) / container.retina.reduceFactor * 1e3 : 0,
3996
+ time: 0,
3997
+ count: particlesOptions.life.count
3998
+ };
3999
+ if (life.duration <= 0) {
4000
+ life.duration = -1;
4001
+ }
4002
+ if (life.count <= 0) {
4003
+ life.count = -1;
4004
+ }
4005
+ return life;
4006
+ }
4007
+ }
4008
+ class Particles_Particles {
4009
+ constructor(container) {
4010
+ this.container = container;
4011
+ this.nextId = 0;
4012
+ this.array = [];
4013
+ this.zArray = [];
4014
+ this.mover = new ParticlesMover(container);
4015
+ this.limit = 0;
4016
+ this.needsSort = false;
4017
+ this.lastZIndex = 0;
4018
+ this.freqs = {
4019
+ links: new Map,
4020
+ triangles: new Map
4021
+ };
4022
+ this.interactionManager = new InteractionManager(container);
4023
+ const canvasSize = this.container.canvas.size;
4024
+ this.linksColors = new Map;
4025
+ this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
4026
+ this.updaters = Plugins.getUpdaters(container, true);
4027
+ }
4028
+ get count() {
4029
+ return this.array.length;
4030
+ }
4031
+ init() {
4032
+ var _a;
4033
+ const container = this.container;
4034
+ const options = container.actualOptions;
4035
+ this.lastZIndex = 0;
4036
+ this.needsSort = false;
4037
+ this.freqs.links = new Map;
4038
+ this.freqs.triangles = new Map;
4039
+ let handled = false;
4040
+ this.updaters = Plugins.getUpdaters(container, true);
4041
+ this.interactionManager.init();
4042
+ for (const [, plugin] of container.plugins) {
4043
+ if (plugin.particlesInitialization !== undefined) {
4044
+ handled = plugin.particlesInitialization();
4045
+ }
4046
+ if (handled) {
4047
+ break;
4048
+ }
4049
+ }
4050
+ this.addManualParticles();
4051
+ if (!handled) {
4052
+ for (const group in options.particles.groups) {
4053
+ const groupOptions = options.particles.groups[group];
4054
+ 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++,
4055
+ j++) {
4056
+ this.addParticle(undefined, groupOptions, group);
4057
+ }
4058
+ }
4059
+ for (let i = this.count; i < options.particles.number.value; i++) {
4060
+ this.addParticle();
4061
+ }
4062
+ }
4063
+ container.pathGenerator.init(container);
4064
+ }
4065
+ redraw() {
4066
+ this.clear();
4067
+ this.init();
4068
+ this.draw({
4069
+ value: 0,
4070
+ factor: 0
4071
+ });
4072
+ }
4073
+ removeAt(index, quantity = 1, group, override) {
4074
+ if (!(index >= 0 && index <= this.count)) {
4075
+ return;
4076
+ }
4077
+ let deleted = 0;
4078
+ for (let i = index; deleted < quantity && i < this.count; i++) {
4079
+ const particle = this.array[i];
4080
+ if (!particle || particle.group !== group) {
4081
+ continue;
4082
+ }
4083
+ particle.destroy(override);
4084
+ this.array.splice(i--, 1);
4085
+ const zIdx = this.zArray.indexOf(particle);
4086
+ this.zArray.splice(zIdx, 1);
4087
+ deleted++;
4088
+ }
4089
+ }
4090
+ remove(particle, group, override) {
4091
+ this.removeAt(this.array.indexOf(particle), undefined, group, override);
4092
+ }
4093
+ update(delta) {
4094
+ const container = this.container;
4095
+ const particlesToDelete = [];
4096
+ container.pathGenerator.update();
4097
+ for (const [, plugin] of container.plugins) {
4098
+ if (plugin.update !== undefined) {
4099
+ plugin.update(delta);
4100
+ }
4101
+ }
4102
+ for (const particle of this.array) {
4103
+ const resizeFactor = container.canvas.resizeFactor;
4104
+ if (resizeFactor) {
4105
+ particle.position.x *= resizeFactor.width;
4106
+ particle.position.y *= resizeFactor.height;
4107
+ }
4108
+ particle.bubble.inRange = false;
4109
+ for (const [, plugin] of this.container.plugins) {
4110
+ if (particle.destroyed) {
4111
+ break;
4112
+ }
4113
+ if (plugin.particleUpdate) {
4114
+ plugin.particleUpdate(particle, delta);
4115
+ }
4116
+ }
4117
+ this.mover.move(particle, delta);
4118
+ if (particle.destroyed) {
4119
+ particlesToDelete.push(particle);
4120
+ continue;
4121
+ }
4122
+ this.quadTree.insert(new Point(particle.getPosition(), particle));
4123
+ }
4124
+ for (const particle of particlesToDelete) {
4125
+ this.remove(particle);
4126
+ }
4127
+ this.interactionManager.externalInteract(delta);
4128
+ for (const particle of container.particles.array) {
4129
+ for (const updater of this.updaters) {
4130
+ updater.update(particle, delta);
4131
+ }
4132
+ if (!particle.destroyed && !particle.spawning) {
4133
+ this.interactionManager.particlesInteract(particle, delta);
4134
+ }
4135
+ }
4136
+ delete container.canvas.resizeFactor;
4137
+ }
4138
+ draw(delta) {
4139
+ const container = this.container;
4140
+ container.canvas.clear();
4141
+ const canvasSize = this.container.canvas.size;
4142
+ this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
4143
+ this.update(delta);
4144
+ if (this.needsSort) {
4145
+ this.zArray.sort(((a, b) => b.position.z - a.position.z || a.id - b.id));
4146
+ this.lastZIndex = this.zArray[this.zArray.length - 1].position.z;
4147
+ this.needsSort = false;
4148
+ }
4149
+ for (const [, plugin] of container.plugins) {
4150
+ container.canvas.drawPlugin(plugin, delta);
4151
+ }
4152
+ for (const p of this.zArray) {
4153
+ p.draw(delta);
4154
+ }
4155
+ }
4156
+ clear() {
4157
+ this.array = [];
4158
+ this.zArray = [];
4159
+ }
4160
+ push(nb, mouse, overrideOptions, group) {
4161
+ this.pushing = true;
4162
+ for (let i = 0; i < nb; i++) {
4163
+ this.addParticle(mouse === null || mouse === void 0 ? void 0 : mouse.position, overrideOptions, group);
4164
+ }
4165
+ this.pushing = false;
4166
+ }
4167
+ addParticle(position, overrideOptions, group) {
4168
+ const container = this.container, options = container.actualOptions, limit = options.particles.number.limit * container.density;
4169
+ if (limit > 0) {
4170
+ const countToRemove = this.count + 1 - limit;
4171
+ if (countToRemove > 0) {
4172
+ this.removeQuantity(countToRemove);
4173
+ }
4174
+ }
4175
+ return this.pushParticle(position, overrideOptions, group);
4176
+ }
4177
+ addSplitParticle(parent) {
4178
+ const splitOptions = parent.options.destroy.split, options = new ParticlesOptions;
4179
+ options.load(parent.options);
4180
+ const factor = getRangeValue(splitOptions.factor.value);
4181
+ options.color.load({
4182
+ value: {
4183
+ hsl: parent.getFillColor()
4184
+ }
4185
+ });
4186
+ if (typeof options.size.value === "number") {
4187
+ options.size.value /= factor;
4188
+ } else {
4189
+ options.size.value.min /= factor;
4190
+ options.size.value.max /= factor;
4191
+ }
4192
+ options.load(splitOptions.particles);
4193
+ const offset = splitOptions.sizeOffset ? setRangeValue(-parent.size.value, parent.size.value) : 0;
4194
+ const position = {
4195
+ x: parent.position.x + randomInRange(offset),
4196
+ y: parent.position.y + randomInRange(offset)
4197
+ };
4198
+ return this.pushParticle(position, options, parent.group, (particle => {
4199
+ if (particle.size.value < .5) {
4200
+ return false;
4201
+ }
4202
+ particle.velocity.length = randomInRange(setRangeValue(parent.velocity.length, particle.velocity.length));
4203
+ particle.splitCount = parent.splitCount + 1;
4204
+ particle.unbreakable = true;
4205
+ setTimeout((() => {
4206
+ particle.unbreakable = false;
4207
+ }), 500);
4208
+ return true;
4209
+ }));
4210
+ }
4211
+ removeQuantity(quantity, group) {
4212
+ this.removeAt(0, quantity, group);
4213
+ }
4214
+ getLinkFrequency(p1, p2) {
4215
+ const range = setRangeValue(p1.id, p2.id), key = `${getRangeMin(range)}_${getRangeMax(range)}`;
4216
+ let res = this.freqs.links.get(key);
4217
+ if (res === undefined) {
4218
+ res = Math.random();
4219
+ this.freqs.links.set(key, res);
4220
+ }
4221
+ return res;
4222
+ }
4223
+ getTriangleFrequency(p1, p2, p3) {
4224
+ let [id1, id2, id3] = [ p1.id, p2.id, p3.id ];
4225
+ if (id1 > id2) {
4226
+ [id2, id1] = [ id1, id2 ];
4227
+ }
4228
+ if (id2 > id3) {
4229
+ [id3, id2] = [ id2, id3 ];
4230
+ }
4231
+ if (id1 > id3) {
4232
+ [id3, id1] = [ id1, id3 ];
4233
+ }
4234
+ const key = `${id1}_${id2}_${id3}`;
4235
+ let res = this.freqs.triangles.get(key);
4236
+ if (res === undefined) {
4237
+ res = Math.random();
4238
+ this.freqs.triangles.set(key, res);
4239
+ }
4240
+ return res;
4241
+ }
4242
+ addManualParticles() {
4243
+ const container = this.container, options = container.actualOptions;
4244
+ for (const particle of options.manualParticles) {
4245
+ const pos = particle.position ? {
4246
+ x: particle.position.x * container.canvas.size.width / 100,
4247
+ y: particle.position.y * container.canvas.size.height / 100
4248
+ } : undefined;
4249
+ this.addParticle(pos, particle.options);
4250
+ }
4251
+ }
4252
+ setDensity() {
4253
+ const options = this.container.actualOptions;
4254
+ for (const group in options.particles.groups) {
4255
+ this.applyDensity(options.particles.groups[group], 0, group);
4256
+ }
4257
+ this.applyDensity(options.particles, options.manualParticles.length);
4258
+ }
4259
+ applyDensity(options, manualCount, group) {
4260
+ var _a;
4261
+ if (!((_a = options.number.density) === null || _a === void 0 ? void 0 : _a.enable)) {
4262
+ return;
4263
+ }
4264
+ const numberOptions = options.number;
4265
+ const densityFactor = this.initDensityFactor(numberOptions.density);
4266
+ const optParticlesNumber = numberOptions.value;
4267
+ const optParticlesLimit = numberOptions.limit > 0 ? numberOptions.limit : optParticlesNumber;
4268
+ const particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + manualCount;
4269
+ const particlesCount = Math.min(this.count, this.array.filter((t => t.group === group)).length);
4270
+ this.limit = numberOptions.limit * densityFactor;
4271
+ if (particlesCount < particlesNumber) {
4272
+ this.push(Math.abs(particlesNumber - particlesCount), undefined, options, group);
4273
+ } else if (particlesCount > particlesNumber) {
4274
+ this.removeQuantity(particlesCount - particlesNumber, group);
4275
+ }
4276
+ }
4277
+ initDensityFactor(densityOptions) {
4278
+ const container = this.container;
4279
+ if (!container.canvas.element || !densityOptions.enable) {
4280
+ return 1;
4281
+ }
4282
+ const canvas = container.canvas.element, pxRatio = container.retina.pixelRatio;
4283
+ return canvas.width * canvas.height / (densityOptions.factor * pxRatio ** 2 * densityOptions.area);
4284
+ }
4285
+ pushParticle(position, overrideOptions, group, initializer) {
4286
+ try {
4287
+ const particle = new Particle(this.nextId, this.container, position, overrideOptions, group);
4288
+ let canAdd = true;
4289
+ if (initializer) {
4290
+ canAdd = initializer(particle);
4291
+ }
4292
+ if (!canAdd) {
4293
+ return;
4294
+ }
4295
+ this.array.push(particle);
4296
+ this.zArray.push(particle);
4297
+ this.nextId++;
4298
+ return particle;
4299
+ } catch (e) {
4300
+ console.warn(`error adding particle: ${e}`);
4301
+ return;
4302
+ }
4303
+ }
4304
+ }
4305
+ class Retina_Retina {
4306
+ constructor(container) {
4307
+ this.container = container;
4308
+ }
4309
+ init() {
4310
+ const container = this.container;
4311
+ const options = container.actualOptions;
4312
+ this.pixelRatio = !options.detectRetina || isSsr() ? 1 : window.devicePixelRatio;
4313
+ const motionOptions = this.container.actualOptions.motion;
4314
+ if (motionOptions && (motionOptions.disable || motionOptions.reduce.value)) {
4315
+ if (isSsr() || typeof matchMedia === "undefined" || !matchMedia) {
4316
+ this.reduceFactor = 1;
4317
+ } else {
4318
+ const mediaQuery = matchMedia("(prefers-reduced-motion: reduce)");
4319
+ if (mediaQuery) {
4320
+ this.handleMotionChange(mediaQuery);
4321
+ const handleChange = () => {
4322
+ this.handleMotionChange(mediaQuery);
4323
+ container.refresh().catch((() => {}));
4324
+ };
4325
+ if (mediaQuery.addEventListener !== undefined) {
4326
+ mediaQuery.addEventListener("change", handleChange);
4327
+ } else if (mediaQuery.addListener !== undefined) {
4328
+ mediaQuery.addListener(handleChange);
4329
+ }
4330
+ }
4331
+ }
4332
+ } else {
4333
+ this.reduceFactor = 1;
4334
+ }
4335
+ const ratio = this.pixelRatio;
4336
+ if (container.canvas.element) {
4337
+ const element = container.canvas.element;
4338
+ container.canvas.size.width = element.offsetWidth * ratio;
4339
+ container.canvas.size.height = element.offsetHeight * ratio;
4340
+ }
4341
+ const particles = options.particles;
4342
+ this.attractDistance = particles.move.attract.distance * ratio;
4343
+ this.linksDistance = particles.links.distance * ratio;
4344
+ this.linksWidth = particles.links.width * ratio;
4345
+ this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
4346
+ this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
4347
+ if (particles.orbit.radius !== undefined) {
4348
+ this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
4349
+ }
4350
+ const modes = options.interactivity.modes;
4351
+ this.connectModeDistance = modes.connect.distance * ratio;
4352
+ this.connectModeRadius = modes.connect.radius * ratio;
4353
+ this.grabModeDistance = modes.grab.distance * ratio;
4354
+ this.repulseModeDistance = modes.repulse.distance * ratio;
4355
+ this.bounceModeDistance = modes.bounce.distance * ratio;
4356
+ this.attractModeDistance = modes.attract.distance * ratio;
4357
+ this.slowModeRadius = modes.slow.radius * ratio;
4358
+ this.bubbleModeDistance = modes.bubble.distance * ratio;
4359
+ if (modes.bubble.size) {
4360
+ this.bubbleModeSize = modes.bubble.size * ratio;
4361
+ }
4362
+ }
4363
+ initParticle(particle) {
4364
+ const options = particle.options;
4365
+ const ratio = this.pixelRatio;
4366
+ const moveDistance = options.move.distance;
4367
+ const props = particle.retina;
4368
+ props.attractDistance = options.move.attract.distance * ratio;
4369
+ props.linksDistance = options.links.distance * ratio;
4370
+ props.linksWidth = options.links.width * ratio;
4371
+ props.moveDrift = getRangeValue(options.move.drift) * ratio;
4372
+ props.moveSpeed = getRangeValue(options.move.speed) * ratio;
4373
+ props.sizeAnimationSpeed = options.size.animation.speed * ratio;
4374
+ if (particle.spin) {
4375
+ props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
4376
+ }
4377
+ const maxDistance = props.maxDistance;
4378
+ maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
4379
+ maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
4380
+ props.maxSpeed = options.move.gravity.maxSpeed * ratio;
4381
+ }
4382
+ handleMotionChange(mediaQuery) {
4383
+ const options = this.container.actualOptions;
4384
+ if (mediaQuery.matches) {
4385
+ const motion = options.motion;
4386
+ this.reduceFactor = motion.disable ? 0 : motion.reduce.value ? 1 / motion.reduce.factor : 1;
4387
+ } else {
4388
+ this.reduceFactor = 1;
4389
+ }
4390
+ }
4391
+ }
4392
+ class Container_Container {
4393
+ constructor(id, sourceOptions, ...presets) {
4394
+ this.id = id;
4395
+ this.fpsLimit = 60;
4396
+ this.duration = 0;
4397
+ this.lifeTime = 0;
4398
+ this.firstStart = true;
4399
+ this.started = false;
4400
+ this.destroyed = false;
4401
+ this.paused = true;
4402
+ this.lastFrameTime = 0;
4403
+ this.zLayers = 100;
4404
+ this.pageHidden = false;
4405
+ this._sourceOptions = sourceOptions;
4406
+ this._initialSourceOptions = sourceOptions;
4407
+ this.retina = new Retina(this);
4408
+ this.canvas = new Canvas(this);
4409
+ this.particles = new Particles(this);
4410
+ this.drawer = new FrameManager(this);
4411
+ this.presets = presets;
4412
+ this.pathGenerator = {
4413
+ generate: () => {
4414
+ const v = Vector.create(0, 0);
4415
+ v.length = Math.random();
4416
+ v.angle = Math.random() * Math.PI * 2;
4417
+ return v;
4418
+ },
4419
+ init: () => {},
4420
+ update: () => {}
4421
+ };
4422
+ this.interactivity = {
4423
+ mouse: {
4424
+ clicking: false,
4425
+ inside: false
4426
+ }
4427
+ };
4428
+ this.bubble = {};
4429
+ this.repulse = {
4430
+ particles: []
4431
+ };
4432
+ this.attract = {
4433
+ particles: []
4434
+ };
4435
+ this.plugins = new Map;
4436
+ this.drawers = new Map;
4437
+ this.density = 1;
4438
+ this._options = new Options;
4439
+ this.actualOptions = new Options;
4440
+ this.eventListeners = new EventListeners(this);
4441
+ if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
4442
+ this.intersectionObserver = new IntersectionObserver((entries => this.intersectionManager(entries)));
4443
+ }
4444
+ }
4445
+ get options() {
4446
+ return this._options;
4447
+ }
4448
+ get sourceOptions() {
4449
+ return this._sourceOptions;
4450
+ }
4451
+ play(force) {
4452
+ const needsUpdate = this.paused || force;
4453
+ if (this.firstStart && !this.actualOptions.autoPlay) {
4454
+ this.firstStart = false;
4455
+ return;
4456
+ }
4457
+ if (this.paused) {
4458
+ this.paused = false;
4459
+ }
4460
+ if (needsUpdate) {
4461
+ for (const [, plugin] of this.plugins) {
4462
+ if (plugin.play) {
4463
+ plugin.play();
4464
+ }
4465
+ }
4466
+ }
4467
+ this.draw(needsUpdate || false);
4468
+ }
4469
+ pause() {
4470
+ if (this.drawAnimationFrame !== undefined) {
4471
+ cancelAnimation()(this.drawAnimationFrame);
4472
+ delete this.drawAnimationFrame;
4473
+ }
4474
+ if (this.paused) {
4475
+ return;
4476
+ }
4477
+ for (const [, plugin] of this.plugins) {
4478
+ if (plugin.pause) {
4479
+ plugin.pause();
4480
+ }
4481
+ }
4482
+ if (!this.pageHidden) {
4483
+ this.paused = true;
4484
+ }
4485
+ }
4486
+ draw(force) {
4487
+ let refreshTime = force;
4488
+ this.drawAnimationFrame = animate()((timestamp => {
4489
+ if (refreshTime) {
4490
+ this.lastFrameTime = undefined;
4491
+ refreshTime = false;
4492
+ }
4493
+ this.drawer.nextFrame(timestamp);
4494
+ }));
4495
+ }
4496
+ getAnimationStatus() {
4497
+ return !this.paused && !this.pageHidden;
4498
+ }
4499
+ setNoise(noiseOrGenerator, init, update) {
4500
+ this.setPath(noiseOrGenerator, init, update);
4501
+ }
4502
+ setPath(pathOrGenerator, init, update) {
4503
+ if (!pathOrGenerator) {
4504
+ return;
4505
+ }
4506
+ if (typeof pathOrGenerator === "function") {
4507
+ this.pathGenerator.generate = pathOrGenerator;
4508
+ if (init) {
4509
+ this.pathGenerator.init = init;
4510
+ }
4511
+ if (update) {
4512
+ this.pathGenerator.update = update;
4513
+ }
4514
+ } else {
4515
+ if (pathOrGenerator.generate) {
4516
+ this.pathGenerator.generate = pathOrGenerator.generate;
4517
+ }
4518
+ if (pathOrGenerator.init) {
4519
+ this.pathGenerator.init = pathOrGenerator.init;
4520
+ }
4521
+ if (pathOrGenerator.update) {
4522
+ this.pathGenerator.update = pathOrGenerator.update;
4523
+ }
4524
+ }
4525
+ }
4526
+ destroy() {
4527
+ this.stop();
4528
+ this.canvas.destroy();
4529
+ for (const [, drawer] of this.drawers) {
4530
+ if (drawer.destroy) {
4531
+ drawer.destroy(this);
4532
+ }
4533
+ }
4534
+ for (const key of this.drawers.keys()) {
4535
+ this.drawers.delete(key);
4536
+ }
4537
+ this.destroyed = true;
4538
+ }
4539
+ exportImg(callback) {
4540
+ this.exportImage(callback);
4541
+ }
4542
+ exportImage(callback, type, quality) {
4543
+ var _a;
4544
+ return (_a = this.canvas.element) === null || _a === void 0 ? void 0 : _a.toBlob(callback, type !== null && type !== void 0 ? type : "image/png", quality);
4545
+ }
4546
+ exportConfiguration() {
4547
+ return JSON.stringify(this.actualOptions, undefined, 2);
4548
+ }
4549
+ refresh() {
4550
+ this.stop();
4551
+ return this.start();
4552
+ }
4553
+ reset() {
4554
+ this._options = new Options;
4555
+ return this.refresh();
4556
+ }
4557
+ stop() {
4558
+ if (!this.started) {
4559
+ return;
4560
+ }
4561
+ this.firstStart = true;
4562
+ this.started = false;
4563
+ this.eventListeners.removeListeners();
4564
+ this.pause();
4565
+ this.particles.clear();
4566
+ this.canvas.clear();
4567
+ if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
4568
+ this.intersectionObserver.observe(this.interactivity.element);
4569
+ }
4570
+ for (const [, plugin] of this.plugins) {
4571
+ if (plugin.stop) {
4572
+ plugin.stop();
4573
+ }
4574
+ }
4575
+ for (const key of this.plugins.keys()) {
4576
+ this.plugins.delete(key);
4577
+ }
4578
+ this.particles.linksColors = new Map;
4579
+ delete this.particles.grabLineColor;
4580
+ delete this.particles.linksColor;
4581
+ this._sourceOptions = this._options;
4582
+ }
4583
+ async loadTheme(name) {
4584
+ this.currentTheme = name;
4585
+ await this.refresh();
4586
+ }
4587
+ async start() {
4588
+ if (this.started) {
4589
+ return;
4590
+ }
4591
+ await this.init();
4592
+ this.started = true;
4593
+ this.eventListeners.addListeners();
4594
+ if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
4595
+ this.intersectionObserver.observe(this.interactivity.element);
4596
+ }
4597
+ for (const [, plugin] of this.plugins) {
4598
+ if (plugin.startAsync !== undefined) {
4599
+ await plugin.startAsync();
4600
+ } else if (plugin.start !== undefined) {
4601
+ plugin.start();
4602
+ }
4603
+ }
4604
+ this.play();
4605
+ }
4606
+ addClickHandler(callback) {
4607
+ const el = this.interactivity.element;
4608
+ if (!el) {
4609
+ return;
4610
+ }
4611
+ const clickOrTouchHandler = (e, pos, radius) => {
4612
+ if (this.destroyed) {
4613
+ return;
4614
+ }
4615
+ const pxRatio = this.retina.pixelRatio, posRetina = {
4616
+ x: pos.x * pxRatio,
4617
+ y: pos.y * pxRatio
4618
+ }, particles = this.particles.quadTree.queryCircle(posRetina, radius * pxRatio);
4619
+ callback(e, particles);
4620
+ };
4621
+ const clickHandler = e => {
4622
+ if (this.destroyed) {
4623
+ return;
4624
+ }
4625
+ const mouseEvent = e;
4626
+ const pos = {
4627
+ x: mouseEvent.offsetX || mouseEvent.clientX,
4628
+ y: mouseEvent.offsetY || mouseEvent.clientY
4629
+ };
4630
+ clickOrTouchHandler(e, pos, 1);
4631
+ };
4632
+ const touchStartHandler = () => {
4633
+ if (this.destroyed) {
4634
+ return;
4635
+ }
4636
+ touched = true;
4637
+ touchMoved = false;
4638
+ };
4639
+ const touchMoveHandler = () => {
4640
+ if (this.destroyed) {
4641
+ return;
4642
+ }
4643
+ touchMoved = true;
4644
+ };
4645
+ const touchEndHandler = e => {
4646
+ var _a, _b, _c;
4647
+ if (this.destroyed) {
4648
+ return;
4649
+ }
4650
+ if (touched && !touchMoved) {
4651
+ const touchEvent = e;
4652
+ let lastTouch = touchEvent.touches[touchEvent.touches.length - 1];
4653
+ if (!lastTouch) {
4654
+ lastTouch = touchEvent.changedTouches[touchEvent.changedTouches.length - 1];
4655
+ if (!lastTouch) {
4656
+ return;
4657
+ }
4658
+ }
4659
+ const canvasRect = (_a = this.canvas.element) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
4660
+ const pos = {
4661
+ x: lastTouch.clientX - ((_b = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.left) !== null && _b !== void 0 ? _b : 0),
4662
+ y: lastTouch.clientY - ((_c = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.top) !== null && _c !== void 0 ? _c : 0)
4663
+ };
4664
+ clickOrTouchHandler(e, pos, Math.max(lastTouch.radiusX, lastTouch.radiusY));
4665
+ }
4666
+ touched = false;
4667
+ touchMoved = false;
4668
+ };
4669
+ const touchCancelHandler = () => {
4670
+ if (this.destroyed) {
4671
+ return;
4672
+ }
4673
+ touched = false;
4674
+ touchMoved = false;
4675
+ };
4676
+ let touched = false;
4677
+ let touchMoved = false;
4678
+ el.addEventListener("click", clickHandler);
4679
+ el.addEventListener("touchstart", touchStartHandler);
4680
+ el.addEventListener("touchmove", touchMoveHandler);
4681
+ el.addEventListener("touchend", touchEndHandler);
4682
+ el.addEventListener("touchcancel", touchCancelHandler);
4683
+ }
4684
+ updateActualOptions() {
4685
+ this.actualOptions.responsive = [];
4686
+ const newMaxWidth = this.actualOptions.setResponsive(this.canvas.size.width, this.retina.pixelRatio, this._options);
4687
+ this.actualOptions.setTheme(this.currentTheme);
4688
+ if (this.responsiveMaxWidth != newMaxWidth) {
4689
+ this.responsiveMaxWidth = newMaxWidth;
4690
+ return true;
4691
+ }
4692
+ return false;
4693
+ }
4694
+ async init() {
4695
+ this._options = new Options;
4696
+ for (const preset of this.presets) {
4697
+ this._options.load(Plugins.getPreset(preset));
4698
+ }
4699
+ const shapes = Plugins.getSupportedShapes();
4700
+ for (const type of shapes) {
4701
+ const drawer = Plugins.getShapeDrawer(type);
4702
+ if (drawer) {
4703
+ this.drawers.set(type, drawer);
4704
+ }
4705
+ }
4706
+ this._options.load(this._initialSourceOptions);
4707
+ this._options.load(this._sourceOptions);
4708
+ this.actualOptions = new Options;
4709
+ this.actualOptions.load(this._options);
4710
+ this.retina.init();
4711
+ this.canvas.init();
4712
+ this.updateActualOptions();
4713
+ this.canvas.initBackground();
4714
+ this.canvas.resize();
4715
+ this.zLayers = this.actualOptions.zLayers;
4716
+ this.duration = getRangeValue(this.actualOptions.duration);
4717
+ this.lifeTime = 0;
4718
+ this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit : 60;
4719
+ const availablePlugins = Plugins.getAvailablePlugins(this);
4720
+ for (const [id, plugin] of availablePlugins) {
4721
+ this.plugins.set(id, plugin);
4722
+ }
4723
+ for (const [, drawer] of this.drawers) {
4724
+ if (drawer.init) {
4725
+ await drawer.init(this);
4726
+ }
4727
+ }
4728
+ for (const [, plugin] of this.plugins) {
4729
+ if (plugin.init) {
4730
+ plugin.init(this.actualOptions);
4731
+ } else if (plugin.initAsync !== undefined) {
4732
+ await plugin.initAsync(this.actualOptions);
4733
+ }
4734
+ }
4735
+ const pathOptions = this.actualOptions.particles.move.path;
4736
+ if (pathOptions.generator) {
4737
+ const customGenerator = Plugins.getPathGenerator(pathOptions.generator);
4738
+ if (customGenerator) {
4739
+ if (customGenerator.init) {
4740
+ this.pathGenerator.init = customGenerator.init;
4741
+ }
4742
+ if (customGenerator.generate) {
4743
+ this.pathGenerator.generate = customGenerator.generate;
4744
+ }
4745
+ if (customGenerator.update) {
4746
+ this.pathGenerator.update = customGenerator.update;
4747
+ }
4748
+ }
4749
+ }
4750
+ this.particles.init();
4751
+ this.particles.setDensity();
4752
+ for (const [, plugin] of this.plugins) {
4753
+ if (plugin.particlesSetup !== undefined) {
4754
+ plugin.particlesSetup();
4755
+ }
4756
+ }
4757
+ }
4758
+ intersectionManager(entries) {
4759
+ if (!this.actualOptions.pauseOnOutsideViewport) {
4760
+ return;
4761
+ }
4762
+ for (const entry of entries) {
4763
+ if (entry.target !== this.interactivity.element) {
4764
+ continue;
4765
+ }
4766
+ if (entry.isIntersecting) {
4767
+ this.play();
4768
+ } else {
4769
+ this.pause();
4770
+ }
4771
+ }
4772
+ }
4773
+ }
4774
+ const tsParticlesDom = null && [];
4775
+ function fetchError(statusCode) {
4776
+ console.error(`Error tsParticles - fetch status: ${statusCode}`);
4777
+ console.error("Error tsParticles - File config not found");
4778
+ }
4779
+ class Loader {
4780
+ static dom() {
4781
+ return tsParticlesDom;
4782
+ }
4783
+ static domItem(index) {
4784
+ const dom = Loader.dom();
4785
+ const item = dom[index];
4786
+ if (item && !item.destroyed) {
4787
+ return item;
4788
+ }
4789
+ dom.splice(index, 1);
4790
+ }
4791
+ static async loadOptions(params) {
4792
+ var _a, _b, _c;
4793
+ const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 1e4)}`;
4794
+ const {options: options, index: index} = params;
4795
+ let domContainer = (_b = params.element) !== null && _b !== void 0 ? _b : document.getElementById(tagId);
4796
+ if (!domContainer) {
4797
+ domContainer = document.createElement("div");
4798
+ domContainer.id = tagId;
4799
+ (_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
4800
+ }
4801
+ const currentOptions = options instanceof Array ? itemFromArray(options, index) : options;
4802
+ const dom = Loader.dom();
4803
+ const oldIndex = dom.findIndex((v => v.id === tagId));
4804
+ if (oldIndex >= 0) {
4805
+ const old = Loader.domItem(oldIndex);
4806
+ if (old && !old.destroyed) {
4807
+ old.destroy();
4808
+ dom.splice(oldIndex, 1);
4809
+ }
4810
+ }
4811
+ let canvasEl;
4812
+ if (domContainer.tagName.toLowerCase() === "canvas") {
4813
+ canvasEl = domContainer;
4814
+ canvasEl.dataset[Constants.generatedAttribute] = "false";
4815
+ } else {
4816
+ const existingCanvases = domContainer.getElementsByTagName("canvas");
4817
+ if (existingCanvases.length) {
4818
+ canvasEl = existingCanvases[0];
4819
+ canvasEl.dataset[Constants.generatedAttribute] = "false";
4820
+ } else {
4821
+ canvasEl = document.createElement("canvas");
4822
+ canvasEl.dataset[Constants.generatedAttribute] = "true";
4823
+ canvasEl.style.width = "100%";
4824
+ canvasEl.style.height = "100%";
4825
+ domContainer.appendChild(canvasEl);
4826
+ }
4827
+ }
4828
+ const newItem = new Container(tagId, currentOptions);
4829
+ if (oldIndex >= 0) {
4830
+ dom.splice(oldIndex, 0, newItem);
4831
+ } else {
4832
+ dom.push(newItem);
4833
+ }
4834
+ newItem.canvas.loadCanvas(canvasEl);
4835
+ await newItem.start();
4836
+ return newItem;
4837
+ }
4838
+ static async loadRemoteOptions(params) {
4839
+ const {url: jsonUrl, index: index} = params;
4840
+ const url = jsonUrl instanceof Array ? itemFromArray(jsonUrl, index) : jsonUrl;
4841
+ if (!url) {
4842
+ return;
4843
+ }
4844
+ const response = await fetch(url);
4845
+ if (!response.ok) {
4846
+ fetchError(response.status);
4847
+ return;
4848
+ }
4849
+ const data = await response.json();
4850
+ return await Loader.loadOptions({
4851
+ tagId: params.tagId,
4852
+ element: params.element,
4853
+ index: index,
4854
+ options: data
4855
+ });
4856
+ }
4857
+ static load(tagId, options, index) {
4858
+ const params = {
4859
+ index: index
4860
+ };
4861
+ if (typeof tagId === "string") {
4862
+ params.tagId = tagId;
4863
+ } else {
4864
+ params.options = tagId;
4865
+ }
4866
+ if (typeof options === "number") {
4867
+ params.index = options !== null && options !== void 0 ? options : params.index;
4868
+ } else {
4869
+ params.options = options !== null && options !== void 0 ? options : params.options;
4870
+ }
4871
+ return this.loadOptions(params);
4872
+ }
4873
+ static async set(id, domContainer, options, index) {
4874
+ const params = {
4875
+ index: index
4876
+ };
4877
+ if (typeof id === "string") {
4878
+ params.tagId = id;
4879
+ } else {
4880
+ params.element = id;
4881
+ }
4882
+ if (domContainer instanceof HTMLElement) {
4883
+ params.element = domContainer;
4884
+ } else {
4885
+ params.options = domContainer;
4886
+ }
4887
+ if (typeof options === "number") {
4888
+ params.index = options;
4889
+ } else {
4890
+ params.options = options !== null && options !== void 0 ? options : params.options;
4891
+ }
4892
+ return this.loadOptions(params);
4893
+ }
4894
+ static async loadJSON(tagId, jsonUrl, index) {
4895
+ let url, id;
4896
+ if (typeof jsonUrl === "number" || jsonUrl === undefined) {
4897
+ url = tagId;
4898
+ } else {
4899
+ id = tagId;
4900
+ url = jsonUrl;
4901
+ }
4902
+ return await Loader.loadRemoteOptions({
4903
+ tagId: id,
4904
+ url: url,
4905
+ index: index
4906
+ });
4907
+ }
4908
+ static async setJSON(id, domContainer, jsonUrl, index) {
4909
+ let url, newId, newIndex, element;
4910
+ if (id instanceof HTMLElement) {
4911
+ element = id;
4912
+ url = domContainer;
4913
+ newIndex = jsonUrl;
4914
+ } else {
4915
+ newId = id;
4916
+ element = domContainer;
4917
+ url = jsonUrl;
4918
+ newIndex = index;
4919
+ }
4920
+ return await Loader.loadRemoteOptions({
4921
+ tagId: newId,
4922
+ url: url,
4923
+ index: newIndex,
4924
+ element: element
4925
+ });
4926
+ }
4927
+ static setOnClickHandler(callback) {
4928
+ const dom = Loader.dom();
4929
+ if (dom.length === 0) {
4930
+ throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");
4931
+ }
4932
+ for (const domItem of dom) {
4933
+ domItem.addClickHandler(callback);
4934
+ }
4935
+ }
4936
+ }
4937
+ class Bouncer extends ExternalInteractorBase {
4938
+ constructor(container) {
4939
+ super(container);
4940
+ }
4941
+ isEnabled() {
4942
+ const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = options.interactivity.events, divs = events.onDiv;
4943
+ return mouse.position && events.onHover.enable && Utils_isInArray("bounce", events.onHover.mode) || isDivModeEnabled("bounce", divs);
4944
+ }
4945
+ interact() {
4946
+ const container = this.container, options = container.actualOptions, events = options.interactivity.events, mouseMoveStatus = container.interactivity.status === Constants_Constants.mouseMoveEvent, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, divs = events.onDiv;
4947
+ if (mouseMoveStatus && hoverEnabled && Utils_isInArray("bounce", hoverMode)) {
4948
+ this.processMouseBounce();
4949
+ } else {
4950
+ divModeExecute("bounce", divs, ((selector, div) => this.singleSelectorBounce(selector, div)));
4951
+ }
4952
+ }
4953
+ reset() {}
4954
+ processMouseBounce() {
4955
+ const container = this.container, pxRatio = container.retina.pixelRatio, tolerance = 10 * pxRatio, mousePos = container.interactivity.mouse.position, radius = container.retina.bounceModeDistance;
4956
+ if (mousePos) {
4957
+ this.processBounce(mousePos, radius, new Circle_Circle(mousePos.x, mousePos.y, radius + tolerance));
4958
+ }
4959
+ }
4960
+ singleSelectorBounce(selector, div) {
4961
+ const container = this.container;
4962
+ const query = document.querySelectorAll(selector);
4963
+ if (!query.length) {
4964
+ return;
4965
+ }
4966
+ query.forEach((item => {
4967
+ const elem = item, pxRatio = container.retina.pixelRatio, pos = {
4968
+ x: (elem.offsetLeft + elem.offsetWidth / 2) * pxRatio,
4969
+ y: (elem.offsetTop + elem.offsetHeight / 2) * pxRatio
4970
+ }, radius = elem.offsetWidth / 2 * pxRatio, tolerance = 10 * pxRatio;
4971
+ const area = div.type === "circle" ? new Circle_Circle(pos.x, pos.y, radius + tolerance) : new Rectangle_Rectangle(elem.offsetLeft * pxRatio - tolerance, elem.offsetTop * pxRatio - tolerance, elem.offsetWidth * pxRatio + tolerance * 2, elem.offsetHeight * pxRatio + tolerance * 2);
4972
+ this.processBounce(pos, radius, area);
4973
+ }));
4974
+ }
4975
+ processBounce(position, radius, area) {
4976
+ const query = this.container.particles.quadTree.query(area);
4977
+ for (const particle of query) {
4978
+ if (area instanceof Circle_Circle) {
4979
+ circleBounce(circleBounceDataFromParticle(particle), {
4980
+ position: position,
4981
+ radius: radius,
4982
+ mass: radius ** 2 * Math.PI / 2,
4983
+ velocity: Vector_Vector.origin,
4984
+ factor: Vector_Vector.origin
4985
+ });
4986
+ } else if (area instanceof Rectangle_Rectangle) {
4987
+ rectBounce(particle, calculateBounds(position, radius));
4988
+ }
4989
+ }
4990
+ }
4991
+ }
4992
+ async function loadExternalBounceInteraction(engine) {
4993
+ await engine.addInteractor("externalBounce", (container => new Bouncer(container)));
4994
+ }
4995
+ return __webpack_exports__;
4996
+ }();
4997
+ }));