@tsparticles/preset-bubbles 4.5.1 → 4.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  (function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
2
  (function (g) {
3
- /* Preset v4.5.1 */
3
+ /* Preset v4.5.2 */
4
4
  g.__tsParticlesInternals = g.__tsParticlesInternals || {};
5
5
  g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
6
6
  (function (exports) {
@@ -120,7 +120,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
120
120
  }
121
121
  normalize() {
122
122
  const length = this.length;
123
- if (length != none) {
123
+ if (length !== none) {
124
124
  this.multTo(inverseFactorNumerator / length);
125
125
  }
126
126
  }
@@ -877,11 +877,13 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
877
877
  #domArray = [];
878
878
  #eventDispatcher = new EventDispatcher();
879
879
  #initialized = false;
880
+ #loadSequence = 0;
881
+ #loadSequences = new Map();
880
882
  get items() {
881
883
  return this.#domArray;
882
884
  }
883
885
  get version() {
884
- return "4.5.1";
886
+ return "4.5.2";
885
887
  }
886
888
  addEventListener(type, listener) {
887
889
  this.#eventDispatcher.addEventListener(type, listener);
@@ -911,44 +913,60 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
911
913
  return item;
912
914
  }
913
915
  async load(params) {
914
- await this.init();
915
916
  let domSourceElement;
916
917
  if (typeof HTMLElement !== "undefined" && params.element instanceof HTMLElement) {
917
918
  domSourceElement = params.element;
918
919
  }
919
- const { Container } = await Promise.resolve().then(function () { return Container$1; }), id = params.id ?? domSourceElement?.id ?? `tsparticles${Math.floor(getRandom() * loadRandomFactor).toString()}`, { index, url } = params, options = url ? await getDataFromUrl({ fallback: params.options, url, index }) : params.options, currentOptions = itemFromSingleOrMultiple(options, index), { items } = this, oldIndex = items.findIndex(v => v.id.description === id), newItem = new Container({
920
- dispatchCallback: (eventType, args) => {
921
- this.dispatchEvent(eventType, args);
922
- },
923
- id,
924
- onDestroy: (remove) => {
925
- if (!remove) {
926
- return;
927
- }
928
- const mainArr = this.items, idx = mainArr.indexOf(newItem);
929
- if (idx >= removeMinIndex) {
930
- mainArr.splice(idx, removeDeleteCount);
920
+ const id = params.id ?? domSourceElement?.id ?? `tsparticles${Math.floor(getRandom() * loadRandomFactor).toString()}`, loadSequence = ++this.#loadSequence;
921
+ this.#loadSequences.set(id, loadSequence);
922
+ try {
923
+ await this.init();
924
+ const { Container } = await Promise.resolve().then(function () { return Container$1; }), { index, url } = params, options = url ? await getDataFromUrl({ fallback: params.options, url, index }) : params.options;
925
+ if (this.#loadSequences.get(id) !== loadSequence) {
926
+ return undefined;
927
+ }
928
+ const currentOptions = itemFromSingleOrMultiple(options, index), { items } = this, oldIndex = items.findIndex(v => v.id.description === id), newItem = new Container({
929
+ dispatchCallback: (eventType, args) => {
930
+ this.dispatchEvent(eventType, args);
931
+ },
932
+ id,
933
+ onDestroy: (remove) => {
934
+ if (!remove) {
935
+ return;
936
+ }
937
+ const mainArr = this.items, idx = mainArr.indexOf(newItem);
938
+ if (idx >= removeMinIndex) {
939
+ mainArr.splice(idx, removeDeleteCount);
940
+ }
941
+ },
942
+ pluginManager: this.pluginManager,
943
+ sourceOptions: currentOptions,
944
+ });
945
+ if (oldIndex >= loadMinIndex) {
946
+ const old = this.item(oldIndex), deleteCount = old ? one : none;
947
+ if (old && !old.destroyed) {
948
+ old.destroy(false);
931
949
  }
932
- },
933
- pluginManager: this.pluginManager,
934
- sourceOptions: currentOptions,
935
- });
936
- if (oldIndex >= loadMinIndex) {
937
- const old = this.item(oldIndex), deleteCount = old ? one : none;
938
- if (old && !old.destroyed) {
939
- old.destroy(false);
950
+ items.splice(oldIndex, deleteCount, newItem);
951
+ }
952
+ else {
953
+ items.push(newItem);
940
954
  }
941
- items.splice(oldIndex, deleteCount, newItem);
955
+ const sourceCanvas = typeof OffscreenCanvas !== "undefined" && params.element instanceof OffscreenCanvas
956
+ ? params.element
957
+ : getCanvasFromContainer(getDomContainer(id, domSourceElement));
958
+ newItem.canvas.loadCanvas(sourceCanvas);
959
+ await newItem.start();
960
+ if (newItem.destroyed) {
961
+ return undefined;
962
+ }
963
+ return newItem;
942
964
  }
943
- else {
944
- items.push(newItem);
965
+ finally {
966
+ if (this.#loadSequences.get(id) === loadSequence) {
967
+ this.#loadSequences.delete(id);
968
+ }
945
969
  }
946
- const sourceCanvas = typeof OffscreenCanvas !== "undefined" && params.element instanceof OffscreenCanvas
947
- ? params.element
948
- : getCanvasFromContainer(getDomContainer(id, domSourceElement));
949
- newItem.canvas.loadCanvas(sourceCanvas);
950
- await newItem.start();
951
- return newItem;
952
970
  }
953
971
  async refresh(refresh = true) {
954
972
  if (!refresh) {
@@ -2256,6 +2274,13 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2256
2274
  }
2257
2275
  }
2258
2276
 
2277
+ function hasEnabledBlend(particleOptions) {
2278
+ if (!particleOptions || typeof particleOptions !== "object" || !("blend" in particleOptions)) {
2279
+ return false;
2280
+ }
2281
+ const blend = particleOptions.blend;
2282
+ return !!blend && typeof blend === "object" && "enable" in blend && !!blend.enable;
2283
+ }
2259
2284
  class BlendPlugin {
2260
2285
  id = "blend";
2261
2286
  async getPlugin(container) {
@@ -2277,12 +2302,31 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2277
2302
  options.blend.load(source?.blend);
2278
2303
  }
2279
2304
  needsPlugin(options) {
2280
- return !!options?.blend?.enable || !!options?.particles?.blend?.enable;
2305
+ if (options?.blend?.enable ||
2306
+ options?.particles?.blend?.enable ||
2307
+ Object.values(options?.particles?.groups ?? {}).some(hasEnabledBlend)) {
2308
+ return true;
2309
+ }
2310
+ const emitters = options?.["emitters"];
2311
+ let emitterList = [];
2312
+ if (Array.isArray(emitters)) {
2313
+ emitterList = emitters;
2314
+ }
2315
+ else if (emitters) {
2316
+ emitterList = [emitters];
2317
+ }
2318
+ return emitterList.some(emitter => {
2319
+ if (!emitter || typeof emitter !== "object" || !("particles" in emitter)) {
2320
+ return false;
2321
+ }
2322
+ const particles = emitter.particles;
2323
+ return Array.isArray(particles) ? particles.some(hasEnabledBlend) : hasEnabledBlend(particles);
2324
+ });
2281
2325
  }
2282
2326
  }
2283
2327
 
2284
2328
  async function loadBlendPlugin(engine) {
2285
- engine.checkVersion("4.5.1");
2329
+ engine.checkVersion("4.5.2");
2286
2330
  await engine.pluginManager.register(e => {
2287
2331
  e.pluginManager.addPlugin(new BlendPlugin());
2288
2332
  });
@@ -2319,7 +2363,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2319
2363
  }
2320
2364
 
2321
2365
  async function loadCircleShape(engine) {
2322
- engine.checkVersion("4.5.1");
2366
+ engine.checkVersion("4.5.2");
2323
2367
  await engine.pluginManager.register(e => {
2324
2368
  e.pluginManager.addShape(["circle"], () => {
2325
2369
  return Promise.resolve(new CircleDrawer());
@@ -2367,7 +2411,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2367
2411
  }
2368
2412
 
2369
2413
  async function loadHexColorPlugin(engine) {
2370
- engine.checkVersion("4.5.1");
2414
+ engine.checkVersion("4.5.2");
2371
2415
  await engine.pluginManager.register(e => {
2372
2416
  e.pluginManager.addColorManager("hex", new HexColorManager());
2373
2417
  });
@@ -2420,7 +2464,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2420
2464
  }
2421
2465
 
2422
2466
  async function loadHslColorPlugin(engine) {
2423
- engine.checkVersion("4.5.1");
2467
+ engine.checkVersion("4.5.2");
2424
2468
  await engine.pluginManager.register(e => {
2425
2469
  e.pluginManager.addColorManager("hsl", new HslColorManager());
2426
2470
  });
@@ -2452,7 +2496,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2452
2496
  }
2453
2497
 
2454
2498
  async function loadMovePlugin(engine) {
2455
- engine.checkVersion("4.5.1");
2499
+ engine.checkVersion("4.5.2");
2456
2500
  if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
2457
2501
  addErrorMessages(ErrorMessages$1);
2458
2502
  }
@@ -2662,7 +2706,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2662
2706
  }
2663
2707
 
2664
2708
  async function loadOpacityUpdater(engine) {
2665
- engine.checkVersion("4.5.1");
2709
+ engine.checkVersion("4.5.2");
2666
2710
  await engine.pluginManager.register(e => {
2667
2711
  e.pluginManager.addParticleUpdater("opacity", container => {
2668
2712
  return Promise.resolve(new OpacityUpdater(container));
@@ -2991,7 +3035,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
2991
3035
  }
2992
3036
 
2993
3037
  async function loadOutModesUpdater(engine) {
2994
- engine.checkVersion("4.5.1");
3038
+ engine.checkVersion("4.5.2");
2995
3039
  await engine.pluginManager.register(e => {
2996
3040
  e.pluginManager.addParticleUpdater("outModes", container => {
2997
3041
  return Promise.resolve(new OutOfCanvasUpdater(container));
@@ -3070,7 +3114,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3070
3114
  }
3071
3115
 
3072
3116
  async function loadPaintUpdater(engine) {
3073
- engine.checkVersion("4.5.1");
3117
+ engine.checkVersion("4.5.2");
3074
3118
  await engine.pluginManager.register(e => {
3075
3119
  e.pluginManager.addParticleUpdater("paint", container => {
3076
3120
  return Promise.resolve(new PaintUpdater(e.pluginManager, container));
@@ -3125,7 +3169,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3125
3169
  }
3126
3170
 
3127
3171
  async function loadRgbColorPlugin(engine) {
3128
- engine.checkVersion("4.5.1");
3172
+ engine.checkVersion("4.5.2");
3129
3173
  await engine.pluginManager.register(e => {
3130
3174
  e.pluginManager.addColorManager("rgb", new RgbColorManager());
3131
3175
  });
@@ -3210,7 +3254,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3210
3254
  }
3211
3255
 
3212
3256
  async function loadSizeUpdater(engine) {
3213
- engine.checkVersion("4.5.1");
3257
+ engine.checkVersion("4.5.2");
3214
3258
  await engine.pluginManager.register(e => {
3215
3259
  e.pluginManager.addParticleUpdater("size", container => {
3216
3260
  return Promise.resolve(new SizeUpdater(container));
@@ -3219,7 +3263,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3219
3263
  }
3220
3264
 
3221
3265
  async function loadBasic(engine) {
3222
- engine.checkVersion("4.5.1");
3266
+ engine.checkVersion("4.5.2");
3223
3267
  await engine.pluginManager.register(async (e) => {
3224
3268
  await Promise.all([
3225
3269
  loadBlendPlugin(e),
@@ -3454,7 +3498,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3454
3498
  })(EmitterClickMode || (EmitterClickMode = {}));
3455
3499
 
3456
3500
  async function loadEmittersPluginSimple(engine) {
3457
- engine.checkVersion("4.5.1");
3501
+ engine.checkVersion("4.5.2");
3458
3502
  if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
3459
3503
  addErrorMessages(ErrorMessages);
3460
3504
  }
@@ -3696,7 +3740,8 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3696
3740
  });
3697
3741
  }
3698
3742
  drawParticles(delta) {
3699
- const { particles, actualOptions } = this.#container, clearedPlugin = this.clear();
3743
+ const { particles, actualOptions } = this.#container;
3744
+ this.clear();
3700
3745
  particles.update(delta);
3701
3746
  this.draw(ctx => {
3702
3747
  const width = this.#canvasManager.size.width, height = this.#canvasManager.size.height;
@@ -3718,9 +3763,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3718
3763
  }
3719
3764
  }
3720
3765
  for (const plugin of this.#getLayerPlugins(DrawLayer.BackgroundMask)) {
3721
- if (plugin !== clearedPlugin) {
3722
- plugin.canvasPaint?.();
3723
- }
3766
+ plugin.canvasPaint?.();
3724
3767
  }
3725
3768
  for (const plugin of this.#getLayerPlugins(DrawLayer.CanvasSetup)) {
3726
3769
  plugin.drawSettingsSetup?.(ctx, delta);
@@ -3810,6 +3853,9 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
3810
3853
  ctx.clearRect(originPoint.x, originPoint.y, this.#canvasManager.size.width, this.#canvasManager.size.height);
3811
3854
  });
3812
3855
  }
3856
+ updateBackgroundElement() {
3857
+ this.#resolveBackgroundElement();
3858
+ }
3813
3859
  #applyPostDrawUpdaters(particle) {
3814
3860
  for (const updater of this.#postDrawUpdaters) {
3815
3861
  updater.afterDraw?.(particle);
@@ -4008,7 +4054,14 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
4008
4054
  }
4009
4055
  if (typeof background.element === "string") {
4010
4056
  if (typeof document !== "undefined") {
4011
- const node = document.querySelector(background.element);
4057
+ let node;
4058
+ try {
4059
+ node = document.querySelector(background.element);
4060
+ }
4061
+ catch {
4062
+ this.#warnOnce("background-element-invalid-selector", `Background element selector "${background.element}" is invalid`);
4063
+ return;
4064
+ }
4012
4065
  if (node && this.#isSupportedElement(node)) {
4013
4066
  this.#backgroundElement = node;
4014
4067
  }
@@ -4832,10 +4885,10 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
4832
4885
  runParticleCreatedPlugins(container, this);
4833
4886
  }
4834
4887
  isInsideCanvas(direction) {
4835
- return this.#getInsideCanvasResult({ direction }).inside;
4888
+ return this.#getInsideCanvasResult(direction).inside;
4836
4889
  }
4837
4890
  isInsideCanvasForOutMode(outMode, direction) {
4838
- return this.#getInsideCanvasResult({ direction, outMode }).inside;
4891
+ return this.#getInsideCanvasResult(direction, outMode).inside;
4839
4892
  }
4840
4893
  isShowingBack() {
4841
4894
  if (!this.roll) {
@@ -4952,7 +5005,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
4952
5005
  });
4953
5006
  }
4954
5007
  #getDefaultInsideCanvasResult(direction, outMode) {
4955
- const radius = this.getRadius(), canvasSize = this.#container.canvas.size, position = this.position, isBounce = outMode === OutMode.bounce;
5008
+ const radius = this.getRadius(), canvasSize = this.#container.canvas.size, position = this.position, isBounce = outMode === OutMode.bounce || outMode === OutMode.split;
4956
5009
  if (direction === OutModeDirection.bottom) {
4957
5010
  return {
4958
5011
  inside: isBounce ? position.y + radius < canvasSize.height : position.y - radius < canvasSize.height,
@@ -4994,12 +5047,16 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
4994
5047
  radius: this.getRadius(),
4995
5048
  };
4996
5049
  }
4997
- #getInsideCanvasResult(data) {
4998
- const defaultResult = this.#getDefaultInsideCanvasResult(data.direction, data.outMode), container = this.#container, shapeDrawer = this.shape ? container.shapeDrawers.get(this.shape) : undefined, effectDrawer = this.effect ? container.effectDrawers.get(this.effect) : undefined, shapeCheck = shapeDrawer?.isInsideCanvas, effectCheck = effectDrawer?.isInsideCanvas;
4999
- if (!shapeCheck && !effectCheck) {
5050
+ #getInsideCanvasResult(direction, outMode) {
5051
+ const defaultResult = this.#getDefaultInsideCanvasResult(direction, outMode), container = this.#container, shapeDrawer = this.shape ? container.shapeDrawers.get(this.shape) : undefined, effectDrawer = this.effect ? container.effectDrawers.get(this.effect) : undefined;
5052
+ if (!shapeDrawer?.isInsideCanvas && !effectDrawer?.isInsideCanvas) {
5000
5053
  return defaultResult;
5001
5054
  }
5002
- const callbackData = this.#getInsideCanvasCallbackData(data.direction, data.outMode), shapeResult = shapeCheck ? this.#normalizeInsideCanvasResult(shapeCheck(callbackData), "shape") : undefined, effectResult = effectCheck ? this.#normalizeInsideCanvasResult(effectCheck(callbackData), "effect") : undefined;
5055
+ const callbackData = this.#getInsideCanvasCallbackData(direction, outMode), shapeResult = shapeDrawer?.isInsideCanvas
5056
+ ? this.#normalizeInsideCanvasResult(shapeDrawer.isInsideCanvas(callbackData), "shape")
5057
+ : undefined, effectResult = effectDrawer?.isInsideCanvas
5058
+ ? this.#normalizeInsideCanvasResult(effectDrawer.isInsideCanvas(callbackData), "effect")
5059
+ : undefined;
5003
5060
  if (shapeResult && effectResult) {
5004
5061
  const margin = Math.max(shapeResult.margin ?? defaultAngle, effectResult.margin ?? defaultAngle);
5005
5062
  return {
@@ -5065,8 +5122,8 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
5065
5122
  }
5066
5123
 
5067
5124
  class SpatialHashGrid {
5068
- #cellSize;
5069
5125
  #cells = new Map();
5126
+ #cellSize;
5070
5127
  #circlePool = [];
5071
5128
  #circlePoolIdx;
5072
5129
  #pendingCellSize;
@@ -5724,8 +5781,8 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
5724
5781
  particleCreatedPlugins;
5725
5782
  particleDestroyedPlugins;
5726
5783
  particlePositionPlugins;
5727
- particleUpdaters;
5728
5784
  particles;
5785
+ particleUpdaters;
5729
5786
  peakNits;
5730
5787
  plugins;
5731
5788
  retina;
@@ -6019,6 +6076,7 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
6019
6076
  refresh = plugin.updateActualOptions() || refresh;
6020
6077
  }
6021
6078
  }
6079
+ this.canvas.render.updateBackgroundElement();
6022
6080
  return refresh;
6023
6081
  }
6024
6082
  #initPlugins(allContainerPlugins) {
@@ -6575,6 +6633,10 @@ g.__tsParticlesInternals.presets = g.__tsParticlesInternals.presets || {};
6575
6633
  if (this.options.spawn.stroke?.color) {
6576
6634
  this.spawnStrokeColor = rangeColorToHsl(this.#pluginManager, this.options.spawn.stroke.color);
6577
6635
  }
6636
+ const spawnFill = this.options.spawn.fill, spawnStroke = this.options.spawn.stroke;
6637
+ this.spawnFillOpacity = spawnFill?.opacity === undefined ? defaultOpacity$1 : getRangeValue(spawnFill.opacity);
6638
+ this.spawnStrokeOpacity = spawnStroke?.opacity === undefined ? defaultOpacity$1 : getRangeValue(spawnStroke.opacity);
6639
+ this.spawnStrokeWidth = spawnStroke?.width === undefined ? defaultStrokeWidth : getRangeValue(spawnStroke.width);
6578
6640
  this.#paused = !this.options.autoPlay;
6579
6641
  this.#particlesOptions = particlesOptions;
6580
6642
  this.#size = this.#calcSize();