@tsparticles/fireworks 3.2.2 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/browser/fireworks.js +22 -12
  2. package/cjs/fireworks.js +29 -42
  3. package/esm/fireworks.js +22 -12
  4. package/package.json +10 -10
  5. package/report.html +1 -1
  6. package/tsparticles.fireworks.bundle.js +944 -302
  7. package/tsparticles.fireworks.bundle.min.js +1 -1
  8. package/tsparticles.fireworks.bundle.min.js.LICENSE.txt +1 -1
  9. package/tsparticles.fireworks.js +6 -36
  10. package/tsparticles.fireworks.min.js +1 -1
  11. package/tsparticles.fireworks.min.js.LICENSE.txt +1 -1
  12. package/types/fireworks.d.ts +6 -1
  13. package/umd/fireworks.js +30 -44
  14. package/108.min.js +0 -2
  15. package/108.min.js.LICENSE.txt +0 -1
  16. package/120.min.js +0 -2
  17. package/120.min.js.LICENSE.txt +0 -1
  18. package/126.min.js +0 -2
  19. package/126.min.js.LICENSE.txt +0 -1
  20. package/132.min.js +0 -2
  21. package/132.min.js.LICENSE.txt +0 -1
  22. package/141.min.js +0 -2
  23. package/141.min.js.LICENSE.txt +0 -1
  24. package/163.min.js +0 -2
  25. package/163.min.js.LICENSE.txt +0 -1
  26. package/173.min.js +0 -2
  27. package/173.min.js.LICENSE.txt +0 -1
  28. package/196.min.js +0 -2
  29. package/196.min.js.LICENSE.txt +0 -1
  30. package/245.min.js +0 -2
  31. package/245.min.js.LICENSE.txt +0 -1
  32. package/274.min.js +0 -2
  33. package/274.min.js.LICENSE.txt +0 -1
  34. package/30.min.js +0 -2
  35. package/30.min.js.LICENSE.txt +0 -1
  36. package/308.min.js +0 -2
  37. package/308.min.js.LICENSE.txt +0 -1
  38. package/31.min.js +0 -2
  39. package/31.min.js.LICENSE.txt +0 -1
  40. package/328.min.js +0 -2
  41. package/328.min.js.LICENSE.txt +0 -1
  42. package/329.min.js +0 -2
  43. package/329.min.js.LICENSE.txt +0 -1
  44. package/376.min.js +0 -2
  45. package/376.min.js.LICENSE.txt +0 -1
  46. package/468.min.js +0 -2
  47. package/468.min.js.LICENSE.txt +0 -1
  48. package/49.min.js +0 -2
  49. package/49.min.js.LICENSE.txt +0 -1
  50. package/547.min.js +0 -2
  51. package/547.min.js.LICENSE.txt +0 -1
  52. package/560.min.js +0 -2
  53. package/560.min.js.LICENSE.txt +0 -1
  54. package/580.min.js +0 -2
  55. package/580.min.js.LICENSE.txt +0 -1
  56. package/610.min.js +0 -2
  57. package/610.min.js.LICENSE.txt +0 -1
  58. package/647.min.js +0 -2
  59. package/647.min.js.LICENSE.txt +0 -1
  60. package/648.min.js +0 -2
  61. package/648.min.js.LICENSE.txt +0 -1
  62. package/720.min.js +0 -2
  63. package/720.min.js.LICENSE.txt +0 -1
  64. package/725.min.js +0 -2
  65. package/725.min.js.LICENSE.txt +0 -1
  66. package/749.min.js +0 -2
  67. package/749.min.js.LICENSE.txt +0 -1
  68. package/757.min.js +0 -2
  69. package/757.min.js.LICENSE.txt +0 -1
  70. package/81.min.js +0 -2
  71. package/81.min.js.LICENSE.txt +0 -1
  72. package/835.min.js +0 -2
  73. package/835.min.js.LICENSE.txt +0 -1
  74. package/837.min.js +0 -2
  75. package/837.min.js.LICENSE.txt +0 -1
  76. package/859.min.js +0 -2
  77. package/859.min.js.LICENSE.txt +0 -1
  78. package/866.min.js +0 -2
  79. package/866.min.js.LICENSE.txt +0 -1
  80. package/88.min.js +0 -2
  81. package/88.min.js.LICENSE.txt +0 -1
  82. package/886.min.js +0 -2
  83. package/886.min.js.LICENSE.txt +0 -1
  84. package/921.min.js +0 -2
  85. package/921.min.js.LICENSE.txt +0 -1
  86. package/929.min.js +0 -2
  87. package/929.min.js.LICENSE.txt +0 -1
  88. package/937.min.js +0 -2
  89. package/937.min.js.LICENSE.txt +0 -1
  90. package/952.min.js +0 -2
  91. package/952.min.js.LICENSE.txt +0 -1
  92. package/973.min.js +0 -2
  93. package/973.min.js.LICENSE.txt +0 -1
  94. package/994.min.js +0 -2
  95. package/994.min.js.LICENSE.txt +0 -1
  96. package/basic_dist_browser_index_js.js +0 -30
  97. package/effects_trail_dist_browser_TrailDrawer_js.js +0 -30
  98. package/effects_trail_dist_browser_index_js.js +0 -30
  99. package/engine_dist_browser_Core_Container_js.js +0 -90
  100. package/engine_dist_browser_Core_Particle_js.js +0 -30
  101. package/move_base_dist_browser_BaseMover_js.js +0 -30
  102. package/move_base_dist_browser_Utils_js.js +0 -30
  103. package/move_base_dist_browser_index_js.js +0 -30
  104. package/plugins_emittersShapes_square_dist_browser_EmittersSquareShapeGenerator_js.js +0 -120
  105. package/plugins_emittersShapes_square_dist_browser_index_js.js +0 -30
  106. package/plugins_emitters_dist_browser_EmitterInstance_js.js +0 -30
  107. package/plugins_emitters_dist_browser_EmittersPlugin_js.js +0 -90
  108. package/plugins_emitters_dist_browser_Emitters_js.js +0 -30
  109. package/plugins_emitters_dist_browser_ShapeManager_js.js +0 -30
  110. package/plugins_emitters_dist_browser_index_js.js +0 -100
  111. package/plugins_sounds_dist_browser_SoundsInstance_js.js +0 -30
  112. package/plugins_sounds_dist_browser_SoundsPlugin_js.js +0 -120
  113. package/plugins_sounds_dist_browser_index_js.js +0 -30
  114. package/shapes_circle_dist_browser_CircleDrawer_js.js +0 -30
  115. package/shapes_circle_dist_browser_Utils_js.js +0 -30
  116. package/shapes_circle_dist_browser_index_js.js +0 -30
  117. package/updaters_color_dist_browser_ColorUpdater_js.js +0 -30
  118. package/updaters_color_dist_browser_index_js.js +0 -30
  119. package/updaters_destroy_dist_browser_DestroyUpdater_js.js +0 -90
  120. package/updaters_destroy_dist_browser_index_js.js +0 -30
  121. package/updaters_life_dist_browser_LifeUpdater_js.js +0 -60
  122. package/updaters_life_dist_browser_Utils_js.js +0 -30
  123. package/updaters_life_dist_browser_index_js.js +0 -30
  124. package/updaters_opacity_dist_browser_OpacityUpdater_js.js +0 -30
  125. package/updaters_opacity_dist_browser_index_js.js +0 -30
  126. package/updaters_outModes_dist_browser_BounceOutMode_js.js +0 -30
  127. package/updaters_outModes_dist_browser_DestroyOutMode_js.js +0 -30
  128. package/updaters_outModes_dist_browser_NoneOutMode_js.js +0 -30
  129. package/updaters_outModes_dist_browser_OutOfCanvasUpdater_js.js +0 -30
  130. package/updaters_outModes_dist_browser_OutOutMode_js.js +0 -30
  131. package/updaters_outModes_dist_browser_Utils_js.js +0 -30
  132. package/updaters_outModes_dist_browser_index_js.js +0 -30
  133. package/updaters_rotate_dist_browser_RotateUpdater_js.js +0 -50
  134. package/updaters_rotate_dist_browser_index_js.js +0 -30
  135. package/updaters_size_dist_browser_SizeUpdater_js.js +0 -30
  136. package/updaters_size_dist_browser_index_js.js +0 -30
@@ -1,30 +0,0 @@
1
- /*!
2
- * Author : Matteo Bruni
3
- * MIT license: https://opensource.org/licenses/MIT
4
- * Demo / Generator : https://particles.js.org/
5
- * GitHub : https://www.github.com/matteobruni/tsparticles
6
- * How to use? : Check the GitHub README
7
- * v3.2.2
8
- */
9
- "use strict";
10
- /*
11
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
- * This devtool is neither made for production nor for readable output files.
13
- * It uses "eval()" calls to create a separate source file in the browser devtools.
14
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
- * or disable the default devtool with "devtool: false".
16
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
- */
18
- (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["plugins_emitters_dist_browser_EmitterInstance_js"],{
19
-
20
- /***/ "../../plugins/emitters/dist/browser/EmitterInstance.js":
21
- /*!**************************************************************!*\
22
- !*** ../../plugins/emitters/dist/browser/EmitterInstance.js ***!
23
- \**************************************************************/
24
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
-
26
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterInstance: () => (/* binding */ EmitterInstance)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n/* harmony import */ var _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Emitter.js */ \"../../plugins/emitters/dist/browser/Options/Classes/Emitter.js\");\n/* harmony import */ var _Options_Classes_EmitterSize_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/EmitterSize.js */ \"../../plugins/emitters/dist/browser/Options/Classes/EmitterSize.js\");\n\n\n\nconst half = 0.5,\n defaultLifeDelay = 0,\n minLifeCount = 0,\n defaultSpawnDelay = 0,\n defaultEmitDelay = 0,\n defaultLifeCount = -1,\n defaultColorAnimationFactor = 1;\nfunction setParticlesOptionsColor(particlesOptions, color) {\n if (particlesOptions.color) {\n particlesOptions.color.value = color;\n } else {\n particlesOptions.color = {\n value: color\n };\n }\n}\nclass EmitterInstance {\n constructor(engine, emitters, container, options, position) {\n this.emitters = emitters;\n this.container = container;\n this._destroy = () => {\n this._mutationObserver?.disconnect();\n this._mutationObserver = undefined;\n this._resizeObserver?.disconnect();\n this._resizeObserver = undefined;\n this.emitters.removeEmitter(this);\n this._engine.dispatchEvent(\"emitterDestroyed\", {\n container: this.container,\n data: {\n emitter: this\n }\n });\n };\n this._prepareToDie = () => {\n if (this._paused) {\n return;\n }\n const duration = this.options.life?.duration !== undefined ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.life.duration) : undefined,\n minDuration = 0,\n minLifeCount = 0;\n if (this.container.retina.reduceFactor && (this._lifeCount > minLifeCount || this._immortal) && duration !== undefined && duration > minDuration) {\n this._duration = duration * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds;\n }\n };\n this._setColorAnimation = (animation, initValue, maxValue, factor = defaultColorAnimationFactor) => {\n const container = this.container;\n if (!animation.enable) {\n return initValue;\n }\n const colorOffset = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)(animation.offset),\n delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.rate.delay),\n emitFactor = delay * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds / container.retina.reduceFactor,\n defaultColorSpeed = 0,\n colorSpeed = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(animation.speed ?? defaultColorSpeed);\n return (initValue + colorSpeed * container.fpsLimit / emitFactor + colorOffset * factor) % maxValue;\n };\n this._engine = engine;\n this._currentDuration = 0;\n this._currentEmitDelay = 0;\n this._currentSpawnDelay = 0;\n this._initialPosition = position;\n if (options instanceof _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter) {\n this.options = options;\n } else {\n this.options = new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter();\n this.options.load(options);\n }\n this._spawnDelay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.life.delay ?? defaultLifeDelay) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds / this.container.retina.reduceFactor;\n this.position = this._initialPosition ?? this._calcPosition();\n this.name = this.options.name;\n this.fill = this.options.fill;\n this._firstSpawn = !this.options.life.wait;\n this._startParticlesAdded = false;\n let particlesOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, this.options.particles);\n particlesOptions ??= {};\n particlesOptions.move ??= {};\n particlesOptions.move.direction ??= this.options.direction;\n if (this.options.spawnColor) {\n this.spawnColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(this.options.spawnColor);\n }\n this._paused = !this.options.autoPlay;\n this._particlesOptions = particlesOptions;\n this._size = this._calcSize();\n this.size = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getSize)(this._size, this.container.canvas.size);\n this._lifeCount = this.options.life.count ?? defaultLifeCount;\n this._immortal = this._lifeCount <= minLifeCount;\n if (this.options.domId) {\n const element = document.getElementById(this.options.domId);\n if (element) {\n this._mutationObserver = new MutationObserver(() => {\n this.resize();\n });\n this._resizeObserver = new ResizeObserver(() => {\n this.resize();\n });\n this._mutationObserver.observe(element, {\n attributes: true,\n attributeFilter: [\"style\", \"width\", \"height\"]\n });\n this._resizeObserver.observe(element);\n }\n }\n const shapeOptions = this.options.shape,\n shapeGenerator = this._engine.emitterShapeManager?.getShapeGenerator(shapeOptions.type);\n if (shapeGenerator) {\n this._shape = shapeGenerator.generate(this.position, this.size, this.fill, shapeOptions.options);\n }\n this._engine.dispatchEvent(\"emitterCreated\", {\n container,\n data: {\n emitter: this\n }\n });\n this.play();\n }\n externalPause() {\n this._paused = true;\n this.pause();\n }\n externalPlay() {\n this._paused = false;\n this.play();\n }\n async init() {\n await this._shape?.init();\n }\n pause() {\n if (this._paused) {\n return;\n }\n delete this._emitDelay;\n }\n play() {\n if (this._paused) {\n return;\n }\n if (!(this.container.retina.reduceFactor && (this._lifeCount > minLifeCount || this._immortal || !this.options.life.count) && (this._firstSpawn || this._currentSpawnDelay >= (this._spawnDelay ?? defaultSpawnDelay)))) {\n return;\n }\n if (this._emitDelay === undefined) {\n const delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.rate.delay);\n this._emitDelay = delay * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds / this.container.retina.reduceFactor;\n }\n if (this._lifeCount > minLifeCount || this._immortal) {\n this._prepareToDie();\n }\n }\n resize() {\n const initialPosition = this._initialPosition;\n this.position = initialPosition && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isPointInside)(initialPosition, this.container.canvas.size, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Vector.origin) ? initialPosition : this._calcPosition();\n this._size = this._calcSize();\n this.size = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getSize)(this._size, this.container.canvas.size);\n this._shape?.resize(this.position, this.size);\n }\n async update(delta) {\n if (this._paused) {\n return;\n }\n if (this._firstSpawn) {\n this._firstSpawn = false;\n this._currentSpawnDelay = this._spawnDelay ?? defaultSpawnDelay;\n this._currentEmitDelay = this._emitDelay ?? defaultEmitDelay;\n }\n if (!this._startParticlesAdded) {\n this._startParticlesAdded = true;\n await this._emitParticles(this.options.startCount);\n }\n if (this._duration !== undefined) {\n this._currentDuration += delta.value;\n if (this._currentDuration >= this._duration) {\n this.pause();\n if (this._spawnDelay !== undefined) {\n delete this._spawnDelay;\n }\n if (!this._immortal) {\n this._lifeCount--;\n }\n if (this._lifeCount > minLifeCount || this._immortal) {\n this.position = this._calcPosition();\n this._shape?.resize(this.position, this.size);\n this._spawnDelay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.life.delay ?? defaultLifeDelay) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds / this.container.retina.reduceFactor;\n } else {\n this._destroy();\n }\n this._currentDuration -= this._duration;\n delete this._duration;\n }\n }\n if (this._spawnDelay !== undefined) {\n this._currentSpawnDelay += delta.value;\n if (this._currentSpawnDelay >= this._spawnDelay) {\n this._engine.dispatchEvent(\"emitterPlay\", {\n container: this.container\n });\n this.play();\n this._currentSpawnDelay -= this._currentSpawnDelay;\n delete this._spawnDelay;\n }\n }\n if (this._emitDelay !== undefined) {\n this._currentEmitDelay += delta.value;\n if (this._currentEmitDelay >= this._emitDelay) {\n await this._emit();\n this._currentEmitDelay -= this._emitDelay;\n }\n }\n }\n _calcPosition() {\n if (this.options.domId) {\n const element = document.getElementById(this.options.domId);\n if (element) {\n const elRect = element.getBoundingClientRect(),\n pxRatio = this.container.retina.pixelRatio;\n return {\n x: (elRect.x + elRect.width * half) * pxRatio,\n y: (elRect.y + elRect.height * half) * pxRatio\n };\n }\n }\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.calcPositionOrRandomFromSizeRanged)({\n size: this.container.canvas.size,\n position: this.options.position\n });\n }\n _calcSize() {\n const container = this.container;\n if (this.options.domId) {\n const element = document.getElementById(this.options.domId);\n if (element) {\n const elRect = element.getBoundingClientRect();\n return {\n width: elRect.width * container.retina.pixelRatio,\n height: elRect.height * container.retina.pixelRatio,\n mode: \"precise\"\n };\n }\n }\n return this.options.size ?? (() => {\n const size = new _Options_Classes_EmitterSize_js__WEBPACK_IMPORTED_MODULE_2__.EmitterSize();\n size.load({\n height: 0,\n mode: \"percent\",\n width: 0\n });\n return size;\n })();\n }\n async _emit() {\n if (this._paused) {\n return;\n }\n const quantity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.rate.quantity);\n await this._emitParticles(quantity);\n }\n async _emitParticles(quantity) {\n const singleParticlesOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(this._particlesOptions);\n for (let i = 0; i < quantity; i++) {\n const particlesOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, singleParticlesOptions);\n if (this.spawnColor) {\n const hslAnimation = this.options.spawnColor?.animation;\n if (hslAnimation) {\n const maxValues = {\n h: 360,\n s: 100,\n l: 100\n },\n colorFactor = 3.6;\n this.spawnColor.h = this._setColorAnimation(hslAnimation.h, this.spawnColor.h, maxValues.h, colorFactor);\n this.spawnColor.s = this._setColorAnimation(hslAnimation.s, this.spawnColor.s, maxValues.s);\n this.spawnColor.l = this._setColorAnimation(hslAnimation.l, this.spawnColor.l, maxValues.l);\n }\n setParticlesOptionsColor(particlesOptions, this.spawnColor);\n }\n const shapeOptions = this.options.shape;\n let position = this.position;\n if (this._shape) {\n const shapePosData = await this._shape.randomPosition();\n if (shapePosData) {\n position = shapePosData.position;\n const replaceData = shapeOptions.replace;\n if (replaceData.color && shapePosData.color) {\n setParticlesOptionsColor(particlesOptions, shapePosData.color);\n }\n if (replaceData.opacity) {\n if (particlesOptions.opacity) {\n particlesOptions.opacity.value = shapePosData.opacity;\n } else {\n particlesOptions.opacity = {\n value: shapePosData.opacity\n };\n }\n }\n } else {\n position = null;\n }\n }\n if (position) {\n await this.container.particles.addParticle(position, particlesOptions);\n }\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/EmitterInstance.js?");
27
-
28
- /***/ })
29
-
30
- }]);
@@ -1,90 +0,0 @@
1
- /*!
2
- * Author : Matteo Bruni
3
- * MIT license: https://opensource.org/licenses/MIT
4
- * Demo / Generator : https://particles.js.org/
5
- * GitHub : https://www.github.com/matteobruni/tsparticles
6
- * How to use? : Check the GitHub README
7
- * v3.2.2
8
- */
9
- "use strict";
10
- /*
11
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
- * This devtool is neither made for production nor for readable output files.
13
- * It uses "eval()" calls to create a separate source file in the browser devtools.
14
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
- * or disable the default devtool with "devtool: false".
16
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
- */
18
- (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["plugins_emitters_dist_browser_EmittersPlugin_js"],{
19
-
20
- /***/ "../../plugins/emitters/dist/browser/EmittersPlugin.js":
21
- /*!*************************************************************!*\
22
- !*** ../../plugins/emitters/dist/browser/EmittersPlugin.js ***!
23
- \*************************************************************/
24
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
-
26
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmittersPlugin: () => (/* binding */ EmittersPlugin)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n/* harmony import */ var _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Emitter.js */ \"../../plugins/emitters/dist/browser/Options/Classes/Emitter.js\");\n\n\nclass EmittersPlugin {\n constructor(engine) {\n this._engine = engine;\n this.id = \"emitters\";\n }\n async getPlugin(container) {\n const {\n Emitters\n } = await __webpack_require__.e(/*! import() */ \"plugins_emitters_dist_browser_Emitters_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Emitters.js */ \"../../plugins/emitters/dist/browser/Emitters.js\"));\n return new Emitters(this._engine, container);\n }\n loadOptions(options, source) {\n if (!this.needsPlugin(options) && !this.needsPlugin(source)) {\n return;\n }\n if (source?.emitters) {\n options.emitters = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(source.emitters, emitter => {\n const tmp = new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter();\n tmp.load(emitter);\n return tmp;\n });\n }\n const interactivityEmitters = source?.interactivity?.modes?.emitters;\n if (interactivityEmitters) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(interactivityEmitters)) {\n options.interactivity.modes.emitters = {\n random: {\n count: 1,\n enable: true\n },\n value: interactivityEmitters.map(s => {\n const tmp = new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter();\n tmp.load(s);\n return tmp;\n })\n };\n } else {\n const emitterMode = interactivityEmitters;\n if (emitterMode.value !== undefined) {\n const defaultCount = 1;\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(emitterMode.value)) {\n options.interactivity.modes.emitters = {\n random: {\n count: emitterMode.random.count ?? defaultCount,\n enable: emitterMode.random.enable ?? false\n },\n value: emitterMode.value.map(s => {\n const tmp = new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter();\n tmp.load(s);\n return tmp;\n })\n };\n } else {\n const tmp = new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter();\n tmp.load(emitterMode.value);\n options.interactivity.modes.emitters = {\n random: {\n count: emitterMode.random.count ?? defaultCount,\n enable: emitterMode.random.enable ?? false\n },\n value: tmp\n };\n }\n } else {\n const emitterOptions = options.interactivity.modes.emitters = {\n random: {\n count: 1,\n enable: false\n },\n value: new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter()\n };\n emitterOptions.value.load(interactivityEmitters);\n }\n }\n }\n }\n needsPlugin(options) {\n if (!options) {\n return false;\n }\n const emitters = options.emitters;\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(emitters) && !!emitters.length || emitters !== undefined || !!options.interactivity?.events?.onClick?.mode && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(\"emitter\", options.interactivity.events.onClick.mode);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/EmittersPlugin.js?");
27
-
28
- /***/ }),
29
-
30
- /***/ "../../plugins/emitters/dist/browser/Options/Classes/Emitter.js":
31
- /*!**********************************************************************!*\
32
- !*** ../../plugins/emitters/dist/browser/Options/Classes/Emitter.js ***!
33
- \**********************************************************************/
34
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35
-
36
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Emitter: () => (/* binding */ Emitter)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n/* harmony import */ var _EmitterLife_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EmitterLife.js */ \"../../plugins/emitters/dist/browser/Options/Classes/EmitterLife.js\");\n/* harmony import */ var _EmitterRate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EmitterRate.js */ \"../../plugins/emitters/dist/browser/Options/Classes/EmitterRate.js\");\n/* harmony import */ var _EmitterShape_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./EmitterShape.js */ \"../../plugins/emitters/dist/browser/Options/Classes/EmitterShape.js\");\n/* harmony import */ var _EmitterSize_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./EmitterSize.js */ \"../../plugins/emitters/dist/browser/Options/Classes/EmitterSize.js\");\n\n\n\n\n\nclass Emitter {\n constructor() {\n this.autoPlay = true;\n this.fill = true;\n this.life = new _EmitterLife_js__WEBPACK_IMPORTED_MODULE_1__.EmitterLife();\n this.rate = new _EmitterRate_js__WEBPACK_IMPORTED_MODULE_2__.EmitterRate();\n this.shape = new _EmitterShape_js__WEBPACK_IMPORTED_MODULE_3__.EmitterShape();\n this.startCount = 0;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.autoPlay !== undefined) {\n this.autoPlay = data.autoPlay;\n }\n if (data.size !== undefined) {\n if (!this.size) {\n this.size = new _EmitterSize_js__WEBPACK_IMPORTED_MODULE_4__.EmitterSize();\n }\n this.size.load(data.size);\n }\n if (data.direction !== undefined) {\n this.direction = data.direction;\n }\n this.domId = data.domId;\n if (data.fill !== undefined) {\n this.fill = data.fill;\n }\n this.life.load(data.life);\n this.name = data.name;\n this.particles = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(data.particles, particles => {\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, particles);\n });\n this.rate.load(data.rate);\n this.shape.load(data.shape);\n if (data.position !== undefined) {\n this.position = {};\n if (data.position.x !== undefined) {\n this.position.x = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.position.x);\n }\n if (data.position.y !== undefined) {\n this.position.y = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.position.y);\n }\n }\n if (data.spawnColor !== undefined) {\n if (this.spawnColor === undefined) {\n this.spawnColor = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor();\n }\n this.spawnColor.load(data.spawnColor);\n }\n if (data.startCount !== undefined) {\n this.startCount = data.startCount;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Options/Classes/Emitter.js?");
37
-
38
- /***/ }),
39
-
40
- /***/ "../../plugins/emitters/dist/browser/Options/Classes/EmitterLife.js":
41
- /*!**************************************************************************!*\
42
- !*** ../../plugins/emitters/dist/browser/Options/Classes/EmitterLife.js ***!
43
- \**************************************************************************/
44
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
45
-
46
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterLife: () => (/* binding */ EmitterLife)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass EmitterLife {\n constructor() {\n this.wait = false;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.count !== undefined) {\n this.count = data.count;\n }\n if (data.delay !== undefined) {\n this.delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.delay);\n }\n if (data.duration !== undefined) {\n this.duration = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.duration);\n }\n if (data.wait !== undefined) {\n this.wait = data.wait;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Options/Classes/EmitterLife.js?");
47
-
48
- /***/ }),
49
-
50
- /***/ "../../plugins/emitters/dist/browser/Options/Classes/EmitterRate.js":
51
- /*!**************************************************************************!*\
52
- !*** ../../plugins/emitters/dist/browser/Options/Classes/EmitterRate.js ***!
53
- \**************************************************************************/
54
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
55
-
56
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterRate: () => (/* binding */ EmitterRate)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass EmitterRate {\n constructor() {\n this.quantity = 1;\n this.delay = 0.1;\n }\n load(data) {\n if (data === undefined) {\n return;\n }\n if (data.quantity !== undefined) {\n this.quantity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.quantity);\n }\n if (data.delay !== undefined) {\n this.delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.delay);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Options/Classes/EmitterRate.js?");
57
-
58
- /***/ }),
59
-
60
- /***/ "../../plugins/emitters/dist/browser/Options/Classes/EmitterShape.js":
61
- /*!***************************************************************************!*\
62
- !*** ../../plugins/emitters/dist/browser/Options/Classes/EmitterShape.js ***!
63
- \***************************************************************************/
64
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
65
-
66
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterShape: () => (/* binding */ EmitterShape)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n/* harmony import */ var _EmitterShapeReplace_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EmitterShapeReplace.js */ \"../../plugins/emitters/dist/browser/Options/Classes/EmitterShapeReplace.js\");\n\n\nclass EmitterShape {\n constructor() {\n this.options = {};\n this.replace = new _EmitterShapeReplace_js__WEBPACK_IMPORTED_MODULE_1__.EmitterShapeReplace();\n this.type = \"square\";\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.options !== undefined) {\n this.options = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, data.options ?? {});\n }\n this.replace.load(data.replace);\n if (data.type !== undefined) {\n this.type = data.type;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Options/Classes/EmitterShape.js?");
67
-
68
- /***/ }),
69
-
70
- /***/ "../../plugins/emitters/dist/browser/Options/Classes/EmitterShapeReplace.js":
71
- /*!**********************************************************************************!*\
72
- !*** ../../plugins/emitters/dist/browser/Options/Classes/EmitterShapeReplace.js ***!
73
- \**********************************************************************************/
74
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
75
-
76
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterShapeReplace: () => (/* binding */ EmitterShapeReplace)\n/* harmony export */ });\nclass EmitterShapeReplace {\n constructor() {\n this.color = false;\n this.opacity = false;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.color !== undefined) {\n this.color = data.color;\n }\n if (data.opacity !== undefined) {\n this.opacity = data.opacity;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Options/Classes/EmitterShapeReplace.js?");
77
-
78
- /***/ }),
79
-
80
- /***/ "../../plugins/emitters/dist/browser/Options/Classes/EmitterSize.js":
81
- /*!**************************************************************************!*\
82
- !*** ../../plugins/emitters/dist/browser/Options/Classes/EmitterSize.js ***!
83
- \**************************************************************************/
84
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
85
-
86
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterSize: () => (/* binding */ EmitterSize)\n/* harmony export */ });\nclass EmitterSize {\n constructor() {\n this.mode = \"percent\";\n this.height = 0;\n this.width = 0;\n }\n load(data) {\n if (data === undefined) {\n return;\n }\n if (data.mode !== undefined) {\n this.mode = data.mode;\n }\n if (data.height !== undefined) {\n this.height = data.height;\n }\n if (data.width !== undefined) {\n this.width = data.width;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Options/Classes/EmitterSize.js?");
87
-
88
- /***/ })
89
-
90
- }]);
@@ -1,30 +0,0 @@
1
- /*!
2
- * Author : Matteo Bruni
3
- * MIT license: https://opensource.org/licenses/MIT
4
- * Demo / Generator : https://particles.js.org/
5
- * GitHub : https://www.github.com/matteobruni/tsparticles
6
- * How to use? : Check the GitHub README
7
- * v3.2.2
8
- */
9
- "use strict";
10
- /*
11
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
- * This devtool is neither made for production nor for readable output files.
13
- * It uses "eval()" calls to create a separate source file in the browser devtools.
14
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
- * or disable the default devtool with "devtool: false".
16
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
- */
18
- (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["plugins_emitters_dist_browser_Emitters_js"],{
19
-
20
- /***/ "../../plugins/emitters/dist/browser/Emitters.js":
21
- /*!*******************************************************!*\
22
- !*** ../../plugins/emitters/dist/browser/Emitters.js ***!
23
- \*******************************************************/
24
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
-
26
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Emitters: () => (/* binding */ Emitters)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass Emitters {\n constructor(engine, container) {\n this.container = container;\n this._engine = engine;\n this.array = [];\n this.emitters = [];\n this.interactivityEmitters = {\n random: {\n count: 1,\n enable: false\n },\n value: []\n };\n const defaultIndex = 0;\n container.getEmitter = idxOrName => idxOrName === undefined || (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNumber)(idxOrName) ? this.array[idxOrName ?? defaultIndex] : this.array.find(t => t.name === idxOrName);\n container.addEmitter = async (options, position) => this.addEmitter(options, position);\n container.removeEmitter = idxOrName => {\n const emitter = container.getEmitter(idxOrName);\n if (emitter) {\n this.removeEmitter(emitter);\n }\n };\n container.playEmitter = idxOrName => {\n const emitter = container.getEmitter(idxOrName);\n if (emitter) {\n emitter.externalPlay();\n }\n };\n container.pauseEmitter = idxOrName => {\n const emitter = container.getEmitter(idxOrName);\n if (emitter) {\n emitter.externalPause();\n }\n };\n }\n async addEmitter(options, position) {\n const {\n Emitter\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./Options/Classes/Emitter.js */ \"../../plugins/emitters/dist/browser/Options/Classes/Emitter.js\")),\n {\n EmitterInstance\n } = await __webpack_require__.e(/*! import() */ \"plugins_emitters_dist_browser_EmitterInstance_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./EmitterInstance.js */ \"../../plugins/emitters/dist/browser/EmitterInstance.js\")),\n emitterOptions = new Emitter();\n emitterOptions.load(options);\n const emitter = new EmitterInstance(this._engine, this, this.container, emitterOptions, position);\n await emitter.init();\n this.array.push(emitter);\n return emitter;\n }\n handleClickMode(mode) {\n const emitterOptions = this.emitters,\n modeEmitters = this.interactivityEmitters;\n if (mode !== \"emitter\") {\n return;\n }\n let emittersModeOptions;\n if (modeEmitters && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(modeEmitters.value)) {\n const minLength = 0;\n if (modeEmitters.value.length > minLength && modeEmitters.random.enable) {\n emittersModeOptions = [];\n const usedIndexes = [];\n for (let i = 0; i < modeEmitters.random.count; i++) {\n const idx = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.arrayRandomIndex)(modeEmitters.value);\n if (usedIndexes.includes(idx) && usedIndexes.length < modeEmitters.value.length) {\n i--;\n continue;\n }\n usedIndexes.push(idx);\n emittersModeOptions.push((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromArray)(modeEmitters.value, idx));\n }\n } else {\n emittersModeOptions = modeEmitters.value;\n }\n } else {\n emittersModeOptions = modeEmitters?.value;\n }\n const emittersOptions = emittersModeOptions ?? emitterOptions,\n ePosition = this.container.interactivity.mouse.clickPosition;\n void (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(emittersOptions, async emitter => {\n await this.addEmitter(emitter, ePosition);\n });\n }\n async init() {\n this.emitters = this.container.actualOptions.emitters;\n this.interactivityEmitters = this.container.actualOptions.interactivity.modes.emitters;\n if (!this.emitters) {\n return;\n }\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(this.emitters)) {\n for (const emitterOptions of this.emitters) {\n await this.addEmitter(emitterOptions);\n }\n } else {\n await this.addEmitter(this.emitters);\n }\n }\n pause() {\n for (const emitter of this.array) {\n emitter.pause();\n }\n }\n play() {\n for (const emitter of this.array) {\n emitter.play();\n }\n }\n removeEmitter(emitter) {\n const index = this.array.indexOf(emitter),\n minIndex = 0,\n deleteCount = 1;\n if (index >= minIndex) {\n this.array.splice(index, deleteCount);\n }\n }\n resize() {\n for (const emitter of this.array) {\n emitter.resize();\n }\n }\n stop() {\n this.array = [];\n }\n async update(delta) {\n for (const emitter of this.array) {\n await emitter.update(delta);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Emitters.js?");
27
-
28
- /***/ })
29
-
30
- }]);
@@ -1,30 +0,0 @@
1
- /*!
2
- * Author : Matteo Bruni
3
- * MIT license: https://opensource.org/licenses/MIT
4
- * Demo / Generator : https://particles.js.org/
5
- * GitHub : https://www.github.com/matteobruni/tsparticles
6
- * How to use? : Check the GitHub README
7
- * v3.2.2
8
- */
9
- "use strict";
10
- /*
11
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
- * This devtool is neither made for production nor for readable output files.
13
- * It uses "eval()" calls to create a separate source file in the browser devtools.
14
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
- * or disable the default devtool with "devtool: false".
16
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
- */
18
- (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["plugins_emitters_dist_browser_ShapeManager_js"],{
19
-
20
- /***/ "../../plugins/emitters/dist/browser/ShapeManager.js":
21
- /*!***********************************************************!*\
22
- !*** ../../plugins/emitters/dist/browser/ShapeManager.js ***!
23
- \***********************************************************/
24
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
-
26
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ShapeManager: () => (/* binding */ ShapeManager)\n/* harmony export */ });\nconst shapeGeneratorss = new Map();\nclass ShapeManager {\n constructor(engine) {\n this._engine = engine;\n }\n addShapeGenerator(name, generator) {\n if (!this.getShapeGenerator(name)) {\n shapeGeneratorss.set(name, generator);\n }\n }\n getShapeGenerator(name) {\n return shapeGeneratorss.get(name);\n }\n getSupportedShapeGenerators() {\n return shapeGeneratorss.keys();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/ShapeManager.js?");
27
-
28
- /***/ })
29
-
30
- }]);
@@ -1,100 +0,0 @@
1
- /*!
2
- * Author : Matteo Bruni
3
- * MIT license: https://opensource.org/licenses/MIT
4
- * Demo / Generator : https://particles.js.org/
5
- * GitHub : https://www.github.com/matteobruni/tsparticles
6
- * How to use? : Check the GitHub README
7
- * v3.2.2
8
- */
9
- "use strict";
10
- /*
11
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
- * This devtool is neither made for production nor for readable output files.
13
- * It uses "eval()" calls to create a separate source file in the browser devtools.
14
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
- * or disable the default devtool with "devtool: false".
16
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
- */
18
- (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["plugins_emitters_dist_browser_index_js"],{
19
-
20
- /***/ "../../plugins/emitters/dist/browser/EmitterContainer.js":
21
- /*!***************************************************************!*\
22
- !*** ../../plugins/emitters/dist/browser/EmitterContainer.js ***!
23
- \***************************************************************/
24
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
-
26
- eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/EmitterContainer.js?");
27
-
28
- /***/ }),
29
-
30
- /***/ "../../plugins/emitters/dist/browser/EmitterShapeBase.js":
31
- /*!***************************************************************!*\
32
- !*** ../../plugins/emitters/dist/browser/EmitterShapeBase.js ***!
33
- \***************************************************************/
34
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35
-
36
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterShapeBase: () => (/* binding */ EmitterShapeBase)\n/* harmony export */ });\nclass EmitterShapeBase {\n constructor(position, size, fill, options) {\n this.position = position;\n this.size = size;\n this.fill = fill;\n this.options = options;\n }\n resize(position, size) {\n this.position = position;\n this.size = size;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/EmitterShapeBase.js?");
37
-
38
- /***/ }),
39
-
40
- /***/ "../../plugins/emitters/dist/browser/EmittersEngine.js":
41
- /*!*************************************************************!*\
42
- !*** ../../plugins/emitters/dist/browser/EmittersEngine.js ***!
43
- \*************************************************************/
44
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
45
-
46
- eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/EmittersEngine.js?");
47
-
48
- /***/ }),
49
-
50
- /***/ "../../plugins/emitters/dist/browser/Enums/EmitterClickMode.js":
51
- /*!*********************************************************************!*\
52
- !*** ../../plugins/emitters/dist/browser/Enums/EmitterClickMode.js ***!
53
- \*********************************************************************/
54
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
55
-
56
- eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Enums/EmitterClickMode.js?");
57
-
58
- /***/ }),
59
-
60
- /***/ "../../plugins/emitters/dist/browser/IEmitterShape.js":
61
- /*!************************************************************!*\
62
- !*** ../../plugins/emitters/dist/browser/IEmitterShape.js ***!
63
- \************************************************************/
64
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
65
-
66
- eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/IEmitterShape.js?");
67
-
68
- /***/ }),
69
-
70
- /***/ "../../plugins/emitters/dist/browser/IEmitterShapeGenerator.js":
71
- /*!*********************************************************************!*\
72
- !*** ../../plugins/emitters/dist/browser/IEmitterShapeGenerator.js ***!
73
- \*********************************************************************/
74
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
75
-
76
- eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/IEmitterShapeGenerator.js?");
77
-
78
- /***/ }),
79
-
80
- /***/ "../../plugins/emitters/dist/browser/IRandomPositionData.js":
81
- /*!******************************************************************!*\
82
- !*** ../../plugins/emitters/dist/browser/IRandomPositionData.js ***!
83
- \******************************************************************/
84
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
85
-
86
- eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/IRandomPositionData.js?");
87
-
88
- /***/ }),
89
-
90
- /***/ "../../plugins/emitters/dist/browser/index.js":
91
- /*!****************************************************!*\
92
- !*** ../../plugins/emitters/dist/browser/index.js ***!
93
- \****************************************************/
94
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
95
-
96
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterShapeBase: () => (/* reexport safe */ _EmitterShapeBase_js__WEBPACK_IMPORTED_MODULE_1__.EmitterShapeBase),\n/* harmony export */ loadEmittersPlugin: () => (/* binding */ loadEmittersPlugin)\n/* harmony export */ });\n/* harmony import */ var _EmitterContainer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EmitterContainer.js */ \"../../plugins/emitters/dist/browser/EmitterContainer.js\");\n/* harmony import */ var _EmitterShapeBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EmitterShapeBase.js */ \"../../plugins/emitters/dist/browser/EmitterShapeBase.js\");\n/* harmony import */ var _EmittersEngine_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EmittersEngine.js */ \"../../plugins/emitters/dist/browser/EmittersEngine.js\");\n/* harmony import */ var _IEmitterShape_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./IEmitterShape.js */ \"../../plugins/emitters/dist/browser/IEmitterShape.js\");\n/* harmony import */ var _IEmitterShapeGenerator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./IEmitterShapeGenerator.js */ \"../../plugins/emitters/dist/browser/IEmitterShapeGenerator.js\");\n/* harmony import */ var _Enums_EmitterClickMode_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Enums/EmitterClickMode.js */ \"../../plugins/emitters/dist/browser/Enums/EmitterClickMode.js\");\n/* harmony import */ var _IRandomPositionData_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./IRandomPositionData.js */ \"../../plugins/emitters/dist/browser/IRandomPositionData.js\");\nasync function loadEmittersPlugin(engine, refresh = true) {\n if (!engine.emitterShapeManager) {\n const {\n ShapeManager\n } = await __webpack_require__.e(/*! import() */ \"plugins_emitters_dist_browser_ShapeManager_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ShapeManager.js */ \"../../plugins/emitters/dist/browser/ShapeManager.js\"));\n engine.emitterShapeManager = new ShapeManager(engine);\n }\n if (!engine.addEmitterShapeGenerator) {\n engine.addEmitterShapeGenerator = (name, generator) => {\n engine.emitterShapeManager?.addShapeGenerator(name, generator);\n };\n }\n const {\n EmittersPlugin\n } = await __webpack_require__.e(/*! import() */ \"plugins_emitters_dist_browser_EmittersPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./EmittersPlugin.js */ \"../../plugins/emitters/dist/browser/EmittersPlugin.js\")),\n plugin = new EmittersPlugin(engine);\n await engine.addPlugin(plugin, refresh);\n}\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/index.js?");
97
-
98
- /***/ })
99
-
100
- }]);
@@ -1,30 +0,0 @@
1
- /*!
2
- * Author : Matteo Bruni
3
- * MIT license: https://opensource.org/licenses/MIT
4
- * Demo / Generator : https://particles.js.org/
5
- * GitHub : https://www.github.com/matteobruni/tsparticles
6
- * How to use? : Check the GitHub README
7
- * v3.2.2
8
- */
9
- "use strict";
10
- /*
11
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
- * This devtool is neither made for production nor for readable output files.
13
- * It uses "eval()" calls to create a separate source file in the browser devtools.
14
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
- * or disable the default devtool with "devtool: false".
16
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
- */
18
- (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["plugins_sounds_dist_browser_SoundsInstance_js"],{
19
-
20
- /***/ "../../plugins/sounds/dist/browser/SoundsInstance.js":
21
- /*!***********************************************************!*\
22
- !*** ../../plugins/sounds/dist/browser/SoundsInstance.js ***!
23
- \***********************************************************/
24
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
-
26
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsInstance: () => (/* binding */ SoundsInstance)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ \"../../plugins/sounds/dist/browser/utils.js\");\n\n\nconst zIndexOffset = 1,\n rightOffset = 1,\n minVolume = 0;\nfunction initImage(data) {\n const img = document.createElement(\"img\"),\n {\n clickCb,\n container,\n display,\n iconOptions,\n margin,\n options,\n pos,\n rightOffsets\n } = data,\n {\n width,\n path,\n style,\n svg\n } = iconOptions,\n defaultAccumulator = 0;\n setIconStyle(img, pos.top + margin, pos.right - (margin * (rightOffsets.length + rightOffset) + width + rightOffsets.reduce((a, b) => a + b, defaultAccumulator)), display, options.fullScreen.zIndex + zIndexOffset, width, margin, style);\n img.src = path ?? (svg ? `data:image/svg+xml;base64,${btoa(svg)}` : \"\");\n const parent = container.canvas.element?.parentNode ?? document.body;\n parent.append(img);\n img.addEventListener(\"click\", () => {\n void clickCb();\n });\n return img;\n}\nfunction removeImage(image) {\n if (!image) {\n return;\n }\n image.remove();\n}\nfunction setIconStyle(icon, top, left, display, zIndex, width, margin, style) {\n icon.style.userSelect = \"none\";\n icon.style.webkitUserSelect = \"none\";\n icon.style.position = \"absolute\";\n icon.style.top = `${top + margin}px`;\n icon.style.left = `${left - margin - width}px`;\n icon.style.display = display;\n icon.style.zIndex = `${zIndex + zIndexOffset}`;\n icon.style.cssText += style;\n}\nclass SoundsInstance {\n constructor(container, engine) {\n this._addBuffer = audioCtx => {\n const buffer = audioCtx.createBufferSource();\n this._audioSources.push(buffer);\n return buffer;\n };\n this._addOscillator = audioCtx => {\n const oscillator = audioCtx.createOscillator();\n this._audioSources.push(oscillator);\n return oscillator;\n };\n this._initEvents = () => {\n const container = this._container,\n soundsOptions = container.actualOptions.sounds;\n if (!soundsOptions?.enable || !container.canvas.element) {\n return;\n }\n for (const event of soundsOptions.events) {\n const cb = args => {\n void (async () => {\n const filterNotValid = event.filter && !event.filter(args);\n if (this._container !== args.container) {\n return;\n }\n if (!this._container || !!this._container.muted || this._container.destroyed) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(event.event, item => {\n this._engine.removeEventListener(item, cb);\n });\n return;\n }\n if (filterNotValid) {\n return;\n }\n const defaultNoteIndex = 0;\n if (event.audio) {\n this._playBuffer((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(event.audio));\n } else if (event.melodies) {\n const melody = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromArray)(event.melodies);\n if (melody.melodies.length) {\n await Promise.allSettled(melody.melodies.map(m => this._playNote(m.notes, defaultNoteIndex, melody.loop)));\n } else {\n await this._playNote(melody.notes, defaultNoteIndex, melody.loop);\n }\n } else if (event.notes) {\n const note = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromArray)(event.notes);\n await this._playNote([note], defaultNoteIndex, false);\n }\n })();\n };\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(event.event, item => {\n this._engine.addEventListener(item, cb);\n });\n }\n };\n this._mute = async () => {\n const container = this._container,\n audioContext = this._getAudioContext();\n for (const source of this._audioSources) {\n this._removeAudioSource(source);\n }\n if (this._gain) {\n this._gain.disconnect();\n }\n await audioContext.close();\n container.audioContext = undefined;\n this._engine.dispatchEvent(\"soundsMuted\", {\n container: this._container\n });\n };\n this._playBuffer = audio => {\n const audioBuffer = this._audioMap.get(audio.source);\n if (!audioBuffer) {\n return;\n }\n const audioCtx = this._container.audioContext;\n if (!audioCtx) {\n return;\n }\n const source = this._addBuffer(audioCtx);\n source.loop = audio.loop;\n source.buffer = audioBuffer;\n source.connect(this._gain ?? audioCtx.destination);\n source.start();\n };\n this._playFrequency = async (frequency, duration) => {\n if (!this._gain || this._container.muted) {\n return;\n }\n const audioContext = this._getAudioContext(),\n oscillator = this._addOscillator(audioContext);\n oscillator.connect(this._gain);\n oscillator.type = \"sine\";\n oscillator.frequency.value = frequency;\n oscillator.start();\n return new Promise(resolve => {\n setTimeout(() => {\n this._removeAudioSource(oscillator);\n resolve();\n }, duration);\n });\n };\n this._playMuteSound = () => {\n if (this._container.muted) {\n return;\n }\n const audioContext = this._getAudioContext(),\n gain = audioContext.createGain();\n gain.connect(audioContext.destination);\n gain.gain.value = 0;\n const oscillator = audioContext.createOscillator();\n oscillator.connect(gain);\n oscillator.type = \"sine\";\n oscillator.frequency.value = 1;\n oscillator.start();\n setTimeout(() => {\n oscillator.stop();\n oscillator.disconnect();\n gain.disconnect();\n });\n };\n this._playNote = async (notes, noteIdx, loop) => {\n if (this._container.muted) {\n return;\n }\n const note = notes[noteIdx];\n if (!note) {\n return;\n }\n const value = note.value;\n const promises = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(value, async (_, idx) => {\n return this._playNoteValue(notes, noteIdx, idx);\n });\n await ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(promises) ? Promise.allSettled(promises) : promises);\n const indexOffset = 1;\n let nextNoteIdx = noteIdx + indexOffset;\n if (loop && nextNoteIdx >= notes.length) {\n nextNoteIdx = nextNoteIdx % notes.length;\n }\n if (this._container.muted) {\n return;\n }\n await this._playNote(notes, nextNoteIdx, loop);\n };\n this._playNoteValue = async (notes, noteIdx, valueIdx) => {\n const note = notes[noteIdx];\n if (!note) {\n return;\n }\n const value = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(note.value, valueIdx, true);\n try {\n const freq = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.getNoteFrequency)(value);\n if (!(0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNumber)(freq)) {\n return;\n }\n await this._playFrequency(freq, note.duration);\n } catch (e) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getLogger)().error(e);\n }\n };\n this._removeAudioSource = source => {\n source.stop();\n source.disconnect();\n const deleteCount = 1;\n this._audioSources.splice(this._audioSources.indexOf(source), deleteCount);\n };\n this._unmute = () => {\n const container = this._container,\n options = container.actualOptions,\n soundsOptions = options.sounds;\n if (!soundsOptions) {\n return;\n }\n const audioContext = this._getAudioContext();\n if (!this._audioSources) {\n this._audioSources = [];\n }\n const gain = audioContext.createGain();\n gain.connect(audioContext.destination);\n gain.gain.value = soundsOptions.volume.value / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator;\n this._gain = gain;\n this._initEvents();\n this._engine.dispatchEvent(\"soundsUnmuted\", {\n container: this._container\n });\n };\n this._updateMuteIcons = () => {\n const container = this._container,\n soundsOptions = container.actualOptions.sounds;\n if (!soundsOptions?.enable || !soundsOptions.icons.enable) {\n return;\n }\n const muteImg = this._muteImg,\n unmuteImg = this._unmuteImg;\n if (muteImg) {\n muteImg.style.display = container.muted ? \"block\" : \"none\";\n }\n if (unmuteImg) {\n unmuteImg.style.display = container.muted ? \"none\" : \"block\";\n }\n };\n this._updateMuteStatus = async () => {\n const container = this._container,\n audioContext = this._getAudioContext();\n if (container.muted) {\n await audioContext?.suspend();\n await this._mute();\n } else {\n await audioContext?.resume();\n this._unmute();\n this._playMuteSound();\n }\n };\n this._updateVolume = async () => {\n const container = this._container,\n soundsOptions = container.actualOptions.sounds;\n if (!soundsOptions?.enable) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.clamp)(this._volume, soundsOptions.volume.min, soundsOptions.volume.max);\n let stateChanged = false;\n if (this._volume <= minVolume && !container.muted) {\n this._volume = 0;\n container.muted = true;\n stateChanged = true;\n } else if (this._volume > minVolume && container.muted) {\n container.muted = false;\n stateChanged = true;\n }\n if (stateChanged) {\n this._updateMuteIcons();\n await this._updateMuteStatus();\n }\n if (this._gain?.gain) {\n this._gain.gain.value = this._volume / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator;\n }\n };\n this._container = container;\n this._engine = engine;\n this._volume = 0;\n this._audioSources = [];\n this._audioMap = new Map();\n }\n async init() {\n const container = this._container,\n options = container.actualOptions,\n soundsOptions = options.sounds;\n if (!soundsOptions?.enable) {\n return;\n }\n if (soundsOptions.autoPlay && (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.isWindowMuted)()) {\n const firstClickHandler = () => {\n removeEventListener(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.mouseDownEvent, firstClickHandler);\n removeEventListener(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.touchStartEvent, firstClickHandler);\n (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.unmuteWindow)();\n void this.unmute();\n };\n const listenerOptions = {\n capture: true,\n once: true\n };\n addEventListener(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.mouseDownEvent, firstClickHandler, listenerOptions);\n addEventListener(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.touchStartEvent, firstClickHandler, listenerOptions);\n }\n this._volume = soundsOptions.volume.value;\n const events = soundsOptions.events;\n this._audioMap = new Map();\n for (const event of events) {\n if (!event.audio) {\n continue;\n }\n const promises = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(event.audio, async audio => {\n const response = await fetch(audio.source);\n if (!response.ok) {\n return;\n }\n const arrayBuffer = await response.arrayBuffer(),\n audioContext = this._getAudioContext(),\n audioBuffer = await audioContext.decodeAudioData(arrayBuffer);\n this._audioMap.set(audio.source, audioBuffer);\n });\n if (promises instanceof Promise) {\n await promises;\n } else {\n await Promise.allSettled(promises);\n }\n }\n }\n async mute() {\n if (!this._container.muted) {\n await this.toggleMute();\n }\n }\n async start() {\n const container = this._container,\n options = container.actualOptions,\n soundsOptions = options.sounds;\n if (!soundsOptions?.enable || !container.canvas.element) {\n return;\n }\n container.muted = true;\n const canvas = container.canvas.element,\n pos = {\n top: canvas.offsetTop,\n right: canvas.offsetLeft + canvas.offsetWidth\n },\n {\n mute,\n unmute,\n volumeDown,\n volumeUp\n } = soundsOptions.icons,\n margin = 10,\n toggleMute = async () => {\n await this.toggleMute();\n },\n enableIcons = soundsOptions.icons.enable,\n display = enableIcons ? \"block\" : \"none\";\n this._muteImg = initImage({\n container,\n options,\n pos,\n display,\n iconOptions: mute,\n margin,\n rightOffsets: [volumeDown.width, volumeUp.width],\n clickCb: toggleMute\n });\n this._unmuteImg = initImage({\n container,\n options,\n pos,\n display: \"none\",\n iconOptions: unmute,\n margin,\n rightOffsets: [volumeDown.width, volumeUp.width],\n clickCb: toggleMute\n });\n this._volumeDownImg = initImage({\n container,\n options,\n pos,\n display,\n iconOptions: volumeDown,\n margin,\n rightOffsets: [volumeUp.width],\n clickCb: async () => {\n await this.volumeDown();\n }\n });\n this._volumeUpImg = initImage({\n container,\n options,\n pos,\n display,\n iconOptions: volumeUp,\n margin,\n rightOffsets: [],\n clickCb: async () => {\n await this.volumeUp();\n }\n });\n if (!(0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.isWindowMuted)() && soundsOptions.autoPlay) {\n await this.unmute();\n }\n }\n stop() {\n this._container.muted = true;\n void (async () => {\n await this._mute();\n removeImage(this._muteImg);\n removeImage(this._unmuteImg);\n removeImage(this._volumeDownImg);\n removeImage(this._volumeUpImg);\n })();\n }\n async toggleMute() {\n const container = this._container;\n container.muted = !container.muted;\n this._updateMuteIcons();\n await this._updateMuteStatus();\n }\n async unmute() {\n if (this._container.muted) {\n await this.toggleMute();\n }\n }\n async volumeDown() {\n const container = this._container,\n soundsOptions = container.actualOptions.sounds;\n if (!soundsOptions?.enable) {\n return;\n }\n if (container.muted) {\n this._volume = 0;\n }\n this._volume -= soundsOptions.volume.step;\n await this._updateVolume();\n }\n async volumeUp() {\n const container = this._container,\n soundsOptions = container.actualOptions.sounds;\n if (!soundsOptions?.enable) {\n return;\n }\n this._volume += soundsOptions.volume.step;\n await this._updateVolume();\n }\n _getAudioContext() {\n const container = this._container;\n if (!container.audioContext) {\n container.audioContext = new AudioContext();\n }\n return container.audioContext;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/sounds/dist/browser/SoundsInstance.js?");
27
-
28
- /***/ })
29
-
30
- }]);
@@ -1,120 +0,0 @@
1
- /*!
2
- * Author : Matteo Bruni
3
- * MIT license: https://opensource.org/licenses/MIT
4
- * Demo / Generator : https://particles.js.org/
5
- * GitHub : https://www.github.com/matteobruni/tsparticles
6
- * How to use? : Check the GitHub README
7
- * v3.2.2
8
- */
9
- "use strict";
10
- /*
11
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
- * This devtool is neither made for production nor for readable output files.
13
- * It uses "eval()" calls to create a separate source file in the browser devtools.
14
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
- * or disable the default devtool with "devtool: false".
16
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
- */
18
- (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["plugins_sounds_dist_browser_SoundsPlugin_js"],{
19
-
20
- /***/ "../../plugins/sounds/dist/browser/Options/Classes/Sounds.js":
21
- /*!*******************************************************************!*\
22
- !*** ../../plugins/sounds/dist/browser/Options/Classes/Sounds.js ***!
23
- \*******************************************************************/
24
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
-
26
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Sounds: () => (/* binding */ Sounds)\n/* harmony export */ });\n/* harmony import */ var _SoundsEvent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SoundsEvent.js */ \"../../plugins/sounds/dist/browser/Options/Classes/SoundsEvent.js\");\n/* harmony import */ var _SoundsIcons_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SoundsIcons.js */ \"../../plugins/sounds/dist/browser/Options/Classes/SoundsIcons.js\");\n/* harmony import */ var _SoundsVolume_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SoundsVolume.js */ \"../../plugins/sounds/dist/browser/Options/Classes/SoundsVolume.js\");\n\n\n\nclass Sounds {\n constructor() {\n this.autoPlay = true;\n this.enable = false;\n this.events = [];\n this.icons = new _SoundsIcons_js__WEBPACK_IMPORTED_MODULE_1__.SoundsIcons();\n this.volume = new _SoundsVolume_js__WEBPACK_IMPORTED_MODULE_2__.SoundsVolume();\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.autoPlay !== undefined) {\n this.autoPlay = data.autoPlay;\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n if (data.events !== undefined) {\n this.events = data.events.map(t => {\n const event = new _SoundsEvent_js__WEBPACK_IMPORTED_MODULE_0__.SoundsEvent();\n event.load(t);\n return event;\n });\n }\n this.icons.load(data.icons);\n if (data.volume !== undefined) {\n this.volume.load(data.volume);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/sounds/dist/browser/Options/Classes/Sounds.js?");
27
-
28
- /***/ }),
29
-
30
- /***/ "../../plugins/sounds/dist/browser/Options/Classes/SoundsAudio.js":
31
- /*!************************************************************************!*\
32
- !*** ../../plugins/sounds/dist/browser/Options/Classes/SoundsAudio.js ***!
33
- \************************************************************************/
34
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35
-
36
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsAudio: () => (/* binding */ SoundsAudio)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass SoundsAudio {\n constructor() {\n this.loop = false;\n this.source = \"\";\n }\n load(data) {\n if (data === undefined) {\n return;\n }\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isObject)(data)) {\n if (data.loop !== undefined) {\n this.loop = data.loop;\n }\n if (data.source !== undefined) {\n this.source = data.source;\n }\n } else {\n this.source = data;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/sounds/dist/browser/Options/Classes/SoundsAudio.js?");
37
-
38
- /***/ }),
39
-
40
- /***/ "../../plugins/sounds/dist/browser/Options/Classes/SoundsEvent.js":
41
- /*!************************************************************************!*\
42
- !*** ../../plugins/sounds/dist/browser/Options/Classes/SoundsEvent.js ***!
43
- \************************************************************************/
44
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
45
-
46
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsEvent: () => (/* binding */ SoundsEvent)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n/* harmony import */ var _SoundsAudio_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SoundsAudio.js */ \"../../plugins/sounds/dist/browser/Options/Classes/SoundsAudio.js\");\n/* harmony import */ var _SoundsMelody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SoundsMelody.js */ \"../../plugins/sounds/dist/browser/Options/Classes/SoundsMelody.js\");\n/* harmony import */ var _SoundsNote_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SoundsNote.js */ \"../../plugins/sounds/dist/browser/Options/Classes/SoundsNote.js\");\n\n\n\n\nclass SoundsEvent {\n constructor() {\n this.event = [];\n this.notes = [];\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.event !== undefined) {\n this.event = data.event;\n }\n if (data.audio !== undefined) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(data.audio)) {\n this.audio = data.audio.map(s => {\n const tmp = new _SoundsAudio_js__WEBPACK_IMPORTED_MODULE_1__.SoundsAudio();\n tmp.load(s);\n return tmp;\n });\n } else {\n this.audio = new _SoundsAudio_js__WEBPACK_IMPORTED_MODULE_1__.SoundsAudio();\n this.audio.load(data.audio);\n }\n }\n if (data.notes !== undefined) {\n this.notes = data.notes.map(t => {\n const tmp = new _SoundsNote_js__WEBPACK_IMPORTED_MODULE_3__.SoundsNote();\n tmp.load(t);\n return tmp;\n });\n }\n if (data.melodies !== undefined) {\n this.melodies = data.melodies.map(t => {\n const tmp = new _SoundsMelody_js__WEBPACK_IMPORTED_MODULE_2__.SoundsMelody();\n tmp.load(t);\n return tmp;\n });\n }\n if (data.filter) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isString)(data.filter)) {\n const filterFunc = window[data.filter];\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isFunction)(filterFunc)) {\n this.filter = filterFunc;\n }\n } else {\n this.filter = data.filter;\n }\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/sounds/dist/browser/Options/Classes/SoundsEvent.js?");
47
-
48
- /***/ }),
49
-
50
- /***/ "../../plugins/sounds/dist/browser/Options/Classes/SoundsIcon.js":
51
- /*!***********************************************************************!*\
52
- !*** ../../plugins/sounds/dist/browser/Options/Classes/SoundsIcon.js ***!
53
- \***********************************************************************/
54
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
55
-
56
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsIcon: () => (/* binding */ SoundsIcon)\n/* harmony export */ });\nclass SoundsIcon {\n constructor() {\n this.width = 24;\n this.height = 24;\n this.style = \"\";\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.path !== undefined) {\n this.path = data.path;\n }\n if (data.svg !== undefined) {\n this.svg = data.svg;\n }\n if (data.width !== undefined) {\n this.width = data.width;\n }\n if (data.height !== undefined) {\n this.height = data.height;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/sounds/dist/browser/Options/Classes/SoundsIcon.js?");
57
-
58
- /***/ }),
59
-
60
- /***/ "../../plugins/sounds/dist/browser/Options/Classes/SoundsIcons.js":
61
- /*!************************************************************************!*\
62
- !*** ../../plugins/sounds/dist/browser/Options/Classes/SoundsIcons.js ***!
63
- \************************************************************************/
64
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
65
-
66
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsIcons: () => (/* binding */ SoundsIcons)\n/* harmony export */ });\n/* harmony import */ var _SoundsIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SoundsIcon.js */ \"../../plugins/sounds/dist/browser/Options/Classes/SoundsIcon.js\");\n\nclass SoundsIcons {\n constructor() {\n this.mute = new _SoundsIcon_js__WEBPACK_IMPORTED_MODULE_0__.SoundsIcon();\n this.unmute = new _SoundsIcon_js__WEBPACK_IMPORTED_MODULE_0__.SoundsIcon();\n this.volumeDown = new _SoundsIcon_js__WEBPACK_IMPORTED_MODULE_0__.SoundsIcon();\n this.volumeUp = new _SoundsIcon_js__WEBPACK_IMPORTED_MODULE_0__.SoundsIcon();\n this.enable = false;\n this.mute.svg = `<?xml version=\"1.0\"?>\n<svg baseProfile=\"tiny\" height=\"24px\" version=\"1.2\" viewBox=\"0 0 24 24\" width=\"24px\"\n xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <g id=\"Layer_1\">\n <path fill=\"#fff\" d=\"M19.707,5.293c-0.391-0.391-1.023-0.391-1.414,0l-1.551,1.551c-0.345-0.688-0.987-1.02-1.604-1.02c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C10.357,8.561,8.904,9,8,9c-1.654,0-3,1.346-3,3v2c0,1.237,0.754,2.302,1.826,2.76l-1.533,1.533c-0.391,0.391-0.391,1.023,0,1.414C5.488,19.902,5.744,20,6,20s0.512-0.098,0.707-0.293l2.527-2.527c0.697,0.174,1.416,0.455,1.875,0.762l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C16.035,20.176,17,19.495,17,18V9.414l2.707-2.707C20.098,6.316,20.098,5.684,19.707,5.293z M14.891,7.941c0.038-0.025,0.073-0.046,0.104-0.062C14.998,7.914,15,7.954,15,8v1.293l-2,2V9.202L14.891,7.941z M7,12c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v2.439l-2.83,2.83C8.757,15.046,8.356,15,8,15c-0.552,0-1-0.448-1-1V12z M10.301,15.406L12,13.707v2.439C11.519,15.859,10.925,15.604,10.301,15.406z M14.994,18.12c-0.03-0.016-0.065-0.036-0.104-0.062L13,16.798v-4.091l2-2V18C15,18.046,14.998,18.086,14.994,18.12z\"/>\n </g>\n</svg>`;\n this.unmute.svg = `<?xml version=\"1.0\"?>\n<svg baseProfile=\"tiny\" height=\"24px\" version=\"1.2\" viewBox=\"0 0 24 24\" width=\"24px\"\n xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <g id=\"Layer_1\">\n <path fill=\"#fff\" d=\"M17.138,5.824c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C12.357,8.561,10.904,9,10,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C18.035,20.176,19,19.495,19,18V8C19,6.505,18.035,5.824,17.138,5.824z M14,16.146C12.907,15.495,11.211,15,10,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146V16.146z M17,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L15,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C16.998,7.914,17,7.954,17,8V18z\"/>\n </g>\n</svg>`;\n this.volumeDown.svg = `<?xml version=\"1.0\"?>\n<svg baseProfile=\"tiny\" height=\"24px\" version=\"1.2\" viewBox=\"0 0 24 24\" width=\"24px\"\n xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <g id=\"Layer_1\">\n <path fill=\"#fff\" d=\"M15.138,5.824c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C10.357,8.561,8.904,9,8,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C16.035,20.176,17,19.495,17,18V8C17,6.505,16.035,5.824,15.138,5.824z M8,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v6.293C10.907,15.495,9.211,15,8,15z M15,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L13,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C14.998,7.914,15,7.954,15,8V18z\"/>\n <path fill=\"#fff\" d=\"M18.292,10.294c-0.39,0.391-0.39,1.023,0.002,1.414c0.345,0.345,0.535,0.803,0.535,1.291c0,0.489-0.19,0.948-0.536,1.294c-0.391,0.39-0.391,1.023,0,1.414C18.488,15.902,18.744,16,19,16s0.512-0.098,0.707-0.293c0.724-0.723,1.122-1.685,1.122-2.708s-0.398-1.984-1.123-2.707C19.317,9.903,18.683,9.901,18.292,10.294z\"/>\n </g>\n</svg>`;\n this.volumeUp.svg = `<?xml version=\"1.0\"?>\n<svg baseProfile=\"tiny\" height=\"24px\" version=\"1.2\" viewBox=\"0 0 24 24\" width=\"24px\"\n xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <g id=\"Layer_1\">\n <path fill=\"#fff\" d=\"M16.706,10.292c-0.389-0.389-1.023-0.391-1.414,0.002c-0.39,0.391-0.39,1.023,0.002,1.414c0.345,0.345,0.535,0.803,0.535,1.291c0,0.489-0.19,0.948-0.536,1.294c-0.391,0.39-0.391,1.023,0,1.414C15.488,15.902,15.744,16,16,16s0.512-0.098,0.707-0.293c0.724-0.723,1.122-1.685,1.122-2.708S17.431,11.015,16.706,10.292z\"/>\n <path fill=\"#fff\" d=\"M18.706,8.292c-0.391-0.389-1.023-0.39-1.414,0.002c-0.39,0.391-0.39,1.024,0.002,1.414c0.879,0.877,1.363,2.044,1.364,3.287c0.001,1.246-0.484,2.417-1.365,3.298c-0.391,0.391-0.391,1.023,0,1.414C17.488,17.902,17.744,18,18,18s0.512-0.098,0.707-0.293c1.259-1.259,1.952-2.933,1.951-4.713C20.657,11.217,19.964,9.547,18.706,8.292z\"/>\n <path fill=\"#fff\" d=\"M20.706,6.292c-0.391-0.389-1.023-0.39-1.414,0.002c-0.39,0.391-0.39,1.024,0.002,1.414c1.412,1.409,2.191,3.285,2.192,5.284c0.002,2.002-0.777,3.885-2.193,5.301c-0.391,0.391-0.391,1.023,0,1.414C19.488,19.902,19.744,20,20,20s0.512-0.098,0.707-0.293c1.794-1.794,2.781-4.18,2.779-6.717C23.485,10.457,22.497,8.078,20.706,6.292z\"/>\n <path fill=\"#fff\" d=\"M12.138,5.824c-0.449,0-0.905,0.152-1.356,0.453L8.109,8.059C7.357,8.561,5.904,9,5,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C13.035,20.176,14,19.495,14,18V8C14,6.505,13.035,5.824,12.138,5.824z M5,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v6.293C7.907,15.495,6.211,15,5,15z M12,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L10,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C11.998,7.914,12,7.954,12,8V18z\"/>\n </g>\n</svg>`;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n this.mute.load(data.mute);\n this.unmute.load(data.unmute);\n this.volumeDown.load(data.volumeDown);\n this.volumeUp.load(data.volumeUp);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/sounds/dist/browser/Options/Classes/SoundsIcons.js?");
67
-
68
- /***/ }),
69
-
70
- /***/ "../../plugins/sounds/dist/browser/Options/Classes/SoundsMelody.js":
71
- /*!*************************************************************************!*\
72
- !*** ../../plugins/sounds/dist/browser/Options/Classes/SoundsMelody.js ***!
73
- \*************************************************************************/
74
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
75
-
76
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsMelody: () => (/* binding */ SoundsMelody)\n/* harmony export */ });\n/* harmony import */ var _SoundsNote_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SoundsNote.js */ \"../../plugins/sounds/dist/browser/Options/Classes/SoundsNote.js\");\n\nclass SoundsMelody {\n constructor() {\n this.loop = false;\n this.melodies = [];\n this.notes = [];\n }\n load(data) {\n if (data === undefined) {\n return;\n }\n if (data.loop !== undefined) {\n this.loop = data.loop;\n }\n if (data.melodies !== undefined) {\n this.melodies = data.melodies.map(s => {\n const tmp = new SoundsMelody();\n tmp.load(s);\n return tmp;\n });\n }\n if (data.notes !== undefined) {\n this.notes = data.notes.map(s => {\n const tmp = new _SoundsNote_js__WEBPACK_IMPORTED_MODULE_0__.SoundsNote();\n tmp.load(s);\n return tmp;\n });\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/sounds/dist/browser/Options/Classes/SoundsMelody.js?");
77
-
78
- /***/ }),
79
-
80
- /***/ "../../plugins/sounds/dist/browser/Options/Classes/SoundsNote.js":
81
- /*!***********************************************************************!*\
82
- !*** ../../plugins/sounds/dist/browser/Options/Classes/SoundsNote.js ***!
83
- \***********************************************************************/
84
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
85
-
86
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsNote: () => (/* binding */ SoundsNote)\n/* harmony export */ });\nclass SoundsNote {\n constructor() {\n this.duration = 500;\n this.value = [];\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.duration !== undefined) {\n this.duration = data.duration;\n }\n if (data.value !== undefined) {\n this.value = data.value;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/sounds/dist/browser/Options/Classes/SoundsNote.js?");
87
-
88
- /***/ }),
89
-
90
- /***/ "../../plugins/sounds/dist/browser/Options/Classes/SoundsVolume.js":
91
- /*!*************************************************************************!*\
92
- !*** ../../plugins/sounds/dist/browser/Options/Classes/SoundsVolume.js ***!
93
- \*************************************************************************/
94
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
95
-
96
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsVolume: () => (/* binding */ SoundsVolume)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass SoundsVolume {\n constructor() {\n this.value = 100;\n this.max = 100;\n this.min = 0;\n this.step = 10;\n }\n load(data) {\n if (data === undefined) {\n return;\n }\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isObject)(data)) {\n if (data.max !== undefined) {\n this.max = data.max;\n }\n if (data.min !== undefined) {\n this.min = data.min;\n }\n if (data.step !== undefined) {\n this.step = data.step;\n }\n if (data.value !== undefined) {\n this.value = data.value;\n }\n } else {\n this.value = data;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/sounds/dist/browser/Options/Classes/SoundsVolume.js?");
97
-
98
- /***/ }),
99
-
100
- /***/ "../../plugins/sounds/dist/browser/SoundsPlugin.js":
101
- /*!*********************************************************!*\
102
- !*** ../../plugins/sounds/dist/browser/SoundsPlugin.js ***!
103
- \*********************************************************/
104
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
105
-
106
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsPlugin: () => (/* binding */ SoundsPlugin)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n/* harmony import */ var _Options_Classes_Sounds_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Sounds.js */ \"../../plugins/sounds/dist/browser/Options/Classes/Sounds.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ \"../../plugins/sounds/dist/browser/utils.js\");\n\n\n\nconst generalFirstClickHandler = () => {\n removeEventListener(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.mouseDownEvent, generalFirstClickHandler);\n removeEventListener(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.touchStartEvent, generalFirstClickHandler);\n (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.unmuteWindow)();\n};\nclass SoundsPlugin {\n constructor(engine) {\n this.id = \"sounds\";\n this._engine = engine;\n const listenerOptions = {\n capture: true,\n once: true\n };\n addEventListener(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.mouseDownEvent, generalFirstClickHandler, listenerOptions);\n addEventListener(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.touchStartEvent, generalFirstClickHandler, listenerOptions);\n }\n async getPlugin(container) {\n const {\n SoundsInstance\n } = await __webpack_require__.e(/*! import() */ \"plugins_sounds_dist_browser_SoundsInstance_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./SoundsInstance.js */ \"../../plugins/sounds/dist/browser/SoundsInstance.js\"));\n return new SoundsInstance(container, this._engine);\n }\n loadOptions(options, source) {\n if (!this.needsPlugin(options) && !this.needsPlugin(source)) {\n return;\n }\n let soundsOptions = options.sounds;\n if (soundsOptions?.load === undefined) {\n options.sounds = soundsOptions = new _Options_Classes_Sounds_js__WEBPACK_IMPORTED_MODULE_1__.Sounds();\n }\n soundsOptions.load(source?.sounds);\n }\n needsPlugin(options) {\n return options?.sounds?.enable ?? false;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/sounds/dist/browser/SoundsPlugin.js?");
107
-
108
- /***/ }),
109
-
110
- /***/ "../../plugins/sounds/dist/browser/utils.js":
111
- /*!**************************************************!*\
112
- !*** ../../plugins/sounds/dist/browser/utils.js ***!
113
- \**************************************************/
114
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
115
-
116
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getNoteFrequency: () => (/* binding */ getNoteFrequency),\n/* harmony export */ isWindowMuted: () => (/* binding */ isWindowMuted),\n/* harmony export */ unmuteWindow: () => (/* binding */ unmuteWindow)\n/* harmony export */ });\nconst notes = new Map();\nnotes.set(\"C\", [16.35, 32.7, 65.41, 130.81, 261.63, 523.25, 1046.5, 2093.0, 4186.01]);\nnotes.set(\"Db\", [17.32, 34.65, 69.3, 138.59, 277.18, 554.37, 1108.73, 2217.46, 4434.92]);\nnotes.set(\"D\", [18.35, 36.71, 73.42, 146.83, 293.66, 587.33, 1174.66, 2349.32, 4698.63]);\nnotes.set(\"Eb\", [19.45, 38.89, 77.78, 155.56, 311.13, 622.25, 1244.51, 2489.02, 4978.03]);\nnotes.set(\"E\", [20.6, 41.2, 82.41, 164.81, 329.63, 659.25, 1318.51, 2637.02, 5274.04]);\nnotes.set(\"F\", [21.83, 43.65, 87.31, 174.61, 349.23, 698.46, 1396.91, 2793.83, 5587.65]);\nnotes.set(\"Gb\", [23.12, 46.25, 92.5, 185.0, 369.99, 739.99, 1479.98, 2959.96, 5919.91]);\nnotes.set(\"G\", [24.5, 49.0, 98.0, 196.0, 392.0, 783.99, 1567.98, 3135.96, 6271.93]);\nnotes.set(\"Ab\", [25.96, 51.91, 103.83, 207.65, 415.3, 830.61, 1661.22, 3322.44, 6644.88]);\nnotes.set(\"A\", [27.5, 55.0, 110.0, 220.0, 440.0, 880.0, 1760.0, 3520.0, 7040.0]);\nnotes.set(\"Bb\", [29.14, 58.27, 116.54, 233.08, 466.16, 932.33, 1864.66, 3729.31, 7458.62]);\nnotes.set(\"B\", [30.87, 61.74, 123.47, 246.94, 493.88, 987.77, 1975.53, 3951.07, 7902.13]);\nnotes.set(\"pause\", [0]);\nfunction getNoteFrequency(note) {\n const regex = /(([A-G]b?)(\\d))|pause/i,\n result = regex.exec(note),\n groupKey = 2,\n defaultMatchKey = 0,\n innerGroupKey = 3;\n if (!result?.length) {\n return;\n }\n const noteKey = result[groupKey] || result[defaultMatchKey],\n noteItem = notes.get(noteKey);\n if (!noteItem) {\n return;\n }\n return noteItem[parseInt(result[innerGroupKey] || \"0\")];\n}\nlet muted = true;\nconst isWindowMuted = () => {\n return muted;\n};\nconst unmuteWindow = () => {\n muted = false;\n};\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/sounds/dist/browser/utils.js?");
117
-
118
- /***/ })
119
-
120
- }]);