@tsparticles/stencil 4.1.0 → 4.1.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.
- package/dist/cjs/{Container-BgrQ9X1Y.js → Container-BB03Liy1.js} +1 -1
- package/dist/cjs/{index-BVpl32PS.js → index-WCJ4NcqE.js} +2 -2
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/stencil-particles.cjs.entry.js +1 -1
- package/dist/esm/{Container-CnBnOoAX.js → Container-C5hHCYio.js} +1 -1
- package/dist/esm/{index-CvOgrLtq.js → index-DYnEUqIm.js} +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/stencil-particles.entry.js +1 -1
- package/dist/tsparticlesstencil/index.esm.js +1 -1
- package/dist/tsparticlesstencil/{p-5d451d52.entry.js → p-4488fb9d.entry.js} +1 -1
- package/dist/tsparticlesstencil/{p-DeRPmYjK.js → p-C8gVqIeD.js} +1 -1
- package/dist/tsparticlesstencil/p-h0XxhONB.js +1 -0
- package/dist/tsparticlesstencil/tsparticlesstencil.esm.js +1 -1
- package/package.json +3 -3
- package/dist/tsparticlesstencil/p-GDIBBfAF.js +0 -1
|
@@ -833,7 +833,7 @@ class Engine {
|
|
|
833
833
|
return this.#domArray;
|
|
834
834
|
}
|
|
835
835
|
get version() {
|
|
836
|
-
return "4.1.
|
|
836
|
+
return "4.1.2";
|
|
837
837
|
}
|
|
838
838
|
addEventListener(type, listener) {
|
|
839
839
|
this.#eventDispatcher.addEventListener(type, listener);
|
|
@@ -868,7 +868,7 @@ class Engine {
|
|
|
868
868
|
if (typeof HTMLElement !== "undefined" && params.element instanceof HTMLElement) {
|
|
869
869
|
domSourceElement = params.element;
|
|
870
870
|
}
|
|
871
|
-
const { Container } = await Promise.resolve().then(function () { return require('./Container-
|
|
871
|
+
const { Container } = await Promise.resolve().then(function () { return require('./Container-BB03Liy1.js'); }), 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({
|
|
872
872
|
dispatchCallback: (eventType, args) => {
|
|
873
873
|
this.dispatchEvent(eventType, args);
|
|
874
874
|
},
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RangeType, c as checkDistance, s as squareExp, a as isNull, b as setRangeValue, h as hMin, d as hMax, l as lMin, e as lMax, f as sMin, g as sMax, j as isString, k as isArray, m as deepExtend, P as PixelMode, O as OutMode, M as MoveDirection, n as isNumber, o as isObject, L as LimitMode, p as executeOnSingleOrMultiple, q as isBoolean, r as originPoint, u as minStrokeWidth, v as defaultZoom, w as itemFromArray, x as defaultOpacity, y as randomColorValue, z as half, A as AlterType, B as lFactor, C as double, D as hPhase, E as rgbMax, F as getRandomInRange, G as identity, H as defaultRgbMin, I as sextuple, J as triple, K as phaseNumerator, N as sNormalizedOffset, Q as minimumSize, S as defaultCompositeValue, T as defaultTransformValue, U as zIndexFactorOffset, V as safeMutationObserver, W as generatedAttribute, X as cloneStyle, Y as safeMatchMedia, Z as getFullScreenStyle, _ as safeDocument, $ as millisecondsToSeconds, a0 as manageListener, a1 as visibilityChangeEvent, a2 as resizeEvent, a3 as Vector3d, a4 as EventType, a5 as defaultAngle, a6 as defaultTransform, a7 as ParticleOutType, a8 as itemFromSingleOrMultiple, a9 as getRandom, aa as defaultRetryCount, ab as tryCountIncrement, ac as getParticleBaseVelocity, ad as randomInRangeValue, ae as OutModeDirection, af as clamp, ag as minZ, ah as getPosition, ai as getParticleDirectionAngle, aj as Vector, ak as getRangeValue, al as doublePI, am as calcExactPositionOrRandomFromSize, an as isInArray, ao as degToRad, ap as spatialHashGridCellSize, aq as minLimit, ar as minCount, as as getLogger, at as minIndex, au as defaultRemoveQuantity, av as defaultDensityFactor, aw as empty, ax as deleteCount, ay as countOffset, az as one, aA as defaultRatio, aB as defaultReduceFactor, aC as animate, aD as defaultFpsLimit, aE as minFpsLimit, aF as cancelAnimation, aG as defaultFps } from './index-
|
|
1
|
+
import { R as RangeType, c as checkDistance, s as squareExp, a as isNull, b as setRangeValue, h as hMin, d as hMax, l as lMin, e as lMax, f as sMin, g as sMax, j as isString, k as isArray, m as deepExtend, P as PixelMode, O as OutMode, M as MoveDirection, n as isNumber, o as isObject, L as LimitMode, p as executeOnSingleOrMultiple, q as isBoolean, r as originPoint, u as minStrokeWidth, v as defaultZoom, w as itemFromArray, x as defaultOpacity, y as randomColorValue, z as half, A as AlterType, B as lFactor, C as double, D as hPhase, E as rgbMax, F as getRandomInRange, G as identity, H as defaultRgbMin, I as sextuple, J as triple, K as phaseNumerator, N as sNormalizedOffset, Q as minimumSize, S as defaultCompositeValue, T as defaultTransformValue, U as zIndexFactorOffset, V as safeMutationObserver, W as generatedAttribute, X as cloneStyle, Y as safeMatchMedia, Z as getFullScreenStyle, _ as safeDocument, $ as millisecondsToSeconds, a0 as manageListener, a1 as visibilityChangeEvent, a2 as resizeEvent, a3 as Vector3d, a4 as EventType, a5 as defaultAngle, a6 as defaultTransform, a7 as ParticleOutType, a8 as itemFromSingleOrMultiple, a9 as getRandom, aa as defaultRetryCount, ab as tryCountIncrement, ac as getParticleBaseVelocity, ad as randomInRangeValue, ae as OutModeDirection, af as clamp, ag as minZ, ah as getPosition, ai as getParticleDirectionAngle, aj as Vector, ak as getRangeValue, al as doublePI, am as calcExactPositionOrRandomFromSize, an as isInArray, ao as degToRad, ap as spatialHashGridCellSize, aq as minLimit, ar as minCount, as as getLogger, at as minIndex, au as defaultRemoveQuantity, av as defaultDensityFactor, aw as empty, ax as deleteCount, ay as countOffset, az as one, aA as defaultRatio, aB as defaultReduceFactor, aC as animate, aD as defaultFpsLimit, aE as minFpsLimit, aF as cancelAnimation, aG as defaultFps } from './index-DYnEUqIm.js';
|
|
2
2
|
|
|
3
3
|
class BaseRange {
|
|
4
4
|
position;
|
|
@@ -831,7 +831,7 @@ class Engine {
|
|
|
831
831
|
return this.#domArray;
|
|
832
832
|
}
|
|
833
833
|
get version() {
|
|
834
|
-
return "4.1.
|
|
834
|
+
return "4.1.2";
|
|
835
835
|
}
|
|
836
836
|
addEventListener(type, listener) {
|
|
837
837
|
this.#eventDispatcher.addEventListener(type, listener);
|
|
@@ -866,7 +866,7 @@ class Engine {
|
|
|
866
866
|
if (typeof HTMLElement !== "undefined" && params.element instanceof HTMLElement) {
|
|
867
867
|
domSourceElement = params.element;
|
|
868
868
|
}
|
|
869
|
-
const { Container } = await import('./Container-
|
|
869
|
+
const { Container } = await import('./Container-C5hHCYio.js'), 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({
|
|
870
870
|
dispatchCallback: (eventType, args) => {
|
|
871
871
|
this.dispatchEvent(eventType, args);
|
|
872
872
|
},
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { i as initParticlesEngine, aH as isParticlesEngineInitialized, aI as waitForParticlesEngineInitialization } from './index-
|
|
1
|
+
export { i as initParticlesEngine, aH as isParticlesEngineInitialized, aI as waitForParticlesEngineInitialization } from './index-DYnEUqIm.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-DKFk70aj.js';
|
|
2
|
-
import { i as initParticlesEngine, t as tsParticles } from './index-
|
|
2
|
+
import { i as initParticlesEngine, t as tsParticles } from './index-DYnEUqIm.js';
|
|
3
3
|
|
|
4
4
|
const StencilParticles = class {
|
|
5
5
|
constructor(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{i as initParticlesEngine,aH as isParticlesEngineInitialized,aI as waitForParticlesEngineInitialization}from"./p-
|
|
1
|
+
export{i as initParticlesEngine,aH as isParticlesEngineInitialized,aI as waitForParticlesEngineInitialization}from"./p-C8gVqIeD.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as i}from"./p-DKFk70aj.js";import{i as s,t as e}from"./p-
|
|
1
|
+
import{r as t,h as i}from"./p-DKFk70aj.js";import{i as s,t as e}from"./p-C8gVqIeD.js";const n=class{constructor(i){t(this,i),this.renderId=0}async componentDidLoad(){await this.loadParticles(++this.renderId)}disconnectedCallback(){var t;this.renderId++,null===(t=this.container)||void 0===t||t.destroy(),this.container=void 0}async onPropsChange(){await this.loadParticles(++this.renderId)}async loadParticles(t){var i;if(null===(i=this.container)||void 0===i||i.destroy(),!this.containerElement)return void console.warn("[stencil-particles] container element not available yet");let n;try{if(this.init&&await s(this.init),!this.options&&!this.url)return void console.warn("[stencil-particles] neither options nor url provided");const t=Object.assign({element:this.containerElement},this.options?{options:this.options}:{url:this.url});n=await e.load(t)}catch(t){return void console.error("[stencil-particles] load failed",t)}t===this.renderId?this.container=n:null==n||n.destroy()}render(){return i("div",{key:"870e2cc222aed94f8bbfa274dc3c047392ed8b1a",ref:t=>{this.containerElement=t},style:{width:"100%",height:"100%"}})}static get watchers(){return{options:[{onPropsChange:0}],url:[{onPropsChange:0}],init:[{onPropsChange:0}]}}};export{n as stencil_particles}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t="generated",e="source-over",n="resize",s="visibilitychange",i=100,a=.5,r=1e3,o={x:0,y:0,z:0},c={a:1,b:0,c:0,d:1},u="random",h=2,f=2*Math.PI,l=60,d="true",p="false",g="canvas",w=0,m=2,y=100,v=1,M=1,b=1,E=255,P=360,x=100,S=100,A=0,L=0,k=60,q=0,z=1,D=0,O=1,C=1,T=120,$=0,F=1,j=1,B=0,H=0,I=1,_=0,N=0,R=1,G=1,J=0,U=1,W=0,V=1,K=0,Q=3,X=6,Y=1,Z=1,tt=0,et=1;var nt;function st(t){return"z"in t?t.z:o.z}!function(t){t.bottom="bottom",t.bottomLeft="bottom-left",t.bottomRight="bottom-right",t.left="left",t.none="none",t.right="right",t.top="top",t.topLeft="top-left",t.topRight="top-right",t.outside="outside",t.inside="inside"}(nt||(nt={}));class it{x;y;z;constructor(t=o.x,e=o.y,n=o.z){this.x=t,this.y=e,this.z=n}static get origin(){return it.create(o.x,o.y,o.z)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this.#t(t,this.length)}get length(){return Math.sqrt(this.getLengthSq())}set length(t){this.#t(this.angle,t)}static clone(t){return it.create(t.x,t.y,st(t))}static create(t,e,n){return"number"==typeof t?new it(t,e??o.y,n??o.z):new it(t.x,t.y,st(t))}add(t){return it.create(this.x+t.x,this.y+t.y,this.z+st(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=st(t)}copy(){return it.clone(this)}div(t){return it.create(this.x/t,this.y/t,this.z/t)}divTo(t){this.x/=t,this.y/=t,this.z/=t}getLengthSq(){return this.x**2+this.y**2}mult(t){return it.create(this.x*t,this.y*t,this.z*t)}multTo(t){this.x*=t,this.y*=t,this.z*=t}normalize(){const t=this.length;0!=t&&this.multTo(1/t)}rotate(t){return it.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),o.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=st(t)}sub(t){return it.create(this.x-t.x,this.y-t.y,this.z-st(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=st(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class at extends it{constructor(t=o.x,e=o.y){super(t,e,o.z)}static get origin(){return at.create(o.x,o.y)}static clone(t){return at.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new at(t,e??o.y):new at(t.x,t.y)}}function rt(t){return"boolean"==typeof t}function ot(t){return"string"==typeof t}function ct(t){return"number"==typeof t}function ut(t){return"object"==typeof t&&null!==t}function ht(t){return Array.isArray(t)}function ft(t){return null==t}const lt=Math.PI/180;let dt=Math.random;function pt(){return yt(dt(),0,1-Number.EPSILON)}function gt(t,e){return pt()*(e-t)+t}function wt(t){return requestAnimationFrame(t)}function mt(t){cancelAnimationFrame(t)}function yt(t,e,n){return Math.min(Math.max(t,e),n)}function vt(t){const e=Et(t);let n=bt(t);return e===n&&(n=0),gt(n,e)}function Mt(t){return ct(t)?t:vt(t)}function bt(t){return ct(t)?t:t.min}function Et(t){return ct(t)?t:t.max}function Pt(t,e){if(t===e||void 0===e&&ct(t))return t;const n=bt(t),s=Et(t);return void 0!==e?{min:Math.min(n,e),max:Math.max(s,e)}:Pt(n,s)}function xt(t,e,n){return function(t,e){const n=t.x-e.x,s=t.y-e.y;return n*n+s*s}(t,e)<=n*n}function St(t){return t*lt}function At(t,e,n){if(ct(t))return St(t);switch(t){case nt.top:return.5*-Math.PI;case nt.topRight:return.25*-Math.PI;case nt.right:return 0;case nt.bottomRight:return.25*Math.PI;case nt.bottom:return.5*Math.PI;case nt.bottomLeft:return.75*Math.PI;case nt.left:return Math.PI;case nt.topLeft:return.75*-Math.PI;case nt.inside:return Math.atan2(n.y-e.y,n.x-e.x);case nt.outside:return Math.atan2(e.y-n.y,e.x-n.x);default:return pt()*f}}function Lt(t){const e=at.origin;return e.length=1,e.angle=t,e}function kt(t){const{position:e,size:n}=t;return{x:e?.x??pt()*n.width,y:e?.y??pt()*n.height}}var qt,zt,Dt,Ot,Ct,Tt;function $t(){return globalThis.document}function Ft(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function jt(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function Bt(t,e){return t===e||ht(e)&&e.includes(t)}function Ht(t,e,n=!0){return t[void 0!==e&&n?e%t.length:function(t){return Math.floor(pt()*t.length)}(t)]}function It(t,...e){for(const n of e){if(ft(n))continue;if(!ut(n)){t=n;continue}Array.isArray(n)?Array.isArray(t)||(t=[]):ut(t)&&!Array.isArray(t)||(t={});const e=Object.keys(n),s=new Set(["__proto__","constructor","prototype"]);if(e.some((t=>{const e=n[t];return ut(e)||Array.isArray(e)})))for(const i of e){if(s.has(i))continue;const e=t,a=n[i];e[i]=Array.isArray(a)?a.map((t=>It(void 0,t))):It(e[i],a)}else{const i=n,a=t;for(const t of e)if(!s.has(t)&&t in i){const e=i[t];void 0!==e&&(a[t]=e)}}}return t}function _t(t,e){return ht(t)?t.map(((t,n)=>e(t,n))):e(t,0)}function Nt(t,e,n){return ht(t)?Ht(t,e,n):t}function Rt(t,e){return function(t,e){if(t.mode!==Ct.percent){const{mode:e,...n}=t;return n}return"x"in t?{x:t.x/i*e.width,y:t.y/i*e.height}:{width:t.width/i*e.width,height:t.height/i*e.height}}(t,e)}function Gt(t){const e=$t().createElement("div").style;for(const n in t){const s=t[n];if(!(n in t)||ft(s))continue;const i=t.getPropertyValue?.(s);if(!i)continue;const a=t.getPropertyPriority?.(s);a?e.setProperty(s,i,a):e.setProperty(s,i)}return e}!function(t){t.auto="auto",t.increase="increase",t.decrease="decrease",t.random="random"}(qt||(qt={})),function(t){t.increasing="increasing",t.decreasing="decreasing"}(zt||(zt={})),function(t){t.none="none",t.max="max",t.min="min"}(Dt||(Dt={})),function(t){t.bottom="bottom",t.left="left",t.right="right",t.top="top"}(Ot||(Ot={})),function(t){t.precise="precise",t.percent="percent"}(Ct||(Ct={})),function(t){t.max="max",t.min="min",t.random="random"}(Tt||(Tt={}));const Jt=function(){const t=new Map,e=undefined,n=(t,e=new WeakSet)=>{if(null===t)return"null";const s=typeof t;if("undefined"===s)return"undefined";if("number"===s||"boolean"===s||"string"===s)return JSON.stringify(t);if("function"===s)try{return t.toString()}catch{return'"[Function]"'}if("symbol"===s)try{return t.toString()}catch{return'"[Symbol]"'}return Array.isArray(t)?`[${t.map((t=>n(t,e))).join(",")}]`:e.has(t)?'"[Circular]"':(e.add(t),`{${Object.keys(t).sort().map((s=>`${JSON.stringify(s)}:${n(t[s],e)}`)).join(",")}}`)};return(...s)=>{const i=(t=>e?e(t):(t=>n(t))(t))(s),a=Date.now(),r=t.get(i);if(void 0!==r)return t.delete(i),t.set(i,{value:r.value,ts:r.ts}),r.value;const o=function(t){const e=$t().createElement("div").style,n={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(10),"z-index":t.toString(10),top:"0",left:"0","pointer-events":"none"};for(const t in n){const s=n[t];void 0!==s&&e.setProperty(t,s)}return e}(...s);return t.set(i,{value:o,ts:a}),o}}();function Ut(t,e,n,s,i){if(s){let s={passive:!0};rt(i)?s.capture=i:void 0!==i&&(s=i),t.addEventListener(e,n,s)}else t.removeEventListener(e,n,i)}async function Wt(t,e,n,s=!1){let i=e.get(t);if(!i||s){const s=await Promise.all([...n.entries()].map((([e,n])=>n(t).then((t=>[e,t])))));i=new Map(s),e.set(t,i)}return i}class Vt{#e;constructor(){this.#e=new Map}addEventListener(t,e){this.removeEventListener(t,e);let n=this.#e.get(t);n||(n=[],this.#e.set(t,n)),n.push(e)}dispatchEvent(t,e){const n=this.#e.get(t);n?.forEach((t=>{t(e)}))}hasEventListener(t){return!!this.#e.get(t)}removeAllEventListeners(t){t?this.#e.delete(t):this.#e=new Map}removeEventListener(t,e){const n=this.#e.get(t);if(!n)return;const s=n.length,i=n.indexOf(e);i<0||(1===s?this.#e.delete(t):n.splice(i,1))}}var Kt;!function(t){t.configAdded="configAdded",t.containerInit="containerInit",t.particlesSetup="particlesSetup",t.containerStarted="containerStarted",t.containerStopped="containerStopped",t.containerDestroyed="containerDestroyed",t.containerPaused="containerPaused",t.containerPlay="containerPlay",t.containerBuilt="containerBuilt",t.particleAdded="particleAdded",t.particleDestroyed="particleDestroyed",t.particleRemoved="particleRemoved"}(Kt||(Kt={}));class Qt{colorManagers=new Map;easingFunctions=new Map;effectDrawers=new Map;initializers={effects:new Map,shapes:new Map,updaters:new Map};palettes=new Map;plugins=[];presets=new Map;shapeDrawers=new Map;updaters=new Map;#n=new Set;#s=new Map;#i;#a=new Set;#r=!1;#o=!1;#c=new Set;constructor(t){this.#i=t}get configs(){const t={};for(const[e,n]of this.#s)t[e]=n;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(t){const e=t.key??t.name??"default";this.#s.set(e,t),this.#i.dispatchEvent(Kt.configAdded,{data:{name:e,config:t}})}addEasing(t,e){this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.initializers.effects.set(t,e)}addPalette(t,e){this.palettes.set(t,e)}addParticleUpdater(t,e){this.initializers.updaters.set(t,e)}addPlugin(t){this.getPlugin(t.id)||this.plugins.push(t)}addPreset(t,e,n=!1){!n&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){for(const n of t)this.initializers.shapes.set(n,e)}clearPlugins(t){this.effectDrawers.delete(t),this.shapeDrawers.delete(t),this.updaters.delete(t)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getEffectDrawers(t,e=!1){return Wt(t,this.effectDrawers,this.initializers.effects,e)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.plugins.find((e=>e.id===t))}getPreset(t){return this.presets.get(t)}async getShapeDrawers(t,e=!1){return Wt(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return async function(t,e,n,s=!1){let i=e.get(t);return i&&!s||(i=await Promise.all([...n.values()].map((e=>e(t)))),e.set(t,i)),i}(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this.#r&&!this.#o){this.#o=!0,this.#a=new Set,this.#n=new Set(this.#c);try{for(const t of this.#n)await this.#u(t,this.#a,this.#n)}finally{this.#c.clear(),this.#o=!1,this.#r=!0}}}loadParticlesOptions(t,e,...n){const s=this.updaters.get(t);s&&s.forEach((t=>t.loadOptions?.(e,...n)))}async register(...t){if(this.#r)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this.#o?await this.#u(e,this.#a,this.#n):this.#c.add(e)}async#u(t,e,n){e.has(t)||(e.add(t),n.add(t),await t(this.#i))}}const Xt=t=>(...e)=>{t(...e)},Yt={debug:Xt(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:Xt(console.info),log:Xt(console.log),trace:Xt(console.trace),verbose:Xt(console.log),warning:Xt(console.warn)};function Zt(){return Yt}const te="100%";var ee,ne,se,ie,ae,re,oe,ce;!function(t){t.circle="circle",t.rectangle="rectangle"}(ee||(ee={})),function(t){t.clockwise="clockwise",t.counterClockwise="counter-clockwise",t.random="random"}(ne||(ne={})),function(t){t.delete="delete",t.wait="wait"}(se||(se={})),function(t){t.bounce="bounce",t.none="none",t.out="out",t.destroy="destroy",t.split="split"}(ie||(ie={})),function(t){t.darken="darken",t.enlighten="enlighten"}(ae||(ae={})),function(t){t.linear="linear",t.radial="radial",t.random="random"}(re||(re={})),function(t){t.normal="normal",t.inside="inside",t.outside="outside"}(oe||(oe={})),function(t){t.easeInBack="ease-in-back",t.easeInBounce="ease-in-bounce",t.easeInCirc="ease-in-circ",t.easeInCubic="ease-in-cubic",t.easeInElastic="ease-in-elastic",t.easeInExpo="ease-in-expo",t.easeInGaussian="ease-in-gaussian",t.easeInLinear="ease-in-linear",t.easeInQuad="ease-in-quad",t.easeInQuart="ease-in-quart",t.easeInQuint="ease-in-quint",t.easeInSigmoid="ease-in-sigmoid",t.easeInSine="ease-in-sine",t.easeInSmoothstep="ease-in-smoothstep",t.easeOutBack="ease-out-back",t.easeOutBounce="ease-out-bounce",t.easeOutCirc="ease-out-circ",t.easeOutCubic="ease-out-cubic",t.easeOutElastic="ease-out-elastic",t.easeOutExpo="ease-out-expo",t.easeOutGaussian="ease-out-gaussian",t.easeOutLinear="ease-out-linear",t.easeOutQuad="ease-out-quad",t.easeOutQuart="ease-out-quart",t.easeOutQuint="ease-out-quint",t.easeOutSigmoid="ease-out-sigmoid",t.easeOutSine="ease-out-sine",t.easeOutSmoothstep="ease-out-smoothstep",t.easeInOutBack="ease-in-out-back",t.easeInOutBounce="ease-in-out-bounce",t.easeInOutCirc="ease-in-out-circ",t.easeInOutCubic="ease-in-out-cubic",t.easeInOutElastic="ease-in-out-elastic",t.easeInOutExpo="ease-in-out-expo",t.easeInOutGaussian="ease-in-out-gaussian",t.easeInOutLinear="ease-in-out-linear",t.easeInOutQuad="ease-in-out-quad",t.easeInOutQuart="ease-in-out-quart",t.easeInOutQuint="ease-in-out-quint",t.easeInOutSigmoid="ease-in-out-sigmoid",t.easeInOutSine="ease-in-out-sine",t.easeInOutSmoothstep="ease-in-out-smoothstep"}(ce||(ce={}));const ue=new class{pluginManager=new Qt(this);#h=[];#f=new Vt;#r=!1;get items(){return this.#h}get version(){return"4.1.0"}addEventListener(t,e){this.#f.addEventListener(t,e)}checkVersion(t){if(this.version!==t)throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${this.version}. Plugin version: ${t}`)}dispatchEvent(t,e){this.#f.dispatchEvent(t,e)}async init(){this.#r||(await this.pluginManager.init(),this.#r=!0)}item(t){const e=this.items,n=e[t];if(!n?.destroyed)return n;e.splice(t,1)}async load(e){let n;await this.init(),"undefined"!=typeof HTMLElement&&e.element instanceof HTMLElement&&(n=e.element);const{Container:s}=await import("./p-GDIBBfAF.js"),i=e.id??n?.id??`tsparticles${Math.floor(1e4*pt()).toString()}`,{index:a,url:r}=e,o=r?await async function(t){const e=Nt(t.url,t.index);if(!e)return t.fallback;const n=await fetch(e);return n.ok?await n.json():(Zt().error(`${n.status.toString()} while retrieving config file`),t.fallback)}({fallback:e.options,url:r,index:a}):e.options,c=Nt(o,a),{items:u}=this,h=u.findIndex((t=>t.id.description===i)),f=new s({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:i,onDestroy:t=>{if(!t)return;const e=this.items,n=e.indexOf(f);n>=0&&e.splice(n,1)},pluginManager:this.pluginManager,sourceOptions:c});if(h>=0){const t=this.item(h),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),u.splice(h,e,f)}else u.push(f);const l="undefined"!=typeof OffscreenCanvas&&e.element instanceof OffscreenCanvas?e.element:(e=>{const n=$t();let s;if(e instanceof HTMLCanvasElement||e.tagName.toLowerCase()===g)s=e,s.dataset[t]??=p,s.dataset[t]===d&&(s.style.width||=te,s.style.height||=te,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none"));else{const i=e.getElementsByTagName(g).item(0);i?(s=i,s.dataset[t]=p):(s=n.createElement(g),s.dataset[t]=d,e.appendChild(s)),s.style.width||=te,s.style.height||=te,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(((e,n)=>{const s=$t();let i=n??s.getElementById(e);return i||(i=s.createElement("canvas"),i.id=e,i.dataset[t]=d,s.body.append(i),i)})(i,n));return f.canvas.loadCanvas(l),await f.start(),f}async refresh(t=!0){t&&await Promise.all(this.items.map((t=>t.refresh())))}removeEventListener(t,e){this.#f.removeEventListener(t,e)}};let he,fe,le=!1;async function de(t){if(!le)if(he){if(fe!==t)throw new Error("initParticlesEngine callback must be stable across the app lifecycle.");await he}else fe=t,he=(async()=>{t&&await t(ue),"function"==typeof ue.init&&await ue.init(),le=!0})().catch((t=>{throw he=void 0,fe=void 0,le=!1,t})),await he}function pe(){return le}async function ge(){await(null!=he?he:Promise.resolve())}export{r as $,ae as A,V as B,h as C,k as D,E,gt as F,U as G,tt as H,X as I,Q as J,Z as K,se as L,nt as M,Y as N,ie as O,Ct as P,D as Q,ee as R,e as S,z as T,O as U,jt as V,t as W,Gt as X,Ft as Y,Jt as Z,$t as _,ft as a,Ut as a0,s as a1,n as a2,it as a3,Kt as a4,J as a5,c as a6,oe as a7,Nt as a8,pt as a9,M as aA,b as aB,wt as aC,T as aD,$ as aE,mt as aF,l as aG,pe as aH,ge as aI,w as aa,j as ab,Lt as ac,vt as ad,Ot as ae,yt as af,B as ag,Rt as ah,At as ai,at as aj,Mt as ak,f as al,kt as am,Bt as an,St as ao,y as ap,H as aq,_ as ar,Zt as as,N as at,v as au,R as av,q as aw,G as ax,I as ay,F as az,Pt as b,xt as c,P as d,S as e,L as f,x as g,A as h,de as i,ot as j,ht as k,K as l,It as m,ct as n,ut as o,_t as p,rt as q,o as r,m as s,ue as t,W as u,et as v,Ht as w,C as x,u as y,a as z}
|
|
1
|
+
const t="generated",e="source-over",n="resize",s="visibilitychange",i=100,a=.5,r=1e3,o={x:0,y:0,z:0},c={a:1,b:0,c:0,d:1},u="random",h=2,f=2*Math.PI,l=60,d="true",p="false",g="canvas",w=0,m=2,y=100,v=1,M=1,b=1,E=255,x=360,P=100,S=100,A=0,L=0,k=60,q=0,z=1,O=0,D=1,C=1,T=120,$=0,F=1,j=1,H=0,N=0,_=1,B=0,I=0,R=1,J=1,U=0,W=1,G=0,V=1,X=0,K=3,Q=6,Y=1,Z=1,tt=0,et=1;var nt;function st(t){return"z"in t?t.z:o.z}!function(t){t.bottom="bottom",t.bottomLeft="bottom-left",t.bottomRight="bottom-right",t.left="left",t.none="none",t.right="right",t.top="top",t.topLeft="top-left",t.topRight="top-right",t.outside="outside",t.inside="inside"}(nt||(nt={}));class it{x;y;z;constructor(t=o.x,e=o.y,n=o.z){this.x=t,this.y=e,this.z=n}static get origin(){return it.create(o.x,o.y,o.z)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this.#t(t,this.length)}get length(){return Math.sqrt(this.getLengthSq())}set length(t){this.#t(this.angle,t)}static clone(t){return it.create(t.x,t.y,st(t))}static create(t,e,n){return"number"==typeof t?new it(t,e??o.y,n??o.z):new it(t.x,t.y,st(t))}add(t){return it.create(this.x+t.x,this.y+t.y,this.z+st(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=st(t)}copy(){return it.clone(this)}div(t){return it.create(this.x/t,this.y/t,this.z/t)}divTo(t){this.x/=t,this.y/=t,this.z/=t}getLengthSq(){return this.x**2+this.y**2}mult(t){return it.create(this.x*t,this.y*t,this.z*t)}multTo(t){this.x*=t,this.y*=t,this.z*=t}normalize(){const t=this.length;0!=t&&this.multTo(1/t)}rotate(t){return it.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),o.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=st(t)}sub(t){return it.create(this.x-t.x,this.y-t.y,this.z-st(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=st(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class at extends it{constructor(t=o.x,e=o.y){super(t,e,o.z)}static get origin(){return at.create(o.x,o.y)}static clone(t){return at.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new at(t,e??o.y):new at(t.x,t.y)}}function rt(t){return"boolean"==typeof t}function ot(t){return"string"==typeof t}function ct(t){return"number"==typeof t}function ut(t){return"object"==typeof t&&null!==t}function ht(t){return Array.isArray(t)}function ft(t){return null==t}const lt=Math.PI/180;let dt=Math.random;function pt(){return yt(dt(),0,1-Number.EPSILON)}function gt(t,e){return pt()*(e-t)+t}function wt(t){return requestAnimationFrame(t)}function mt(t){cancelAnimationFrame(t)}function yt(t,e,n){return Math.min(Math.max(t,e),n)}function vt(t){const e=Et(t);let n=bt(t);return e===n&&(n=0),gt(n,e)}function Mt(t){return ct(t)?t:vt(t)}function bt(t){return ct(t)?t:t.min}function Et(t){return ct(t)?t:t.max}function xt(t,e){if(t===e||void 0===e&&ct(t))return t;const n=bt(t),s=Et(t);return void 0!==e?{min:Math.min(n,e),max:Math.max(s,e)}:xt(n,s)}function Pt(t,e,n){return function(t,e){const n=t.x-e.x,s=t.y-e.y;return n*n+s*s}(t,e)<=n*n}function St(t){return t*lt}function At(t,e,n){if(ct(t))return St(t);switch(t){case nt.top:return.5*-Math.PI;case nt.topRight:return.25*-Math.PI;case nt.right:return 0;case nt.bottomRight:return.25*Math.PI;case nt.bottom:return.5*Math.PI;case nt.bottomLeft:return.75*Math.PI;case nt.left:return Math.PI;case nt.topLeft:return.75*-Math.PI;case nt.inside:return Math.atan2(n.y-e.y,n.x-e.x);case nt.outside:return Math.atan2(e.y-n.y,e.x-n.x);default:return pt()*f}}function Lt(t){const e=at.origin;return e.length=1,e.angle=t,e}function kt(t){const{position:e,size:n}=t;return{x:e?.x??pt()*n.width,y:e?.y??pt()*n.height}}var qt,zt,Ot,Dt,Ct,Tt;function $t(){return globalThis.document}function Ft(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function jt(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function Ht(t,e){return t===e||ht(e)&&e.includes(t)}function Nt(t,e,n=!0){return t[void 0!==e&&n?e%t.length:function(t){return Math.floor(pt()*t.length)}(t)]}function _t(t,...e){for(const n of e){if(ft(n))continue;if(!ut(n)){t=n;continue}Array.isArray(n)?Array.isArray(t)||(t=[]):ut(t)&&!Array.isArray(t)||(t={});const e=Object.keys(n),s=new Set(["__proto__","constructor","prototype"]);if(e.some((t=>{const e=n[t];return ut(e)||Array.isArray(e)})))for(const i of e){if(s.has(i))continue;const e=t,a=n[i];e[i]=Array.isArray(a)?a.map((t=>_t(void 0,t))):_t(e[i],a)}else{const i=n,a=t;for(const t of e)if(!s.has(t)&&t in i){const e=i[t];void 0!==e&&(a[t]=e)}}}return t}function Bt(t,e){return ht(t)?t.map(((t,n)=>e(t,n))):e(t,0)}function It(t,e,n){return ht(t)?Nt(t,e,n):t}function Rt(t,e){return function(t,e){if(t.mode!==Ct.percent){const{mode:e,...n}=t;return n}return"x"in t?{x:t.x/i*e.width,y:t.y/i*e.height}:{width:t.width/i*e.width,height:t.height/i*e.height}}(t,e)}function Jt(t){const e=$t().createElement("div").style;for(const n in t){const s=t[n];if(!(n in t)||ft(s))continue;const i=t.getPropertyValue?.(s);if(!i)continue;const a=t.getPropertyPriority?.(s);a?e.setProperty(s,i,a):e.setProperty(s,i)}return e}!function(t){t.auto="auto",t.increase="increase",t.decrease="decrease",t.random="random"}(qt||(qt={})),function(t){t.increasing="increasing",t.decreasing="decreasing"}(zt||(zt={})),function(t){t.none="none",t.max="max",t.min="min"}(Ot||(Ot={})),function(t){t.bottom="bottom",t.left="left",t.right="right",t.top="top"}(Dt||(Dt={})),function(t){t.precise="precise",t.percent="percent"}(Ct||(Ct={})),function(t){t.max="max",t.min="min",t.random="random"}(Tt||(Tt={}));const Ut=function(){const t=new Map,e=undefined,n=(t,e=new WeakSet)=>{if(null===t)return"null";const s=typeof t;if("undefined"===s)return"undefined";if("number"===s||"boolean"===s||"string"===s)return JSON.stringify(t);if("function"===s)try{return t.toString()}catch{return'"[Function]"'}if("symbol"===s)try{return t.toString()}catch{return'"[Symbol]"'}return Array.isArray(t)?`[${t.map((t=>n(t,e))).join(",")}]`:e.has(t)?'"[Circular]"':(e.add(t),`{${Object.keys(t).sort().map((s=>`${JSON.stringify(s)}:${n(t[s],e)}`)).join(",")}}`)};return(...s)=>{const i=(t=>e?e(t):(t=>n(t))(t))(s),a=Date.now(),r=t.get(i);if(void 0!==r)return t.delete(i),t.set(i,{value:r.value,ts:r.ts}),r.value;const o=function(t){const e=$t().createElement("div").style,n={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(10),"z-index":t.toString(10),top:"0",left:"0","pointer-events":"none"};for(const t in n){const s=n[t];void 0!==s&&e.setProperty(t,s)}return e}(...s);return t.set(i,{value:o,ts:a}),o}}();function Wt(t,e,n,s,i){if(s){let s={passive:!0};rt(i)?s.capture=i:void 0!==i&&(s=i),t.addEventListener(e,n,s)}else t.removeEventListener(e,n,i)}async function Gt(t,e,n,s=!1){let i=e.get(t);if(!i||s){const s=await Promise.all([...n.entries()].map((([e,n])=>n(t).then((t=>[e,t])))));i=new Map(s),e.set(t,i)}return i}class Vt{#e;constructor(){this.#e=new Map}addEventListener(t,e){this.removeEventListener(t,e);let n=this.#e.get(t);n||(n=[],this.#e.set(t,n)),n.push(e)}dispatchEvent(t,e){const n=this.#e.get(t);n?.forEach((t=>{t(e)}))}hasEventListener(t){return!!this.#e.get(t)}removeAllEventListeners(t){t?this.#e.delete(t):this.#e=new Map}removeEventListener(t,e){const n=this.#e.get(t);if(!n)return;const s=n.length,i=n.indexOf(e);i<0||(1===s?this.#e.delete(t):n.splice(i,1))}}var Xt;!function(t){t.configAdded="configAdded",t.containerInit="containerInit",t.particlesSetup="particlesSetup",t.containerStarted="containerStarted",t.containerStopped="containerStopped",t.containerDestroyed="containerDestroyed",t.containerPaused="containerPaused",t.containerPlay="containerPlay",t.containerBuilt="containerBuilt",t.particleAdded="particleAdded",t.particleDestroyed="particleDestroyed",t.particleRemoved="particleRemoved"}(Xt||(Xt={}));class Kt{colorManagers=new Map;easingFunctions=new Map;effectDrawers=new Map;initializers={effects:new Map,shapes:new Map,updaters:new Map};palettes=new Map;plugins=[];presets=new Map;shapeDrawers=new Map;updaters=new Map;#n=new Set;#s=new Map;#i;#a=new Set;#r=!1;#o=!1;#c=new Set;constructor(t){this.#i=t}get configs(){const t={};for(const[e,n]of this.#s)t[e]=n;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(t){const e=t.key??t.name??"default";this.#s.set(e,t),this.#i.dispatchEvent(Xt.configAdded,{data:{name:e,config:t}})}addEasing(t,e){this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.initializers.effects.set(t,e)}addPalette(t,e){this.palettes.set(t,e)}addParticleUpdater(t,e){this.initializers.updaters.set(t,e)}addPlugin(t){this.getPlugin(t.id)||this.plugins.push(t)}addPreset(t,e,n=!1){!n&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){for(const n of t)this.initializers.shapes.set(n,e)}clearPlugins(t){this.effectDrawers.delete(t),this.shapeDrawers.delete(t),this.updaters.delete(t)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getEffectDrawers(t,e=!1){return Gt(t,this.effectDrawers,this.initializers.effects,e)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.plugins.find((e=>e.id===t))}getPreset(t){return this.presets.get(t)}async getShapeDrawers(t,e=!1){return Gt(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return async function(t,e,n,s=!1){let i=e.get(t);return i&&!s||(i=await Promise.all([...n.values()].map((e=>e(t)))),e.set(t,i)),i}(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this.#r&&!this.#o){this.#o=!0,this.#a=new Set,this.#n=new Set(this.#c);try{for(const t of this.#n)await this.#u(t,this.#a,this.#n)}finally{this.#c.clear(),this.#o=!1,this.#r=!0}}}loadParticlesOptions(t,e,...n){const s=this.updaters.get(t);s&&s.forEach((t=>t.loadOptions?.(e,...n)))}async register(...t){if(this.#r)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this.#o?await this.#u(e,this.#a,this.#n):this.#c.add(e)}async#u(t,e,n){e.has(t)||(e.add(t),n.add(t),await t(this.#i))}}const Qt=t=>(...e)=>{t(...e)},Yt={debug:Qt(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:Qt(console.info),log:Qt(console.log),trace:Qt(console.trace),verbose:Qt(console.log),warning:Qt(console.warn)};function Zt(){return Yt}const te="100%";var ee,ne,se,ie,ae,re,oe,ce;!function(t){t.circle="circle",t.rectangle="rectangle"}(ee||(ee={})),function(t){t.clockwise="clockwise",t.counterClockwise="counter-clockwise",t.random="random"}(ne||(ne={})),function(t){t.delete="delete",t.wait="wait"}(se||(se={})),function(t){t.bounce="bounce",t.none="none",t.out="out",t.destroy="destroy",t.split="split"}(ie||(ie={})),function(t){t.darken="darken",t.enlighten="enlighten"}(ae||(ae={})),function(t){t.linear="linear",t.radial="radial",t.random="random"}(re||(re={})),function(t){t.normal="normal",t.inside="inside",t.outside="outside"}(oe||(oe={})),function(t){t.easeInBack="ease-in-back",t.easeInBounce="ease-in-bounce",t.easeInCirc="ease-in-circ",t.easeInCubic="ease-in-cubic",t.easeInElastic="ease-in-elastic",t.easeInExpo="ease-in-expo",t.easeInGaussian="ease-in-gaussian",t.easeInLinear="ease-in-linear",t.easeInQuad="ease-in-quad",t.easeInQuart="ease-in-quart",t.easeInQuint="ease-in-quint",t.easeInSigmoid="ease-in-sigmoid",t.easeInSine="ease-in-sine",t.easeInSmoothstep="ease-in-smoothstep",t.easeOutBack="ease-out-back",t.easeOutBounce="ease-out-bounce",t.easeOutCirc="ease-out-circ",t.easeOutCubic="ease-out-cubic",t.easeOutElastic="ease-out-elastic",t.easeOutExpo="ease-out-expo",t.easeOutGaussian="ease-out-gaussian",t.easeOutLinear="ease-out-linear",t.easeOutQuad="ease-out-quad",t.easeOutQuart="ease-out-quart",t.easeOutQuint="ease-out-quint",t.easeOutSigmoid="ease-out-sigmoid",t.easeOutSine="ease-out-sine",t.easeOutSmoothstep="ease-out-smoothstep",t.easeInOutBack="ease-in-out-back",t.easeInOutBounce="ease-in-out-bounce",t.easeInOutCirc="ease-in-out-circ",t.easeInOutCubic="ease-in-out-cubic",t.easeInOutElastic="ease-in-out-elastic",t.easeInOutExpo="ease-in-out-expo",t.easeInOutGaussian="ease-in-out-gaussian",t.easeInOutLinear="ease-in-out-linear",t.easeInOutQuad="ease-in-out-quad",t.easeInOutQuart="ease-in-out-quart",t.easeInOutQuint="ease-in-out-quint",t.easeInOutSigmoid="ease-in-out-sigmoid",t.easeInOutSine="ease-in-out-sine",t.easeInOutSmoothstep="ease-in-out-smoothstep"}(ce||(ce={}));const ue=new class{pluginManager=new Kt(this);#h=[];#f=new Vt;#r=!1;get items(){return this.#h}get version(){return"4.1.2"}addEventListener(t,e){this.#f.addEventListener(t,e)}checkVersion(t){if(this.version!==t)throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${this.version}. Plugin version: ${t}`)}dispatchEvent(t,e){this.#f.dispatchEvent(t,e)}async init(){this.#r||(await this.pluginManager.init(),this.#r=!0)}item(t){const e=this.items,n=e[t];if(!n?.destroyed)return n;e.splice(t,1)}async load(e){let n;await this.init(),"undefined"!=typeof HTMLElement&&e.element instanceof HTMLElement&&(n=e.element);const{Container:s}=await import("./p-h0XxhONB.js"),i=e.id??n?.id??`tsparticles${Math.floor(1e4*pt()).toString()}`,{index:a,url:r}=e,o=r?await async function(t){const e=It(t.url,t.index);if(!e)return t.fallback;const n=await fetch(e);return n.ok?await n.json():(Zt().error(`${n.status.toString()} while retrieving config file`),t.fallback)}({fallback:e.options,url:r,index:a}):e.options,c=It(o,a),{items:u}=this,h=u.findIndex((t=>t.id.description===i)),f=new s({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:i,onDestroy:t=>{if(!t)return;const e=this.items,n=e.indexOf(f);n>=0&&e.splice(n,1)},pluginManager:this.pluginManager,sourceOptions:c});if(h>=0){const t=this.item(h),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),u.splice(h,e,f)}else u.push(f);const l="undefined"!=typeof OffscreenCanvas&&e.element instanceof OffscreenCanvas?e.element:(e=>{const n=$t();let s;if(e instanceof HTMLCanvasElement||e.tagName.toLowerCase()===g)s=e,s.dataset[t]??=p,s.dataset[t]===d&&(s.style.width||=te,s.style.height||=te,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none"));else{const i=e.getElementsByTagName(g).item(0);i?(s=i,s.dataset[t]=p):(s=n.createElement(g),s.dataset[t]=d,e.appendChild(s)),s.style.width||=te,s.style.height||=te,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(((e,n)=>{const s=$t();let i=n??s.getElementById(e);return i||(i=s.createElement("canvas"),i.id=e,i.dataset[t]=d,s.body.append(i),i)})(i,n));return f.canvas.loadCanvas(l),await f.start(),f}async refresh(t=!0){t&&await Promise.all(this.items.map((t=>t.refresh())))}removeEventListener(t,e){this.#f.removeEventListener(t,e)}};let he,fe,le=!1;async function de(t){if(!le)if(he){if(fe!==t)throw new Error("initParticlesEngine callback must be stable across the app lifecycle.");await he}else fe=t,he=(async()=>{t&&await t(ue),"function"==typeof ue.init&&await ue.init(),le=!0})().catch((t=>{throw he=void 0,fe=void 0,le=!1,t})),await he}function pe(){return le}async function ge(){await(null!=he?he:Promise.resolve())}export{r as $,ae as A,V as B,h as C,k as D,E,gt as F,W as G,tt as H,Q as I,K as J,Z as K,se as L,nt as M,Y as N,ie as O,Ct as P,O as Q,ee as R,e as S,z as T,D as U,jt as V,t as W,Jt as X,Ft as Y,Ut as Z,$t as _,ft as a,Wt as a0,s as a1,n as a2,it as a3,Xt as a4,U as a5,c as a6,oe as a7,It as a8,pt as a9,M as aA,b as aB,wt as aC,T as aD,$ as aE,mt as aF,l as aG,pe as aH,ge as aI,w as aa,j as ab,Lt as ac,vt as ad,Dt as ae,yt as af,H as ag,Rt as ah,At as ai,at as aj,Mt as ak,f as al,kt as am,Ht as an,St as ao,y as ap,N as aq,B as ar,Zt as as,I as at,v as au,R as av,q as aw,J as ax,_ as ay,F as az,xt as b,Pt as c,x as d,S as e,L as f,P as g,A as h,de as i,ot as j,ht as k,X as l,_t as m,ct as n,ut as o,Bt as p,rt as q,o as r,m as s,ue as t,G as u,et as v,Nt as w,C as x,u as y,a as z}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as t,c as s,s as i,a as h,b as o,h as e,d as n,l as r,e as a,f as c,g as l,j as d,k as u,m as f,P as p,O as v,M as w,n as g,o as y,L as m,p as M,q as b,r as P,u as x,v as C,w as z,x as k,y as S,z as R,A as D,B as $,C as O,D as T,E as I,F,G as B,H as L,I as E,J as U,K as q,N as A,Q as V,S as j,T as H,U as W,V as X,W as Y,X as N,Y as _,Z,_ as G,$ as K,a0 as Q,a1 as J,a2 as tt,a3 as st,a4 as it,a5 as ht,a6 as ot,a7 as et,a8 as nt,a9 as rt,aa as at,ab as ct,ac as lt,ad as dt,ae as ut,af as ft,ag as pt,ah as vt,ai as wt,aj as gt,ak as yt,al as mt,am as Mt,an as bt,ao as Pt,ap as xt,aq as Ct,ar as zt,as as kt,at as St,au as Rt,av as Dt,aw as $t,ax as Ot,ay as Tt,az as It,aA as Ft,aB as Bt,aC as Lt,aD as Et,aE as Ut,aF as qt,aG as At}from"./p-C8gVqIeD.js";class Vt{position;type;constructor(t,s,i){this.position={x:t,y:s},this.type=i}_resetPosition(t,s){this.position.x=t,this.position.y=s}}class jt extends Vt{radius;constructor(s,i,h){super(s,i,t.circle),this.radius=h}contains(t){return s(t,this.position,this.radius)}intersects(s){const h=this.position,o=s.position,e=this.radius,n=Math.abs(o.x-h.x),r=Math.abs(o.y-h.y);if(s instanceof jt||s.type===t.circle)return e+s.radius>Math.hypot(n,r);if(s instanceof Ht||s.type===t.rectangle){const t=s,{width:h,height:o}=t.size;return Math.pow(n-h,i)+Math.pow(r-o,i)<=e**i||n<=e+h&&r<=e+o||n<=h||r<=o}return!1}reset(t,s,i){return this._resetPosition(t,s),this.radius=i,this}}class Ht extends Vt{size;constructor(s,i,h,o){super(s,i,t.rectangle),this.size={height:o,width:h}}contains(t){const s=this.position;return t.x>=s.x&&t.x<=s.x+this.size.width&&t.y>=s.y&&t.y<=s.y+this.size.height}intersects(t){if(t instanceof jt)return t.intersects(this);if(!(t instanceof Ht))return!1;const s=this.position,i=t.position,h=t.size;return i.x<s.x+this.size.width&&i.x+h.width>s.x&&i.y<s.y+this.size.height&&i.y+h.height>s.y}reset(t,s,i,h){return this._resetPosition(t,s),this.size.width=i,this.size.height=h,this}}class Wt{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(t){h(t)||(void 0!==t.count&&(this.count=o(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=o(t.speed)),void 0!==t.decay&&(this.decay=o(t.decay)),void 0!==t.delay&&(this.delay=o(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class Xt extends Wt{max;min;offset;constructor(t,s){super(),this.min=t,this.max=s,this.offset=0,this.sync=!0}load(t){super.load(t),h(t)||(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.offset&&(this.offset=o(t.offset)))}}class Yt{h=new Xt(e,n);l=new Xt(r,a);s=new Xt(c,l);load(t){h(t)||(this.h.load(t.h),this.s.load(t.s),this.l.load(t.l))}}class Nt{value;constructor(){this.value=""}static create(t,s){const i=new Nt;return i.load(t),void 0!==s&&(d(s)||u(s)?i.load({value:s}):i.load(s)),i}load(t){h(t)||h(t.value)||(this.value=t.value)}}class _t extends Nt{animation;constructor(){super(),this.animation=new Yt}static create(t,s){const i=new _t;return i.load(t),void 0!==s&&(d(s)||u(s)?i.load({value:s}):i.load(s)),i}load(t){if(super.load(t),h(t))return;const s=t.animation;void 0!==s&&(void 0===s.enable?this.animation.load(t.animation):this.animation.h.load(s))}}class Zt{color;image;opacity;position;repeat;size;constructor(){this.color=new Nt,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(t){h(t)||(void 0!==t.color&&(this.color=Nt.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image),void 0!==t.position&&(this.position=t.position),void 0!==t.repeat&&(this.repeat=t.repeat),void 0!==t.size&&(this.size=t.size),void 0!==t.opacity&&(this.opacity=t.opacity))}}class Gt{enable;zIndex;constructor(){this.enable=!0,this.zIndex=0}load(t){h(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.zIndex&&(this.zIndex=t.zIndex))}}class Kt{delay;enable;constructor(){this.delay=.5,this.enable=!0}load(t){h(t)||(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.enable&&(this.enable=t.enable))}}class Qt{close;options;type;constructor(){this.close=!0,this.options={},this.type=[]}load(t){if(h(t))return;const s=t.options;if(void 0!==s)for(const t in s){const i=s[t];i&&(this.options[t]=f(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class Jt{color;enable;opacity;constructor(){this.enable=!0,this.opacity=1}load(t){h(t)||(void 0!==t.color&&(this.color=_t.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.opacity&&(this.opacity=o(t.opacity)))}}class ts{offset;value;constructor(){this.offset=0,this.value=90}load(t){h(t)||(void 0!==t.offset&&(this.offset=o(t.offset)),void 0!==t.value&&(this.value=o(t.value)))}}class ss{mode;radius;x;y;constructor(){this.x=50,this.y=50,this.mode=p.percent,this.radius=0}load(t){h(t)||(void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.radius&&(this.radius=t.radius))}}class is{acceleration;enable;inverse;maxSpeed;constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(t){h(t)||(void 0!==t.acceleration&&(this.acceleration=o(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.inverse&&(this.inverse=t.inverse),void 0!==t.maxSpeed&&(this.maxSpeed=o(t.maxSpeed)))}}class hs{value;constructor(){this.value=0}load(t){h(t)||h(t.value)||(this.value=o(t.value))}}class os{clamp;delay;enable;generator;options;constructor(){this.clamp=!0,this.delay=new hs,this.enable=!1,this.options={}}load(t){h(t)||(void 0!==t.clamp&&(this.clamp=t.clamp),this.delay.load(t.delay),void 0!==t.enable&&(this.enable=t.enable),this.generator=t.generator,t.options&&(this.options=f(this.options,t.options)))}}class es{bottom;default;left;right;top;constructor(){this.default=v.out}load(t){h(t)||(void 0!==t.default&&(this.default=t.default),this.bottom=t.bottom??t.default,this.left=t.left??t.default,this.right=t.right??t.default,this.top=t.top??t.default)}}class ns{acceleration;enable;position;constructor(){this.acceleration=0,this.enable=!1}load(t){h(t)||(void 0!==t.acceleration&&(this.acceleration=o(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),t.position&&(this.position=f({},t.position)))}}class rs{angle;center;decay;direction;distance;drift;enable;gravity;outModes;path;random;size;speed;spin;straight;vibrate;warp;constructor(){this.angle=new ts,this.center=new ss,this.decay=0,this.distance={},this.direction=w.none,this.drift=0,this.enable=!1,this.gravity=new is,this.path=new os,this.outModes=new es,this.random=!1,this.size=!1,this.speed=2,this.spin=new ns,this.straight=!1,this.vibrate=!1,this.warp=!1}load(t){if(h(t))return;this.angle.load(g(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),void 0!==t.decay&&(this.decay=o(t.decay)),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.distance&&(this.distance=g(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),void 0!==t.drift&&(this.drift=o(t.drift)),void 0!==t.enable&&(this.enable=t.enable),this.gravity.load(t.gravity);const s=t.outModes;void 0!==s&&(y(s)?this.outModes.load(s):this.outModes.load({default:s})),this.path.load(t.path),void 0!==t.random&&(this.random=t.random),void 0!==t.size&&(this.size=t.size),void 0!==t.speed&&(this.speed=o(t.speed)),this.spin.load(t.spin),void 0!==t.straight&&(this.straight=t.straight),void 0!==t.vibrate&&(this.vibrate=t.vibrate),void 0!==t.warp&&(this.warp=t.warp)}}class as{color;opacity;width;constructor(){this.width=0}load(t){h(t)||(void 0!==t.color&&(this.color=_t.create(this.color,t.color)),void 0!==t.width&&(this.width=o(t.width)),void 0!==t.opacity&&(this.opacity=o(t.opacity)))}}class cs{color;fill;stroke;load(t){h(t)||(void 0!==t.color&&(this.color=_t.create(this.color,t.color)),void 0!==t.fill&&(this.fill??=new Jt,this.fill.load(t.fill)),void 0!==t.stroke&&(this.stroke??=new as,this.stroke.load(t.stroke)))}}class ls extends hs{constructor(){super(),this.value=1}}class ds{horizontal;vertical;constructor(){this.horizontal=new ls,this.vertical=new ls}load(t){h(t)||(this.horizontal.load(t.horizontal),this.vertical.load(t.vertical))}}class us{enable;height;width;constructor(){this.enable=!1,this.width=1920,this.height=1080}load(t){if(h(t))return;void 0!==t.enable&&(this.enable=t.enable);const s=t.width;void 0!==s&&(this.width=s);const i=t.height;void 0!==i&&(this.height=i)}}class fs{mode;value;constructor(){this.mode=m.delete,this.value=0}load(t){h(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class ps{density;limit;value;constructor(){this.density=new us,this.limit=new fs,this.value=0}load(t){h(t)||(this.density.load(t.density),this.limit.load(t.limit),void 0!==t.value&&(this.value=t.value))}}class vs{close;options;type;constructor(){this.close=!0,this.options={},this.type="circle"}load(t){if(h(t))return;const s=t.options;if(void 0!==s)for(const t in s){const i=s[t];i&&(this.options[t]=f(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class ws extends hs{opacityRate;sizeRate;velocityRate;constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(t){super.load(t),h(t)||(void 0!==t.opacityRate&&(this.opacityRate=t.opacityRate),void 0!==t.sizeRate&&(this.sizeRate=t.sizeRate),void 0!==t.velocityRate&&(this.velocityRate=t.velocityRate))}}class gs{bounce;effect;groups;move;number;paint;palette;reduceDuplicates;shape;zIndex;#t;#s;constructor(t,s){this.#s=t,this.#t=s,this.bounce=new ds,this.effect=new Qt,this.groups={},this.move=new rs,this.number=new ps,this.paint=new cs,this.paint.color=new _t,this.paint.color.value="#fff",this.paint.fill=new Jt,this.paint.fill.enable=!0,this.reduceDuplicates=!1,this.shape=new vs,this.zIndex=new ws}load(t){if(h(t))return;if(t.palette&&(this.palette=t.palette,this.#i(this.palette)),void 0!==t.groups)for(const s of Object.keys(t.groups)){if(!(s in t.groups))continue;const i=t.groups[s];void 0!==i&&(this.groups[s]=f(this.groups[s]??{},i))}void 0!==t.reduceDuplicates&&(this.reduceDuplicates=t.reduceDuplicates),this.bounce.load(t.bounce),this.effect.load(t.effect),this.move.load(t.move),this.number.load(t.number);const s=t.paint;if(s&&(u(s)?this.paint=M(s,(t=>{const s=new cs;return s.load(t),s})):u(this.paint)?(this.paint=new cs,this.paint.load(s)):this.paint.load(s)),this.shape.load(t.shape),this.zIndex.load(t.zIndex),this.#t){for(const s of this.#s.plugins)s.loadParticlesOptions&&s.loadParticlesOptions(this.#t,this,t);const s=this.#s.updaters.get(this.#t);if(s)for(const i of s)i.loadOptions&&i.loadOptions(this,t)}}#i=t=>{const s=this.#s.getPalette(t);if(!s)return;const i=s.colors,h=(u(i)?i:[i]).flatMap((t=>{const s=t.fill,i=t.stroke,h=s?{color:{value:s.value},enable:s.enable,opacity:s.opacity}:void 0;return i?[{fill:h,stroke:{color:{value:i.value},opacity:i.opacity,width:i.width||0}}]:[{fill:h}]}));this.load({paint:h.length>1?h:h[0]??{},blend:{enable:!0,mode:s.blendMode}})}}function ys(t,...s){for(const i of s)t.load(i)}function ms(t,s,...i){const h=new gs(t,s);return ys(h,...i),h}class Ms{autoPlay;background;clear;defaultThemes;delay;detectRetina;duration;fpsLimit;fullScreen;hdr;key;name;palette;particles;pauseOnBlur;pauseOnOutsideViewport;preset;resize;smooth;style;zLayers;#t;#s;constructor(t,s){this.#s=t,this.#t=s,this.autoPlay=!0,this.background=new Zt,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new Gt,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.hdr=!0,this.particles=ms(this.#s,this.#t),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.resize=new Kt,this.smooth=!1,this.style={},this.zLayers=100}load(t){if(h(t))return;void 0!==t.preset&&(this.preset=t.preset,M(this.preset,(t=>{this.#h(t)}))),void 0!==t.palette&&(this.palette=t.palette,this.#i(this.palette)),void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.clear&&(this.clear=t.clear),void 0!==t.key&&(this.key=t.key),void 0!==t.name&&(this.name=t.name),void 0!==t.delay&&(this.delay=o(t.delay));const s=t.detectRetina;void 0!==s&&(this.detectRetina=s),void 0!==t.duration&&(this.duration=o(t.duration));const i=t.fpsLimit;void 0!==i&&(this.fpsLimit=i),void 0!==t.hdr&&(this.hdr=t.hdr),void 0!==t.pauseOnBlur&&(this.pauseOnBlur=t.pauseOnBlur),void 0!==t.pauseOnOutsideViewport&&(this.pauseOnOutsideViewport=t.pauseOnOutsideViewport),void 0!==t.zLayers&&(this.zLayers=t.zLayers),this.background.load(t.background);const e=t.fullScreen;b(e)?this.fullScreen.enable=e:this.fullScreen.load(e),this.particles.load(t.particles),this.resize.load(t.resize),this.style=f(this.style,t.style),void 0!==t.smooth&&(this.smooth=t.smooth),this.#s.plugins.forEach((s=>{s.loadOptions(this.#t,this,t)}))}#i=t=>{const s=this.#s.getPalette(t);s&&this.load({background:{color:s.background},blend:{enable:!0,mode:s.blendMode},particles:{palette:t}})};#h=t=>{this.load(this.#s.getPreset(t))}}function bs(t,s){t.clearRect(P.x,P.y,s.width,s.height)}function Ps(t,s,i,h){s.drawParticle&&s.drawParticle(t,i,h)}const xs=new Map;function Cs(t,s){let i=xs.get(t);return i||(i=s(),xs.size>=1e3&&[...xs.keys()].slice(0,1e3*R).forEach((t=>xs.delete(t))),xs.set(t,i)),i}function zs(t,s,i,h=!0){if(!s)return;const o=d(s)?{value:s}:s;if(d(o.value))return ks(t,o.value,i,h);if(u(o.value)){const s=z(o.value,i,h);if(!s)return;return zs(t,{value:s})}for(const s of t.colorManagers.values()){const t=s.handleRangeColor(o);if(t)return t}}function ks(t,s,i,h=!0){if(!s)return;const o=d(s)?{value:s}:s;if(d(o.value))return o.value===S?function(){const t=L,s=I+B,i=()=>Math.floor(F(t,s));return{b:i(),g:i(),r:i()}}():function(t,s){return function(t,s){if(s)for(const i of t.colorManagers.values())if(i.accepts(s))return i.parseString(s)}(t,s)}(t,o.value);if(u(o.value)){const s=z(o.value,i,h);if(!s)return;return ks(t,{value:s})}for(const s of t.colorManagers.values()){const t=s.handleColor(o);if(t)return t}}function Ss(t,s,i,h=!0){const o=zs(t,s,i,h);return o?function(t){const s=t.r/I,i=t.g/I,h=t.b/I,o=Math.max(s,i,h),r=Math.min(s,i,h),d={h:e,l:(o+r)*R,s:c};return o!==r&&(d.s=d.l<R?(o-r)/(o+r):(o-r)/(O-o-r),d.h=s===o?(i-h)/(o-r):i===o?O+(h-s)/(o-r):O*O+(s-i)/(o-r)),d.l*=a,d.s*=l,d.h*=T,d.h<e&&(d.h+=n),d.h>=n&&(d.h-=n),d}(o):void 0}function Rs(t,s){return`color(display-p3 ${(t.r/I).toString()} ${(t.g/I).toString()} ${(t.b/I).toString()} / ${(s??k).toString()})`}function Ds(t,s,i){const h=i??k;return Cs(`hsl-${t.h.toFixed(2)}-${t.s.toFixed(2)}-${t.l.toFixed(2)}-${s?"hdr":"sdr"}-${h.toString()}`,(()=>s?function(t,s){return Rs(function(t){const s=(t.h%n+n)%n,i=Math.max(c,Math.min(l,t.s)),h=Math.max(r,Math.min(a,t.l)),o=s/n,e=i/l,d=h/a;if(i===c){const t=Math.round(d*I);return{r:t,g:t,b:t}}const u=(t,s,i)=>(i<0&&i++,i>1&&i--,i*E<1?t+(s-t)*E*i:i*O<1?s:i*U<1*O?t+(s-t)*(O/U-i)*E:t),f=d<R?d*(A+e):d+e-d*e,p=O*d-f,v=q/U,w=Math.min(I,I*u(p,f,o+v)),g=Math.min(I,I*u(p,f,o)),y=Math.min(I,I*u(p,f,o-v));return{r:Math.round(w),g:Math.round(g),b:Math.round(y)}}(t),s)}(t,i):function(t,s){return`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${(s??k).toString()})`}(t,i)))}function $s(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function Os(t,s,i){const h=s[i];void 0!==h&&(t[i]=(t[i]??H)*h)}class Ts{#o;#e;#n;#r;#a;#t;#c;#l;#d;#u;#f;#p;#v;#w;#s;#g;#y;#m={};#M=[void 0,void 0];#b={};constructor(t,s,i){this.#s=t,this.#t=s,this.#e=i,this.#c=null,this.#y=[],this.#g=[],this.#a=[],this.#o=[],this.#n=[],this.#r=[],this.#d=[],this.#u=[],this.#f=[],this.#p=[],this.#w=[],this.#v=[]}get settings(){return this.#l}canvasClear(){this.#t.actualOptions.clear&&this.draw((t=>{bs(t,this.#e.size)}))}clear(){let t=!1;for(const s of this.#o)if(t=s.canvasClear?.()??!1,t)break;t||this.canvasClear()}destroy(){this.stop(),this.#y=[],this.#g=[],this.#a=[],this.#o=[],this.#n=[],this.#r=[],this.#d=[],this.#u=[],this.#f=[],this.#p=[],this.#w=[],this.#v=[]}draw(t){const s=this.#c;if(s)return t(s)}drawParticle(t,s){if(t.spawning||t.destroyed)return;const i=t.getRadius();if(i<=V)return;const h=t.getFillColor(),o=t.getStrokeColor();let[e,n]=this.#P(t);if(e??=h,n??=o,!e&&!n)return;const r=this.#t,a=t.options.zIndex,c=W-t.zIndexFactor,{fillOpacity:l,opacity:d,strokeOpacity:u}=t.getOpacity(),f=this.#b,p=this.#m,v=e?Ds(e,r.hdr,l*d):void 0,w=n?Ds(n,r.hdr,u*d):v;f.a=f.b=f.c=f.d=void 0,p.fill=v,p.stroke=w,this.draw((h=>{for(const i of this.#f)i.drawParticleSetup?.(h,t,s);this.#x(h,t,i,d,p,f),function(t){const{container:s,context:i,particle:h,delta:o,colorStyles:e,radius:n,opacity:r,transform:a}=t,{effectDrawers:c,shapeDrawers:l}=s,d=h.getPosition(),u=h.getTransformData(a),f=C,p={x:d.x,y:d.y};i.setTransform(u.a,u.b,u.c,u.d,d.x,d.y),e.fill&&(i.fillStyle=e.fill);const v=!!h.fillEnabled,w=h.strokeWidth??x;i.lineWidth=w,e.stroke&&(i.strokeStyle=e.stroke);const g={context:i,particle:h,radius:n,drawRadius:n*f,opacity:r,delta:o,pixelRatio:s.retina.pixelRatio,fill:v,stroke:w>x,transformData:u,position:{...d},drawPosition:p,drawScale:f};for(const t of s.plugins)t.drawParticleTransform?.(g);const y=h.effect?c.get(h.effect):void 0,m=h.shape?l.get(h.shape):void 0;!function(t,s){if(!t?.drawBefore)return;const{particle:i}=s;i.effect&&t.drawBefore(s)}(y,g),function(t,s){if(!t?.beforeDraw)return;const{particle:i}=s;i.shape&&t.beforeDraw(s)}(m,g),function(t,s){if(!t)return;const{context:i,fill:h,particle:o,stroke:e}=s;o.shape&&(i.beginPath(),t.draw(s),o.shapeClose&&i.closePath(),h&&i.fill(),e&&i.stroke())}(m,g),function(t,s){if(!t?.afterDraw)return;const{particle:i}=s;i.shape&&t.afterDraw(s)}(m,g),function(t,s){if(!t?.drawAfter)return;const{particle:i}=s;i.effect&&t.drawAfter(s)}(y,g),i.resetTransform()}({container:r,context:h,particle:t,delta:s,colorStyles:p,radius:i*c**a.sizeRate,opacity:d,transform:f}),this.#C(t);for(const i of this.#u)i.drawParticleCleanup?.(h,t,s)}))}drawParticlePlugins(t,s){this.draw((i=>{for(const h of this.#d)Ps(i,h,t,s)}))}drawParticles(t){const{particles:s}=this.#t;this.clear(),s.update(t),this.draw((i=>{for(const s of this.#w)s.drawSettingsSetup?.(i,t);for(const s of this.#p)s.draw?.(i,t);s.drawParticles(t);for(const s of this.#r)s.clearDraw?.(i,t);for(const s of this.#v)s.drawSettingsCleanup?.(i,t)}))}init(){this.initUpdaters(),this.initPlugins(),this.paint()}initPlugins(){this.#a=[],this.#o=[],this.#n=[],this.#r=[],this.#d=[],this.#f=[],this.#u=[],this.#p=[],this.#w=[],this.#v=[];for(const t of this.#t.plugins)(t.particleFillColor??t.particleStrokeColor)&&this.#a.push(t),t.canvasClear&&this.#o.push(t),t.canvasPaint&&this.#n.push(t),t.drawParticle&&this.#d.push(t),t.drawParticleSetup&&this.#f.push(t),t.drawParticleCleanup&&this.#u.push(t),t.draw&&this.#p.push(t),t.drawSettingsSetup&&this.#w.push(t),t.drawSettingsCleanup&&this.#v.push(t),t.clearDraw&&this.#r.push(t)}initUpdaters(){this.#y=[],this.#g=[];for(const t of this.#t.particleUpdaters)t.afterDraw&&this.#g.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#y.push(t)}paint(){let t=!1;for(const s of this.#n)if(t=s.canvasPaint?.()??!1,t)break;t||this.paintBase()}paintBase(t){this.draw((s=>{!function(t,s,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(P.x,P.y,s.width,s.height)}(s,this.#e.size,t)}))}paintImage(t,s){this.draw((i=>{!function(t,s,i,h){if(!i)return;const o=t.globalAlpha;t.globalAlpha=h,t.drawImage(i,P.x,P.y,s.width,s.height),t.globalAlpha=o}(i,this.#e.size,t,s)}))}setContext(t){this.#c=t,this.#c&&(this.#c.globalCompositeOperation=j)}setContextSettings(t){this.#l=t}stop(){this.draw((t=>{bs(t,this.#e.size)}))}#C=t=>{for(const s of this.#g)s.afterDraw?.(t)};#x=(t,s,i,h,o,e)=>{for(const n of this.#y){if(n.getColorStyles){const{fill:e,stroke:r}=n.getColorStyles(s,t,i,h);e&&(o.fill=e),r&&(o.stroke=r)}if(n.getTransformValues){const t=n.getTransformValues(s);for(const s in t)Os(e,t,s)}n.beforeDraw?.(s)}};#P=t=>{let s,i;for(const h of this.#a)if(!s&&h.particleFillColor&&(s=Ss(this.#s,h.particleFillColor(t))),!i&&h.particleStrokeColor&&(i=Ss(this.#s,h.particleStrokeColor(t))),s&&i)break;return this.#M[0]=s,this.#M[1]=i,this.#M}}const Is=new WeakMap;function Fs(t,s,i=!1){if(!s)return;const h=t.style,o=new Set;for(let t=0;t<h.length;t++){const s=h.item(t);s&&o.add(s)}for(let t=0;t<s.length;t++){const i=s.item(t);i&&o.add(i)}for(const t of o){const o=s.getPropertyValue(t);o?h.setProperty(t,o,i?"important":""):h.removeProperty(t)}}class Bs{domElement;render;renderCanvas;size;zoom=C;#t;#z;#k;#S;#s;#R;#D;#$;#O;constructor(t,s){this.#s=t,this.#t=s,this.render=new Ts(t,s,this),this.#$={height:0,width:0};const i=s.retina.pixelRatio,h=this.#$;this.size={height:h.height*i,width:h.width*i},this.#z=!1,this.#D=[],this.#R="none"}get#T(){return this.#t.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this.#z){const t=this.domElement;t?.remove(),this.domElement=void 0,this.renderCanvas=void 0}else this.#I();this.render.destroy(),this.#D=[]}getZoomCenter(){const t=this.#t.retina.pixelRatio,{width:s,height:i}=this.size;return this.#O?this.#O:{x:s*R/t,y:i*R/t}}init(){this.#F((t=>{t.disconnect()})),this.#k=X((t=>{for(const s of t)"attributes"===s.type&&"style"===s.attributeName&&this.#B()})),this.resize(),this.#L(),this.initBackground(),this.#F((t=>{const s=this.domElement;s&&s instanceof Node&&t.observe(s,{attributes:!0})})),this.initPlugins(),this.render.init()}initBackground(){const t=this.#t,s=t.actualOptions.background,i=this.domElement;if(!i)return;const h=i.style,o=zs(this.#s,s.color);h.backgroundColor=o?function(t,s,i){const h=i??k;return Cs(`rgb-${t.r.toFixed(2)}-${t.g.toFixed(2)}-${t.b.toFixed(2)}-${s?"hdr":"sdr"}-${h.toString()}`,(()=>s?Rs(t,i):function(t,s){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(s??k).toString()})`}(t,i)))}(o,t.hdr,s.opacity):"",h.backgroundImage=s.image||"",h.backgroundPosition=s.position||"",h.backgroundRepeat=s.repeat||"",h.backgroundSize=s.size||""}initPlugins(){this.#D=[];for(const t of this.#t.plugins)t.resize&&this.#D.push(t)}loadCanvas(t){this.#z&&this.domElement&&this.domElement.remove();const s=this.#t,i=(t=>"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)(t)?t:void 0;this.domElement=i,this.#z=!!i&&"true"===i.dataset[Y],this.renderCanvas=i?(t=>{const s=Is.get(t);if(s)return s;if("function"!=typeof t.transferControlToOffscreen)throw new TypeError("OffscreenCanvas is required but not supported by this browser");try{const s=t.transferControlToOffscreen();return Is.set(t,s),s}catch{throw new TypeError("OffscreenCanvas transfer failed")}})(i):t;const h=this.domElement;h&&(h.ariaHidden="true",this.#S=N(h.style));const o=this.#$,e=this.renderCanvas;h?(o.height=h.offsetHeight,o.width=h.offsetWidth):(o.height=e.height,o.width=e.width);const n=this.#t.retina.pixelRatio,r=this.size;e.height=r.height=o.height*n,e.width=r.width=o.width*n;const a=_("(color-gamut: p3)");this.render.setContextSettings({alpha:!0,colorSpace:a?.matches&&s.hdr?"display-p3":"srgb",desynchronized:!0,willReadFrequently:!1}),this.render.setContext(e.getContext("2d",this.render.settings)),this.#F((t=>{t.disconnect()})),s.retina.init(),this.initBackground(),this.#F((t=>{const s=this.domElement;s&&s instanceof Node&&t.observe(s,{attributes:!0})}))}resize(){const t=this.domElement;if(!t)return!1;const s=this.#t,i=this.renderCanvas;if(void 0===i)return!1;const h=s.canvas.#$,o={width:t.offsetWidth,height:t.offsetHeight},e=s.retina.pixelRatio,n={width:o.width*e,height:o.height*e};if(o.height===h.height&&o.width===h.width&&n.height===i.height&&n.width===i.width)return!1;const r={...h};h.height=o.height,h.width=o.width;const a=this.size;return i.width=a.width=n.width,i.height=a.height=n.height,this.#t.started&&s.particles.setResizeFactor({width:h.width/r.width,height:h.height/r.height}),!0}setPointerEvents(t){this.domElement&&(this.#R=t,this.#B())}setZoom(t,s){this.zoom=t,this.#O=s}stop(){this.#F((t=>{t.disconnect()})),this.#k=void 0,this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#t,s=t.updateActualOptions();t.particles.setDensity(),this.#E(),s&&await t.refresh()}#E=()=>{for(const t of this.#D)t.resize?.()};#L=()=>{const t=this.domElement,s=this.#t.actualOptions;if(t){this.#T?this.#U():this.#I();for(const i in s.style){if(!i||!(i in s.style))continue;const h=s.style[i];h&&t.style.setProperty(i,h,"important")}}};#B=()=>{const t=this.domElement;if(!t)return;this.#F((t=>{t.disconnect()})),this.#L(),this.initBackground();const s=this.#R;t.style.pointerEvents=s,t.style.setProperty("pointer-events",s),this.#F((s=>{t instanceof Node&&s.observe(t,{attributes:!0})}))};#I=()=>{const t=this.domElement,s=this.#S;t&&s&&Fs(t,s,!0)};#F=t=>{this.#k&&t(this.#k)};#U=()=>{const t=this.domElement;t&&Fs(t,Z(this.#t.actualOptions.fullScreen.zIndex),!0)}}class Ls{#t;#q;#A;#V;constructor(t){this.#t=t,this.#q={visibilityChange:()=>{this.#j()},resize:()=>{this.#H()}}}addListeners(){this.#W(!0)}removeListeners(){this.#W(!1)}#j=()=>{const t=this.#t;t.actualOptions.pauseOnBlur&&(G().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))};#H=()=>{this.#V&&(clearTimeout(this.#V),this.#V=void 0);const t=async()=>{const t=this.#t.canvas;await t.windowResize()};this.#V=setTimeout((()=>{t()}),this.#t.actualOptions.resize.delay*K)};#W=t=>{const s=this.#q;this.#X(t),Q(document,J,s.visibilityChange,t,!1)};#X=t=>{const s=this.#q,i=this.#t;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void Q(globalThis,tt,s.resize,t);const h=i.canvas.domElement;this.#A&&!t?(h&&this.#A.unobserve(h),this.#A.disconnect(),this.#A=void 0):!this.#A&&t&&h&&(this.#A=new ResizeObserver((t=>{t.find((t=>t.target===h))&&this.#H()})),this.#A.observe(h))}}function Es(t){if(!bt(t.outMode,t.checkModes))return;const s=t.radius*O;t.coord>t.maxCoord-s?t.setCb(-t.radius):t.coord<s&&t.setCb(t.radius)}class Us{backColor;bubble;destroyed;direction;effect;effectClose;effectData;fillColor;fillEnabled;fillOpacity;group;id;ignoresResizeRatio;initialPosition;initialVelocity;isRotating;justWarped;lastPathTime;misplaced;moveCenter;offset;opacity;options;outType;pathRotation;position;randomIndexData;retina;roll;rotation;shape;shapeClose;shapeData;sides;size;slow;spawning;strokeColor;strokeOpacity;strokeWidth;unbreakable;velocity;zIndexFactor;#Y={fillOpacity:k,opacity:k,strokeOpacity:k};#N=st.origin;#_={sin:0,cos:0};#Z={a:1,b:0,c:0,d:1};#t;#s;constructor(t,s){this.#s=t,this.#t=s}destroy(t){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const s=this.#t,i=this.shape?s.shapeDrawers.get(this.shape):void 0;i?.particleDestroy?.(this);for(const i of s.particleDestroyedPlugins)i.particleDestroyed?.(this,t);for(const i of s.particleUpdaters)i.particleDestroyed?.(this,t);this.#t.dispatchEvent(it.particleDestroyed,{particle:this})}draw(t){const s=this.#t.canvas.render;s.drawParticlePlugins(this,t),s.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:ht)}getFillColor(){return this.#G(this.bubble.color??$s(this.fillColor))}getMass(){return this.getRadius()**i*Math.PI*R}getOpacity(){const t=(W-this.zIndexFactor)**this.options.zIndex.opacityRate,s=this.bubble.opacity??yt(this.opacity?.value??k),i=this.strokeOpacity??k;return this.#Y.fillOpacity=s*(this.fillOpacity??k)*t,this.#Y.opacity=s*t,this.#Y.strokeOpacity=s*i*t,this.#Y}getPosition(){return this.#N.x=this.position.x+this.offset.x,this.#N.y=this.position.y+this.offset.y,this.#N.z=this.position.z,this.#N}getRadius(){return this.bubble.radius??this.size.value}getRotateData(){const t=this.getAngle();return this.#_.sin=Math.sin(t),this.#_.cos=Math.cos(t),this.#_}getStrokeColor(){return this.#G(this.bubble.color??$s(this.strokeColor))}getTransformData(t){const s=this.getRotateData(),i=this.isRotating;return this.#Z.a=s.cos*(t.a??ot.a),this.#Z.b=i?s.sin*(t.b??B):t.b??ot.b,this.#Z.c=i?-s.sin*(t.c??B):t.c??ot.c,this.#Z.d=s.cos*(t.d??ot.d),this.#Z}init(t,s,i,h){const o=this.#t;this.id=t,this.group=h,this.justWarped=!1,this.effectClose=!0,this.shapeClose=!0,this.pathRotation=!1,this.lastPathTime=0,this.destroyed=!1,this.unbreakable=!1,this.isRotating=!1,this.rotation=0,this.misplaced=!1,this.retina={maxDistance:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},this.size={value:1,max:1,min:1,enable:!1},this.outType=et.normal,this.ignoresResizeRatio=!0;const e=ms(this.#s,o,o.actualOptions.particles),n=e.reduceDuplicates,r=e.shape.type;this.effect=nt(e.effect.type,this.id,n),this.shape=nt(r,this.id,n);const a=e.effect,c=e.shape;if(i){if(i.effect?.type&&i.effect.type!==this.effect){const t=nt(i.effect.type,this.id,n);t&&(this.effect=t,a.load(i.effect))}if(i.shape?.type&&i.shape.type!==this.shape){const t=nt(i.shape.type,this.id,n);t&&(this.shape=t,c.load(i.shape))}}if(this.effect===S){const t=[...this.#t.effectDrawers.keys()];this.effect=t[Math.floor(rt()*t.length)]}if(this.shape===S){const t=[...this.#t.shapeDrawers.keys()];this.shape=t[Math.floor(rt()*t.length)]}this.effectData=this.effect?function(t,s,i,h){return f({close:s.close},nt(s.options[t],i,h))}(this.effect,a,this.id,n):void 0,this.shapeData=this.shape?function(t,s,i,h){return f({close:s.close},nt(s.options[t],i,h))}(this.shape,c,this.id,n):void 0,e.load(i);const l=this.effectData,d=this.shapeData;l&&e.load(l.particles),d&&e.load(d.particles),this.effectClose=l?.close??e.effect.close,this.shapeClose=d?.close??e.shape.close,this.options=e,o.retina.initParticle(this);for(const t of o.particleUpdaters)t.preInit?.(this);let u,p;this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this.#K(s),this.initialVelocity=this.#Q(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/o.zLayers,this.sides=24,this.effect&&(u=o.effectDrawers.get(this.effect)),u?.loadEffect&&u.loadEffect(this),this.shape&&(p=o.shapeDrawers.get(this.shape)),p?.loadShape&&p.loadShape(this);const v=p?.getSidesCount;v&&(this.sides=v(this)),this.spawning=!1;for(const t of o.particleUpdaters)t.init(this);u?.particleInit?.(o,this),p?.particleInit?.(o,this);for(const t of o.particleCreatedPlugins)t.particleCreated?.(this)}isInsideCanvas(t){return this.#J({direction:t}).inside}isInsideCanvasForOutMode(t,s){return this.#J({direction:s,outMode:t}).inside}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const s=t%mt,i=s<ht?s+mt:s;return i>=Math.PI*R&&i<Math.PI*U*R}if(this.roll.horizontal){const s=(t+Math.PI*R)%(Math.PI*O),i=s<ht?s+Math.PI*O:s;return i>=Math.PI&&i<Math.PI*O}if(this.roll.vertical){const s=t%(Math.PI*O),i=s<ht?s+Math.PI*O:s;return i>=Math.PI&&i<Math.PI*O}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){for(const t of this.#t.particleUpdaters)t.reset?.(this)}#tt=(t,s)=>{let i=at,h=t?st.create(t.x,t.y,s):void 0;const o=this.#t,e=o.particlePositionPlugins,n=this.options.move.outModes,r=this.getRadius(),a=o.canvas.size,c=new AbortController,{signal:l}=c;for(;!l.aborted;){for(const t of e){const i=t.particlePosition?.(h,this);if(i)return st.create(i.x,i.y,s)}const t=Mt({size:a,position:h}),c=st.create(t.x,t.y,s);this.#st(c,r,n.left??n.default),this.#st(c,r,n.right??n.default),this.#it(c,r,n.top??n.default),this.#it(c,r,n.bottom??n.default);let l=!0;for(const t of o.particles.checkParticlePositionPlugins)if(l=t.checkParticlePosition?.(this,c,i)??!0,!l)break;if(l)return c;i+=ct,h=void 0}return h};#Q=()=>{const t=this.options.move,s=lt(this.direction).copy();if(t.direction===w.inside||t.direction===w.outside)return s;const i=Pt(yt(t.angle.value)),h=Pt(yt(t.angle.offset)),e={left:h-i*R,right:h+i*R};return t.straight||(s.angle+=dt(o(e.left,e.right))),t.random&&"number"==typeof t.speed&&(s.length*=rt()),s};#st=(t,s,i)=>{Es({outMode:i,checkModes:[v.bounce],coord:t.x,maxCoord:this.#t.canvas.size.width,setCb:s=>t.x+=s,radius:s})};#it=(t,s,i)=>{Es({outMode:i,checkModes:[v.bounce],coord:t.y,maxCoord:this.#t.canvas.size.height,setCb:s=>t.y+=s,radius:s})};#ht=(t,s)=>{const i=this.getRadius(),h=this.#t.canvas.size,o=this.position,e=s===v.bounce;return t===ut.bottom?{inside:e?o.y+i<h.height:o.y-i<h.height,reason:"default"}:t===ut.left?{inside:e?o.x-i>ht:o.x+i>ht,reason:"default"}:t===ut.right?{inside:e?o.x+i<h.width:o.x-i<h.width,reason:"default"}:t===ut.top?{inside:e?o.y-i>ht:o.y+i>ht,reason:"default"}:{inside:o.x>=-i&&o.y>=-i&&o.y<=h.height+i&&o.x<=h.width+i,reason:"default"}};#ot=(t,s)=>({canvasSize:this.#t.canvas.size,direction:t,outMode:s,particle:this,radius:this.getRadius()});#J=t=>{const s=this.#ht(t.direction,t.outMode),i=this.#t,h=this.shape?i.shapeDrawers.get(this.shape):void 0,o=this.effect?i.effectDrawers.get(this.effect):void 0,e=h?.isInsideCanvas,n=o?.isInsideCanvas;if(!e&&!n)return s;const r=this.#ot(t.direction,t.outMode),a=e?this.#et(e(r),"shape"):void 0,c=n?this.#et(n(r),"effect"):void 0;if(a&&c){const t=Math.max(a.margin??ht,c.margin??ht);return{inside:a.inside&&c.inside,margin:t>ht?t:void 0,reason:"combined"}}return a??c??s};#G=t=>t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?function(t,s,i){return{h:t.h,s:t.s,l:t.l+(s===D.darken?-$:$)*i}}(t,this.roll.alter.type,this.roll.alter.value):t:t;#K=t=>{const s=this.#t,i=Math.floor(yt(this.options.zIndex.value)),h=this.#tt(t,ft(i,pt,s.zLayers));if(!h)throw new Error("a valid position cannot be found for particle");switch(this.position=h,this.initialPosition=this.position.copy(),this.moveCenter={...vt(this.options.move.center,s.canvas.size),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=wt(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case w.inside:this.outType=et.inside;break;case w.outside:this.outType=et.outside}this.offset=gt.origin};#et=(t,s)=>"boolean"==typeof t?{inside:t,reason:s}:{inside:t.inside,margin:t.margin,reason:t.reason??s}}class qs{#nt;#rt=new Map;#at=[];#ct;#lt;#dt=[];#ut;constructor(t){this.#nt=t,this.#ct=0,this.#ut=0}clear(){this.#rt.clear();const t=this.#lt;t&&(this.#nt=t),this.#lt=void 0}insert(t){const{x:s,y:i}=t.getPosition(),h=this.#ft(s,i);this.#rt.has(h)||this.#rt.set(h,[]),this.#rt.get(h)?.push(t)}query(t,s,i=[]){const h=this.#pt(t);if(!h)return i;const o=Math.floor(h.minX/this.#nt),e=Math.floor(h.maxX/this.#nt),n=Math.floor(h.minY/this.#nt),r=Math.floor(h.maxY/this.#nt);for(let h=o;h<=e;h++)for(let o=n;o<=r;o++){const e=this.#rt.get(`${h}_${o}`);if(e)for(const h of e)s&&!s(h)||t.contains(h.getPosition())&&i.push(h)}return i}queryCircle(t,s,i,h=[]){const o=this.#vt(t.x,t.y,s),e=this.query(o,i,h);return this.#wt(),e}queryRectangle(t,s,i,h=[]){const o=this.#gt(t.x,t.y,s.width,s.height),e=this.query(o,i,h);return this.#wt(),e}setCellSize(t){this.#lt=t}#vt(t,s,i){return(this.#at[this.#ct++]??=new jt(t,s,i)).reset(t,s,i)}#gt(t,s,i,h){return(this.#dt[this.#ut++]??=new Ht(t,s,i,h)).reset(t,s,i,h)}#ft(t,s){return`${Math.floor(t/this.#nt)}_${Math.floor(s/this.#nt)}`}#pt(t){if(t instanceof jt){const s=t.radius,{x:i,y:h}=t.position;return{minX:i-s,maxX:i+s,minY:h-s,maxY:h+s}}if(t instanceof Ht){const{x:s,y:i}=t.position,{width:h,height:o}=t.size;return{minX:s,maxX:s+h,minY:i,maxY:i+o}}return null}#wt(){this.#ct=0,this.#ut=0}}class As{checkParticlePositionPlugins;grid;#yt;#t;#mt;#Mt;#bt;#Pt;#xt;#Ct;#s;#zt;#kt;#St;#Rt;#Dt;#$t;constructor(t,s){this.#s=t,this.#t=s,this.#bt=0,this.#yt=[],this.#zt=[],this.#Mt=0,this.#mt=new Map,this.#Pt=new Map,this.#$t=this.#Ot(this.#t.zLayers),this.grid=new qs(xt),this.checkParticlePositionPlugins=[],this.#xt=[],this.#Ct=[],this.#St=[],this.#kt=[],this.#Dt=[]}get count(){return this.#yt.length}addParticle(t,s,i,h){const o=this.#t.actualOptions.particles.number.limit.mode,e=void 0===i?this.#Mt:this.#mt.get(i)??this.#Mt,n=this.count;if(e>Ct)switch(o){case m.delete:{const t=n+Tt-e;t>zt&&this.removeQuantity(t);break}case m.wait:if(n>=e)return}try{const o=this.#zt.pop()??new Us(this.#s,this.#t);o.init(this.#bt,t,s,i);let e=!0;return h&&(e=h(o)),e?(this.#yt.push(o),this.#Tt(o),this.#bt++,this.#t.dispatchEvent(it.particleAdded,{particle:o}),o):void this.#zt.push(o)}catch(t){kt().warning(`error adding particle: ${t}`)}}clear(){this.#yt=[],this.#Pt.clear(),this.#It(this.#t.zLayers)}destroy(){this.#yt=[],this.#zt.length=0,this.#Pt.clear(),this.#$t=[],this.checkParticlePositionPlugins=[],this.#xt=[],this.#Ct=[],this.#St=[],this.#kt=[],this.#Dt=[]}drawParticles(t){for(let s=this.#$t.length-It;s>=St;s--){const i=this.#$t[s];if(i)for(const s of i)s.draw(t)}}filter(t){return this.#yt.filter(t)}find(t){return this.#yt.find(t)}get(t){return this.#yt[t]}async init(){const t=this.#t,s=t.actualOptions;this.checkParticlePositionPlugins=[],this.#Dt=[],this.#Ct=[],this.#St=[],this.#xt=[],this.#kt=[],this.#Pt.clear(),this.#It(t.zLayers),this.grid=new qs(xt*t.retina.pixelRatio);for(const s of t.plugins)s.redrawInit&&await s.redrawInit(),s.checkParticlePosition&&this.checkParticlePositionPlugins.push(s),s.update&&this.#Dt.push(s),s.particleUpdate&&this.#Ct.push(s),s.postUpdate&&this.#St.push(s),s.particleReset&&this.#xt.push(s),s.postParticleUpdate&&this.#kt.push(s);await this.#t.initDrawersAndUpdaters();for(const s of this.#t.effectDrawers.values())await(s.init?.(t));for(const s of this.#t.shapeDrawers.values())await(s.init?.(t));let i=!1;for(const s of t.plugins)if(i=s.particlesInitialization?.()??i,i)break;if(!i){const t=s.particles,i=t.groups;for(const s in i){const h=i[s];if(h)for(let i=this.count,o=0;o<h.number.value&&i<t.number.value;i++,o++)this.addParticle(void 0,h,s)}for(let s=this.count;s<t.number.value;s++)this.addParticle()}}push(t,s,i,h){for(let o=0;o<t;o++)this.addParticle(s,i,h)}async redraw(){this.clear(),await this.init(),this.#t.canvas.render.drawParticles({value:0,factor:0})}remove(t,s,i){this.removeAt(this.#yt.indexOf(t),void 0,s,i)}removeAt(t,s=Rt,i,h){if(t<St||t>this.count)return;let o=0;for(let e=t;o<s&&e<this.count;e++)this.#Ft(e,i,h)&&(e--,o++)}removeQuantity(t,s){this.removeAt(St,t,s)}setDensity(){const t=this.#t.actualOptions,s=t.particles.groups;let i=0;for(const t of this.#t.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in s){const h=s[t];if(!h)continue;const o=ms(this.#s,this.#t,h);this.#Bt(o,i,t)}this.#Bt(t.particles,i)}setResizeFactor(t){this.#Rt=t}update(t){this.grid.clear();for(const s of this.#Dt)s.update?.(t);const s=this.#Lt(t);for(const s of this.#St)s.postUpdate?.(t);if(this.#Et(t,s),s.size)for(const t of s)this.remove(t);this.#Rt=void 0}#Ut=(...t)=>{this.#zt.push(...t)};#Bt=(t,s,i,h)=>{const o=t.number;if(!o.density.enable)return void(void 0===i?this.#Mt=o.limit.value:(h?.number.limit.value??o.limit.value)&&this.#mt.set(i,h?.number.limit.value??o.limit.value));const e=this.#qt(o.density),n=o.value,r=Math.min(n,o.limit.value>Ct?o.limit.value:n)*e+s,a=Math.min(this.count,this.filter((t=>t.group===i)).length);void 0===i?this.#Mt=o.limit.value*e:this.#mt.set(i,o.limit.value*e),a<r?this.push(Math.abs(r-a),void 0,t,i):a>r&&this.removeQuantity(a-r,i)};#Ot=t=>{const s=Math.max(Math.floor(t),It);return Array.from({length:s},(()=>[]))};#At=t=>{const s=this.#$t.length-It;return s<=St?St:Math.min(Math.max(Math.floor(t),St),s)};#Vt=(t,s)=>{let i=St,h=t.length;for(;i<h;){const o=Math.floor((i+h)/O),e=t[o];e&&e.id<s?i=o+It:h=o}return i};#qt=t=>{const s=this.#t;if(!t.enable)return Dt;const h=s.canvas.size;return h.width&&h.height?h.width*h.height/(t.height*t.width*s.retina.pixelRatio**i):Dt};#Tt=t=>{const s=this.#At(t.position.z),i=this.#$t[s];i&&(i.splice(this.#Vt(i,t.id),$t,t),this.#Pt.set(t.id,s))};#Ft=(t,s,i)=>{const h=this.#yt[t];return!!h&&h.group===s&&(this.#yt.splice(t,Ot),this.#jt(h),h.destroy(i),this.#t.dispatchEvent(it.particleRemoved,{particle:h}),this.#Ut(h),!0)};#jt=t=>{const s=this.#Pt.get(t.id)??this.#At(t.position.z),i=this.#$t[s];if(!i)return void this.#Pt.delete(t.id);const h=this.#Vt(i,t.id);i[h]?.id===t.id?(i.splice(h,Ot),this.#Pt.delete(t.id)):this.#Pt.delete(t.id)};#It=t=>{const s=Math.max(Math.floor(t),It);if(this.#$t.length===s)for(const t of this.#$t)t.length=St;else this.#$t=this.#Ot(s)};#Ht=t=>{const s=this.#At(t.position.z),i=this.#Pt.get(t.id);if(void 0===i)return void this.#Tt(t);if(i===s)return;const h=this.#$t[i];if(h){const s=this.#Vt(h,t.id);h[s]?.id===t.id&&h.splice(s,Ot)}const o=this.#$t[s];o?(o.splice(this.#Vt(o,t.id),$t,t),this.#Pt.set(t.id,s)):this.#Pt.set(t.id,s)};#Lt=t=>{const s=new Set,i=this.#Rt;for(const h of this.#yt){i&&!h.ignoresResizeRatio&&(h.position.x*=i.width,h.position.y*=i.height,h.initialPosition.x*=i.width,h.initialPosition.y*=i.height),h.ignoresResizeRatio=!1;for(const t of this.#xt)t.particleReset?.(h);for(const s of this.#Ct){if(h.destroyed)break;s.particleUpdate?.(h,t)}h.destroyed?s.add(h):this.grid.insert(h)}return s};#Et=(t,s)=>{for(const i of this.#yt)if(i.destroyed)s.add(i);else{for(const s of this.#t.particleUpdaters)s.update(i,t);if(!i.spawning)for(const s of this.#kt)s.postParticleUpdate?.(i,t);this.#Ht(i)}}}class Vs{pixelRatio;reduceFactor;#t;constructor(t){this.#t=t,this.pixelRatio=Ft,this.reduceFactor=Bt}init(){const t=this.#t;this.pixelRatio=t.actualOptions.detectRetina?devicePixelRatio:Ft,this.reduceFactor=Bt;const s=this.pixelRatio,i=t.canvas,h=i.domElement;h&&(i.size.width=h.offsetWidth*s,i.size.height=h.offsetHeight*s)}initParticle(t){const s=this.pixelRatio,i=t.options.move,h=i.distance,o=t.retina;o.maxSpeed=yt(i.gravity.maxSpeed)*s,o.moveDrift=yt(i.drift)*s,o.moveSpeed=yt(i.speed)*s;const e=o.maxDistance;e.horizontal=void 0===h.horizontal?void 0:h.horizontal*s,e.vertical=void 0===h.vertical?void 0:h.vertical*s}}function js(t){return!t.destroyed}function Hs(t,s,...i){const h=new Ms(t,s);return ys(h,...i),h}class Ws{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;id;pageHidden;particleCreatedPlugins;particleDestroyedPlugins;particlePositionPlugins;particleUpdaters;particles;plugins;retina;shapeDrawers;started;zLayers;#Wt;#Xt;#Yt={value:0,factor:0};#Nt;#_t;#Zt;#Gt;#Kt;#Qt;#Jt;#ts;#ss;#is;#hs;#s;#os;#es;constructor(t){const{dispatchCallback:s,pluginManager:i,id:h,onDestroy:o,sourceOptions:e}=t;this.#s=i,this.#Nt=s,this.#ss=o,this.id=Symbol(h),this.fpsLimit=120,this.hdr=!1,this.#os=!1,this.#Wt=0,this.#Zt=0,this.#ts=0,this.#Kt=!0,this.started=!1,this.destroyed=!1,this.#hs=!0,this.#Jt=0,this.zLayers=100,this.pageHidden=!1,this.#es=e,this.#Qt=e,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new Vs(this),this.canvas=new Bs(this.#s,this),this.particles=new As(this.#s,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this.#is=Hs(this.#s,this),this.actualOptions=Hs(this.#s,this),this.#Gt=new Ls(this),this.dispatchEvent(it.containerBuilt)}get animationStatus(){return!this.#hs&&!this.pageHidden&&js(this)}get options(){return this.#is}get sourceOptions(){return this.#es}addLifeTime(t){this.#ts+=t}alive(){return!this.#Zt||this.#ts<=this.#Zt}destroy(t=!0){if(js(this)){this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,t]of this.effectDrawers)t.destroy?.(this);for(const[,t]of this.shapeDrawers)t.destroy?.(this);for(const t of this.plugins)t.destroy?.();this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.plugins.length=0,this.#s.clearPlugins(this),this.destroyed=!0,this.#ss(t),this.dispatchEvent(it.containerDestroyed)}}dispatchEvent(t,s){this.#Nt(t,{container:this,data:s})}draw(t){if(!js(this))return;let s=t;this.#_t=Lt((t=>{s&&(this.#Jt=void 0,s=!1),this.#ns(t)}))}async export(t,s={}){for(const i of this.plugins){if(!i.export)continue;const h=await i.export(t,s);if(h.supported)return h.blob}kt().error(`Export plugin with type ${t} not found`)}async init(){if(!js(this))return;const t=new Map;for(const s of this.#s.plugins){const i=await s.getPlugin(this);i.preInit&&await i.preInit(),t.set(s,i)}await this.initDrawersAndUpdaters(),this.#is=Hs(this.#s,this,this.#Qt,this.sourceOptions),this.actualOptions=Hs(this.#s,this,this.#is),this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[s,i]of t)s.needsPlugin(this.actualOptions)&&(this.plugins.push(i),i.particleCreated&&this.particleCreatedPlugins.push(i),i.particleDestroyed&&this.particleDestroyedPlugins.push(i),i.particlePosition&&this.particlePositionPlugins.push(i));this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:s,duration:i,fpsLimit:h,hdr:o,smooth:e,zLayers:n}=this.actualOptions;this.hdr=o,this.zLayers=n,this.#Zt=yt(i)*K,this.#Wt=yt(s)*K,this.#ts=0,this.fpsLimit=h>Ut?h:Et,this.#os=e;for(const t of this.plugins)await(t.init?.());await this.particles.init(),this.dispatchEvent(it.containerInit),this.particles.setDensity();for(const t of this.plugins)t.particlesSetup?.();this.dispatchEvent(it.particlesSetup)}async initDrawersAndUpdaters(){const t=this.#s;this.effectDrawers=await t.getEffectDrawers(this,!0),this.shapeDrawers=await t.getShapeDrawers(this,!0),this.particleUpdaters=await t.getUpdaters(this,!0)}pause(){if(js(this)&&(void 0!==this.#_t&&(qt(this.#_t),this.#_t=void 0),!this.#hs)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this.#hs=!0),this.dispatchEvent(it.containerPaused)}}play(t){if(!js(this))return;const s=this.#hs||t;if(!this.#Kt||this.actualOptions.autoPlay){if(this.#hs&&(this.#hs=!1),s)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(it.containerPlay),this.draw(s??!1)}else this.#Kt=!1}async refresh(){if(js(this))return this.stop(),this.start()}async reset(t){if(js(this))return this.#Qt=t,this.#es=t,this.#is=Hs(this.#s,this,this.#Qt,this.sourceOptions),this.actualOptions=Hs(this.#s,this,this.#is),this.refresh()}async start(){js(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise((t=>{const s=async()=>{this.#Gt.addListeners();for(const t of this.plugins)await(t.start?.());this.dispatchEvent(it.containerStarted),this.play(),t()};this.#Xt=setTimeout((()=>{s()}),this.#Wt)})))}stop(){if(js(this)&&this.started){this.#Xt&&(clearTimeout(this.#Xt),this.#Xt=void 0),this.#Kt=!0,this.started=!1,this.#Gt.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop();for(const t of this.plugins)t.stop?.();this.particleCreatedPlugins.length=0,this.particleDestroyedPlugins.length=0,this.particlePositionPlugins.length=0,this.#es=this.#is,this.dispatchEvent(it.containerStopped)}}updateActualOptions(){let t=!1;for(const s of this.plugins)s.updateActualOptions&&(t=s.updateActualOptions()||t);return t}#ns=t=>{try{if(!this.#os&&void 0!==this.#Jt&&t<this.#Jt+K/this.fpsLimit)return void this.draw(!1);if(this.#Jt??=t,function(t,s,i=At,h=!1){t.value=s,t.factor=h?At/i:At*s/K}(this.#Yt,t-this.#Jt,this.fpsLimit,this.#os),this.addLifeTime(this.#Yt.value),this.#Jt=t,this.#Yt.value>K)return void this.draw(!1);if(this.canvas.render.drawParticles(this.#Yt),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){kt().error("error in animation loop",t)}}}export{Ws as Container}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as o,b as n}from"./p-DKFk70aj.js";export{s as setNonce}from"./p-DKFk70aj.js";import{g as p}from"./p-DQuL1Twl.js";(()=>{const s=import.meta.url,n={};return""!==s&&(n.resourcesUrl=new URL(".",s).href),o(n)})().then((async o=>(await p(),n([["p-
|
|
1
|
+
import{p as o,b as n}from"./p-DKFk70aj.js";export{s as setNonce}from"./p-DKFk70aj.js";import{g as p}from"./p-DQuL1Twl.js";(()=>{const s=import.meta.url,n={};return""!==s&&(n.resourcesUrl=new URL(".",s).href),o(n)})().then((async o=>(await p(),n([["p-4488fb9d",[[0,"stencil-particles",{options:[16],url:[1],init:[16]},null,{options:[{onPropsChange:0}],url:[{onPropsChange:0}],init:[{onPropsChange:0}]}]]]],o))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/stencil",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "Official tsParticles Stencil Component - Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Matteo Bruni <matteo.bruni@me.com>",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"build:ci": "stencil build"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@tsparticles/engine": "^4.1.
|
|
41
|
+
"@tsparticles/engine": "^4.1.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@stencil/core": "^4.43.5",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@tsparticles/engine": "workspace:*"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "fdcbe4842e3ddba0d5c24cb76fc8a68792d9c4b4"
|
|
64
64
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as t,c as s,s as i,a as h,b as o,h as e,d as n,l as r,e as a,f as c,g as l,j as d,k as u,m as f,P as p,O as v,M as w,n as g,o as y,L as m,p as M,q as b,r as P,u as x,v as C,w as z,x as k,y as S,z as R,A as D,B as $,C as O,D as T,E as I,F,G as B,H as L,I as E,J as U,K as A,N as q,Q as V,S as j,T as Y,U as H,V as W,W as X,X as N,Y as _,Z as K,_ as Z,$ as G,a0 as Q,a1 as J,a2 as tt,a3 as st,a4 as it,a5 as ht,a6 as ot,a7 as et,a8 as nt,a9 as rt,aa as at,ab as ct,ac as lt,ad as dt,ae as ut,af as ft,ag as pt,ah as vt,ai as wt,aj as gt,ak as yt,al as mt,am as Mt,an as bt,ao as Pt,ap as xt,aq as Ct,ar as zt,as as kt,at as St,au as Rt,av as Dt,aw as $t,ax as Ot,ay as Tt,az as It,aA as Ft,aB as Bt,aC as Lt,aD as Et,aE as Ut,aF as At,aG as qt}from"./p-DeRPmYjK.js";class Vt{position;type;constructor(t,s,i){this.position={x:t,y:s},this.type=i}_resetPosition(t,s){this.position.x=t,this.position.y=s}}class jt extends Vt{radius;constructor(s,i,h){super(s,i,t.circle),this.radius=h}contains(t){return s(t,this.position,this.radius)}intersects(s){const h=this.position,o=s.position,e=this.radius,n=Math.abs(o.x-h.x),r=Math.abs(o.y-h.y);if(s instanceof jt||s.type===t.circle)return e+s.radius>Math.hypot(n,r);if(s instanceof Yt||s.type===t.rectangle){const t=s,{width:h,height:o}=t.size;return Math.pow(n-h,i)+Math.pow(r-o,i)<=e**i||n<=e+h&&r<=e+o||n<=h||r<=o}return!1}reset(t,s,i){return this._resetPosition(t,s),this.radius=i,this}}class Yt extends Vt{size;constructor(s,i,h,o){super(s,i,t.rectangle),this.size={height:o,width:h}}contains(t){const s=this.position;return t.x>=s.x&&t.x<=s.x+this.size.width&&t.y>=s.y&&t.y<=s.y+this.size.height}intersects(t){if(t instanceof jt)return t.intersects(this);if(!(t instanceof Yt))return!1;const s=this.position,i=t.position,h=t.size;return i.x<s.x+this.size.width&&i.x+h.width>s.x&&i.y<s.y+this.size.height&&i.y+h.height>s.y}reset(t,s,i,h){return this._resetPosition(t,s),this.size.width=i,this.size.height=h,this}}class Ht{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(t){h(t)||(void 0!==t.count&&(this.count=o(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=o(t.speed)),void 0!==t.decay&&(this.decay=o(t.decay)),void 0!==t.delay&&(this.delay=o(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class Wt extends Ht{max;min;offset;constructor(t,s){super(),this.min=t,this.max=s,this.offset=0,this.sync=!0}load(t){super.load(t),h(t)||(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.offset&&(this.offset=o(t.offset)))}}class Xt{h=new Wt(e,n);l=new Wt(r,a);s=new Wt(c,l);load(t){h(t)||(this.h.load(t.h),this.s.load(t.s),this.l.load(t.l))}}class Nt{value;constructor(){this.value=""}static create(t,s){const i=new Nt;return i.load(t),void 0!==s&&(d(s)||u(s)?i.load({value:s}):i.load(s)),i}load(t){h(t)||h(t.value)||(this.value=t.value)}}class _t extends Nt{animation;constructor(){super(),this.animation=new Xt}static create(t,s){const i=new _t;return i.load(t),void 0!==s&&(d(s)||u(s)?i.load({value:s}):i.load(s)),i}load(t){if(super.load(t),h(t))return;const s=t.animation;void 0!==s&&(void 0===s.enable?this.animation.load(t.animation):this.animation.h.load(s))}}class Kt{color;image;opacity;position;repeat;size;constructor(){this.color=new Nt,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(t){h(t)||(void 0!==t.color&&(this.color=Nt.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image),void 0!==t.position&&(this.position=t.position),void 0!==t.repeat&&(this.repeat=t.repeat),void 0!==t.size&&(this.size=t.size),void 0!==t.opacity&&(this.opacity=t.opacity))}}class Zt{enable;zIndex;constructor(){this.enable=!0,this.zIndex=0}load(t){h(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.zIndex&&(this.zIndex=t.zIndex))}}class Gt{delay;enable;constructor(){this.delay=.5,this.enable=!0}load(t){h(t)||(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.enable&&(this.enable=t.enable))}}class Qt{close;options;type;constructor(){this.close=!0,this.options={},this.type=[]}load(t){if(h(t))return;const s=t.options;if(void 0!==s)for(const t in s){const i=s[t];i&&(this.options[t]=f(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class Jt{color;enable;opacity;constructor(){this.enable=!0,this.opacity=1}load(t){h(t)||(void 0!==t.color&&(this.color=_t.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.opacity&&(this.opacity=o(t.opacity)))}}class ts{offset;value;constructor(){this.offset=0,this.value=90}load(t){h(t)||(void 0!==t.offset&&(this.offset=o(t.offset)),void 0!==t.value&&(this.value=o(t.value)))}}class ss{mode;radius;x;y;constructor(){this.x=50,this.y=50,this.mode=p.percent,this.radius=0}load(t){h(t)||(void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.radius&&(this.radius=t.radius))}}class is{acceleration;enable;inverse;maxSpeed;constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(t){h(t)||(void 0!==t.acceleration&&(this.acceleration=o(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.inverse&&(this.inverse=t.inverse),void 0!==t.maxSpeed&&(this.maxSpeed=o(t.maxSpeed)))}}class hs{value;constructor(){this.value=0}load(t){h(t)||h(t.value)||(this.value=o(t.value))}}class os{clamp;delay;enable;generator;options;constructor(){this.clamp=!0,this.delay=new hs,this.enable=!1,this.options={}}load(t){h(t)||(void 0!==t.clamp&&(this.clamp=t.clamp),this.delay.load(t.delay),void 0!==t.enable&&(this.enable=t.enable),this.generator=t.generator,t.options&&(this.options=f(this.options,t.options)))}}class es{bottom;default;left;right;top;constructor(){this.default=v.out}load(t){h(t)||(void 0!==t.default&&(this.default=t.default),this.bottom=t.bottom??t.default,this.left=t.left??t.default,this.right=t.right??t.default,this.top=t.top??t.default)}}class ns{acceleration;enable;position;constructor(){this.acceleration=0,this.enable=!1}load(t){h(t)||(void 0!==t.acceleration&&(this.acceleration=o(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),t.position&&(this.position=f({},t.position)))}}class rs{angle;center;decay;direction;distance;drift;enable;gravity;outModes;path;random;size;speed;spin;straight;vibrate;warp;constructor(){this.angle=new ts,this.center=new ss,this.decay=0,this.distance={},this.direction=w.none,this.drift=0,this.enable=!1,this.gravity=new is,this.path=new os,this.outModes=new es,this.random=!1,this.size=!1,this.speed=2,this.spin=new ns,this.straight=!1,this.vibrate=!1,this.warp=!1}load(t){if(h(t))return;this.angle.load(g(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),void 0!==t.decay&&(this.decay=o(t.decay)),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.distance&&(this.distance=g(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),void 0!==t.drift&&(this.drift=o(t.drift)),void 0!==t.enable&&(this.enable=t.enable),this.gravity.load(t.gravity);const s=t.outModes;void 0!==s&&(y(s)?this.outModes.load(s):this.outModes.load({default:s})),this.path.load(t.path),void 0!==t.random&&(this.random=t.random),void 0!==t.size&&(this.size=t.size),void 0!==t.speed&&(this.speed=o(t.speed)),this.spin.load(t.spin),void 0!==t.straight&&(this.straight=t.straight),void 0!==t.vibrate&&(this.vibrate=t.vibrate),void 0!==t.warp&&(this.warp=t.warp)}}class as{color;opacity;width;constructor(){this.width=0}load(t){h(t)||(void 0!==t.color&&(this.color=_t.create(this.color,t.color)),void 0!==t.width&&(this.width=o(t.width)),void 0!==t.opacity&&(this.opacity=o(t.opacity)))}}class cs{color;fill;stroke;load(t){h(t)||(void 0!==t.color&&(this.color=_t.create(this.color,t.color)),void 0!==t.fill&&(this.fill??=new Jt,this.fill.load(t.fill)),void 0!==t.stroke&&(this.stroke??=new as,this.stroke.load(t.stroke)))}}class ls extends hs{constructor(){super(),this.value=1}}class ds{horizontal;vertical;constructor(){this.horizontal=new ls,this.vertical=new ls}load(t){h(t)||(this.horizontal.load(t.horizontal),this.vertical.load(t.vertical))}}class us{enable;height;width;constructor(){this.enable=!1,this.width=1920,this.height=1080}load(t){if(h(t))return;void 0!==t.enable&&(this.enable=t.enable);const s=t.width;void 0!==s&&(this.width=s);const i=t.height;void 0!==i&&(this.height=i)}}class fs{mode;value;constructor(){this.mode=m.delete,this.value=0}load(t){h(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class ps{density;limit;value;constructor(){this.density=new us,this.limit=new fs,this.value=0}load(t){h(t)||(this.density.load(t.density),this.limit.load(t.limit),void 0!==t.value&&(this.value=t.value))}}class vs{close;options;type;constructor(){this.close=!0,this.options={},this.type="circle"}load(t){if(h(t))return;const s=t.options;if(void 0!==s)for(const t in s){const i=s[t];i&&(this.options[t]=f(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class ws extends hs{opacityRate;sizeRate;velocityRate;constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(t){super.load(t),h(t)||(void 0!==t.opacityRate&&(this.opacityRate=t.opacityRate),void 0!==t.sizeRate&&(this.sizeRate=t.sizeRate),void 0!==t.velocityRate&&(this.velocityRate=t.velocityRate))}}class gs{bounce;effect;groups;move;number;paint;palette;reduceDuplicates;shape;zIndex;#t;#s;constructor(t,s){this.#s=t,this.#t=s,this.bounce=new ds,this.effect=new Qt,this.groups={},this.move=new rs,this.number=new ps,this.paint=new cs,this.paint.color=new _t,this.paint.color.value="#fff",this.paint.fill=new Jt,this.paint.fill.enable=!0,this.reduceDuplicates=!1,this.shape=new vs,this.zIndex=new ws}load(t){if(h(t))return;if(t.palette&&(this.palette=t.palette,this.#i(this.palette)),void 0!==t.groups)for(const s of Object.keys(t.groups)){if(!(s in t.groups))continue;const i=t.groups[s];void 0!==i&&(this.groups[s]=f(this.groups[s]??{},i))}void 0!==t.reduceDuplicates&&(this.reduceDuplicates=t.reduceDuplicates),this.bounce.load(t.bounce),this.effect.load(t.effect),this.move.load(t.move),this.number.load(t.number);const s=t.paint;if(s&&(u(s)?this.paint=M(s,(t=>{const s=new cs;return s.load(t),s})):u(this.paint)?(this.paint=new cs,this.paint.load(s)):this.paint.load(s)),this.shape.load(t.shape),this.zIndex.load(t.zIndex),this.#t){for(const s of this.#s.plugins)s.loadParticlesOptions&&s.loadParticlesOptions(this.#t,this,t);const s=this.#s.updaters.get(this.#t);if(s)for(const i of s)i.loadOptions&&i.loadOptions(this,t)}}#i=t=>{const s=this.#s.getPalette(t);if(!s)return;const i=s.colors,h=(u(i)?i:[i]).flatMap((t=>{const s=t.fill,i=t.stroke,h=s?{color:{value:s.value},enable:s.enable,opacity:s.opacity}:void 0;return i?[{fill:h,stroke:{color:{value:i.value},opacity:i.opacity,width:i.width||0}}]:[{fill:h}]}));this.load({paint:h.length>1?h:h[0]??{},blend:{enable:!0,mode:s.blendMode}})}}function ys(t,...s){for(const i of s)t.load(i)}function ms(t,s,...i){const h=new gs(t,s);return ys(h,...i),h}class Ms{autoPlay;background;clear;defaultThemes;delay;detectRetina;duration;fpsLimit;fullScreen;hdr;key;name;palette;particles;pauseOnBlur;pauseOnOutsideViewport;preset;resize;smooth;style;zLayers;#t;#s;constructor(t,s){this.#s=t,this.#t=s,this.autoPlay=!0,this.background=new Kt,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new Zt,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.hdr=!0,this.particles=ms(this.#s,this.#t),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.resize=new Gt,this.smooth=!1,this.style={},this.zLayers=100}load(t){if(h(t))return;void 0!==t.preset&&(this.preset=t.preset,M(this.preset,(t=>{this.#h(t)}))),void 0!==t.palette&&(this.palette=t.palette,this.#i(this.palette)),void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.clear&&(this.clear=t.clear),void 0!==t.key&&(this.key=t.key),void 0!==t.name&&(this.name=t.name),void 0!==t.delay&&(this.delay=o(t.delay));const s=t.detectRetina;void 0!==s&&(this.detectRetina=s),void 0!==t.duration&&(this.duration=o(t.duration));const i=t.fpsLimit;void 0!==i&&(this.fpsLimit=i),void 0!==t.hdr&&(this.hdr=t.hdr),void 0!==t.pauseOnBlur&&(this.pauseOnBlur=t.pauseOnBlur),void 0!==t.pauseOnOutsideViewport&&(this.pauseOnOutsideViewport=t.pauseOnOutsideViewport),void 0!==t.zLayers&&(this.zLayers=t.zLayers),this.background.load(t.background);const e=t.fullScreen;b(e)?this.fullScreen.enable=e:this.fullScreen.load(e),this.particles.load(t.particles),this.resize.load(t.resize),this.style=f(this.style,t.style),void 0!==t.smooth&&(this.smooth=t.smooth),this.#s.plugins.forEach((s=>{s.loadOptions(this.#t,this,t)}))}#i=t=>{const s=this.#s.getPalette(t);s&&this.load({background:{color:s.background},blend:{enable:!0,mode:s.blendMode},particles:{palette:t}})};#h=t=>{this.load(this.#s.getPreset(t))}}function bs(t,s){t.clearRect(P.x,P.y,s.width,s.height)}function Ps(t,s,i,h){s.drawParticle&&s.drawParticle(t,i,h)}const xs=new Map;function Cs(t,s){let i=xs.get(t);return i||(i=s(),xs.size>=1e3&&[...xs.keys()].slice(0,1e3*R).forEach((t=>xs.delete(t))),xs.set(t,i)),i}function zs(t,s,i,h=!0){if(!s)return;const o=d(s)?{value:s}:s;if(d(o.value))return ks(t,o.value,i,h);if(u(o.value)){const s=z(o.value,i,h);if(!s)return;return zs(t,{value:s})}for(const s of t.colorManagers.values()){const t=s.handleRangeColor(o);if(t)return t}}function ks(t,s,i,h=!0){if(!s)return;const o=d(s)?{value:s}:s;if(d(o.value))return o.value===S?function(){const t=L,s=I+B,i=()=>Math.floor(F(t,s));return{b:i(),g:i(),r:i()}}():function(t,s){return function(t,s){if(s)for(const i of t.colorManagers.values())if(i.accepts(s))return i.parseString(s)}(t,s)}(t,o.value);if(u(o.value)){const s=z(o.value,i,h);if(!s)return;return ks(t,{value:s})}for(const s of t.colorManagers.values()){const t=s.handleColor(o);if(t)return t}}function Ss(t,s,i,h=!0){const o=zs(t,s,i,h);return o?function(t){const s=t.r/I,i=t.g/I,h=t.b/I,o=Math.max(s,i,h),r=Math.min(s,i,h),d={h:e,l:(o+r)*R,s:c};return o!==r&&(d.s=d.l<R?(o-r)/(o+r):(o-r)/(O-o-r),d.h=s===o?(i-h)/(o-r):i===o?O+(h-s)/(o-r):O*O+(s-i)/(o-r)),d.l*=a,d.s*=l,d.h*=T,d.h<e&&(d.h+=n),d.h>=n&&(d.h-=n),d}(o):void 0}function Rs(t,s){return`color(display-p3 ${(t.r/I).toString()} ${(t.g/I).toString()} ${(t.b/I).toString()} / ${(s??k).toString()})`}function Ds(t,s,i){const h=i??k;return Cs(`hsl-${t.h.toFixed(2)}-${t.s.toFixed(2)}-${t.l.toFixed(2)}-${s?"hdr":"sdr"}-${h.toString()}`,(()=>s?function(t,s){return Rs(function(t){const s=(t.h%n+n)%n,i=Math.max(c,Math.min(l,t.s)),h=Math.max(r,Math.min(a,t.l)),o=s/n,e=i/l,d=h/a;if(i===c){const t=Math.round(d*I);return{r:t,g:t,b:t}}const u=(t,s,i)=>(i<0&&i++,i>1&&i--,i*E<1?t+(s-t)*E*i:i*O<1?s:i*U<1*O?t+(s-t)*(O/U-i)*E:t),f=d<R?d*(q+e):d+e-d*e,p=O*d-f,v=A/U,w=Math.min(I,I*u(p,f,o+v)),g=Math.min(I,I*u(p,f,o)),y=Math.min(I,I*u(p,f,o-v));return{r:Math.round(w),g:Math.round(g),b:Math.round(y)}}(t),s)}(t,i):function(t,s){return`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${(s??k).toString()})`}(t,i)))}function $s(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function Os(t,s,i){const h=s[i];void 0!==h&&(t[i]=(t[i]??Y)*h)}class Ts{#o;#e;#n;#r;#a;#t;#c;#l;#d;#u;#f;#p;#v;#w;#s;#g;#y;#m={};#M=[void 0,void 0];#b={};constructor(t,s,i){this.#s=t,this.#t=s,this.#e=i,this.#c=null,this.#y=[],this.#g=[],this.#a=[],this.#o=[],this.#n=[],this.#r=[],this.#d=[],this.#u=[],this.#f=[],this.#p=[],this.#w=[],this.#v=[]}get settings(){return this.#l}canvasClear(){this.#t.actualOptions.clear&&this.draw((t=>{bs(t,this.#e.size)}))}clear(){let t=!1;for(const s of this.#o)if(t=s.canvasClear?.()??!1,t)break;t||this.canvasClear()}destroy(){this.stop(),this.#y=[],this.#g=[],this.#a=[],this.#o=[],this.#n=[],this.#r=[],this.#d=[],this.#u=[],this.#f=[],this.#p=[],this.#w=[],this.#v=[]}draw(t){const s=this.#c;if(s)return t(s)}drawParticle(t,s){if(t.spawning||t.destroyed)return;const i=t.getRadius();if(i<=V)return;const h=t.getFillColor(),o=t.getStrokeColor();let[e,n]=this.#P(t);if(e??=h,n??=o,!e&&!n)return;const r=this.#t,a=t.options.zIndex,c=H-t.zIndexFactor,{fillOpacity:l,opacity:d,strokeOpacity:u}=t.getOpacity(),f=this.#b,p=this.#m,v=e?Ds(e,r.hdr,l*d):void 0,w=n?Ds(n,r.hdr,u*d):v;f.a=f.b=f.c=f.d=void 0,p.fill=v,p.stroke=w,this.draw((h=>{for(const i of this.#f)i.drawParticleSetup?.(h,t,s);this.#x(h,t,i,d,p,f),function(t){const{container:s,context:i,particle:h,delta:o,colorStyles:e,radius:n,opacity:r,transform:a}=t,{effectDrawers:c,shapeDrawers:l}=s,d=h.getPosition(),u=h.getTransformData(a),f=C,p={x:d.x,y:d.y};i.setTransform(u.a,u.b,u.c,u.d,d.x,d.y),e.fill&&(i.fillStyle=e.fill);const v=!!h.fillEnabled,w=h.strokeWidth??x;i.lineWidth=w,e.stroke&&(i.strokeStyle=e.stroke);const g={context:i,particle:h,radius:n,drawRadius:n*f,opacity:r,delta:o,pixelRatio:s.retina.pixelRatio,fill:v,stroke:w>x,transformData:u,position:{...d},drawPosition:p,drawScale:f};for(const t of s.plugins)t.drawParticleTransform?.(g);const y=h.effect?c.get(h.effect):void 0,m=h.shape?l.get(h.shape):void 0;!function(t,s){if(!t?.drawBefore)return;const{particle:i}=s;i.effect&&t.drawBefore(s)}(y,g),function(t,s){if(!t?.beforeDraw)return;const{particle:i}=s;i.shape&&t.beforeDraw(s)}(m,g),function(t,s){if(!t)return;const{context:i,fill:h,particle:o,stroke:e}=s;o.shape&&(i.beginPath(),t.draw(s),o.shapeClose&&i.closePath(),h&&i.fill(),e&&i.stroke())}(m,g),function(t,s){if(!t?.afterDraw)return;const{particle:i}=s;i.shape&&t.afterDraw(s)}(m,g),function(t,s){if(!t?.drawAfter)return;const{particle:i}=s;i.effect&&t.drawAfter(s)}(y,g),i.resetTransform()}({container:r,context:h,particle:t,delta:s,colorStyles:p,radius:i*c**a.sizeRate,opacity:d,transform:f}),this.#C(t);for(const i of this.#u)i.drawParticleCleanup?.(h,t,s)}))}drawParticlePlugins(t,s){this.draw((i=>{for(const h of this.#d)Ps(i,h,t,s)}))}drawParticles(t){const{particles:s}=this.#t;this.clear(),s.update(t),this.draw((i=>{for(const s of this.#w)s.drawSettingsSetup?.(i,t);for(const s of this.#p)s.draw?.(i,t);s.drawParticles(t);for(const s of this.#r)s.clearDraw?.(i,t);for(const s of this.#v)s.drawSettingsCleanup?.(i,t)}))}init(){this.initUpdaters(),this.initPlugins(),this.paint()}initPlugins(){this.#a=[],this.#o=[],this.#n=[],this.#r=[],this.#d=[],this.#f=[],this.#u=[],this.#p=[],this.#w=[],this.#v=[];for(const t of this.#t.plugins)(t.particleFillColor??t.particleStrokeColor)&&this.#a.push(t),t.canvasClear&&this.#o.push(t),t.canvasPaint&&this.#n.push(t),t.drawParticle&&this.#d.push(t),t.drawParticleSetup&&this.#f.push(t),t.drawParticleCleanup&&this.#u.push(t),t.draw&&this.#p.push(t),t.drawSettingsSetup&&this.#w.push(t),t.drawSettingsCleanup&&this.#v.push(t),t.clearDraw&&this.#r.push(t)}initUpdaters(){this.#y=[],this.#g=[];for(const t of this.#t.particleUpdaters)t.afterDraw&&this.#g.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#y.push(t)}paint(){let t=!1;for(const s of this.#n)if(t=s.canvasPaint?.()??!1,t)break;t||this.paintBase()}paintBase(t){this.draw((s=>{!function(t,s,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(P.x,P.y,s.width,s.height)}(s,this.#e.size,t)}))}paintImage(t,s){this.draw((i=>{!function(t,s,i,h){if(!i)return;const o=t.globalAlpha;t.globalAlpha=h,t.drawImage(i,P.x,P.y,s.width,s.height),t.globalAlpha=o}(i,this.#e.size,t,s)}))}setContext(t){this.#c=t,this.#c&&(this.#c.globalCompositeOperation=j)}setContextSettings(t){this.#l=t}stop(){this.draw((t=>{bs(t,this.#e.size)}))}#C=t=>{for(const s of this.#g)s.afterDraw?.(t)};#x=(t,s,i,h,o,e)=>{for(const n of this.#y){if(n.getColorStyles){const{fill:e,stroke:r}=n.getColorStyles(s,t,i,h);e&&(o.fill=e),r&&(o.stroke=r)}if(n.getTransformValues){const t=n.getTransformValues(s);for(const s in t)Os(e,t,s)}n.beforeDraw?.(s)}};#P=t=>{let s,i;for(const h of this.#a)if(!s&&h.particleFillColor&&(s=Ss(this.#s,h.particleFillColor(t))),!i&&h.particleStrokeColor&&(i=Ss(this.#s,h.particleStrokeColor(t))),s&&i)break;return this.#M[0]=s,this.#M[1]=i,this.#M}}const Is=new WeakMap;function Fs(t,s,i=!1){if(!s)return;const h=t.style,o=new Set;for(let t=0;t<h.length;t++){const s=h.item(t);s&&o.add(s)}for(let t=0;t<s.length;t++){const i=s.item(t);i&&o.add(i)}for(const t of o){const o=s.getPropertyValue(t);o?h.setProperty(t,o,i?"important":""):h.removeProperty(t)}}class Bs{domElement;render;renderCanvas;size;zoom=C;#t;#z;#k;#S;#s;#R;#D;#$;#O;constructor(t,s){this.#s=t,this.#t=s,this.render=new Ts(t,s,this),this.#$={height:0,width:0};const i=s.retina.pixelRatio,h=this.#$;this.size={height:h.height*i,width:h.width*i},this.#z=!1,this.#D=[],this.#R="none"}get#T(){return this.#t.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this.#z){const t=this.domElement;t?.remove(),this.domElement=void 0,this.renderCanvas=void 0}else this.#I();this.render.destroy(),this.#D=[]}getZoomCenter(){const t=this.#t.retina.pixelRatio,{width:s,height:i}=this.size;return this.#O?this.#O:{x:s*R/t,y:i*R/t}}init(){this.#F((t=>{t.disconnect()})),this.#k=W((t=>{for(const s of t)"attributes"===s.type&&"style"===s.attributeName&&this.#B()})),this.resize(),this.#L(),this.initBackground(),this.#F((t=>{const s=this.domElement;s&&s instanceof Node&&t.observe(s,{attributes:!0})})),this.initPlugins(),this.render.init()}initBackground(){const t=this.#t,s=t.actualOptions.background,i=this.domElement;if(!i)return;const h=i.style,o=zs(this.#s,s.color);h.backgroundColor=o?function(t,s,i){const h=i??k;return Cs(`rgb-${t.r.toFixed(2)}-${t.g.toFixed(2)}-${t.b.toFixed(2)}-${s?"hdr":"sdr"}-${h.toString()}`,(()=>s?Rs(t,i):function(t,s){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(s??k).toString()})`}(t,i)))}(o,t.hdr,s.opacity):"",h.backgroundImage=s.image||"",h.backgroundPosition=s.position||"",h.backgroundRepeat=s.repeat||"",h.backgroundSize=s.size||""}initPlugins(){this.#D=[];for(const t of this.#t.plugins)t.resize&&this.#D.push(t)}loadCanvas(t){this.#z&&this.domElement&&this.domElement.remove();const s=this.#t,i=(t=>"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)(t)?t:void 0;this.domElement=i,this.#z=!!i&&"true"===i.dataset[X],this.renderCanvas=i?(t=>{const s=Is.get(t);if(s)return s;if("function"!=typeof t.transferControlToOffscreen)throw new TypeError("OffscreenCanvas is required but not supported by this browser");try{const s=t.transferControlToOffscreen();return Is.set(t,s),s}catch{throw new TypeError("OffscreenCanvas transfer failed")}})(i):t;const h=this.domElement;h&&(h.ariaHidden="true",this.#S=N(h.style));const o=this.#$,e=this.renderCanvas;h?(o.height=h.offsetHeight,o.width=h.offsetWidth):(o.height=e.height,o.width=e.width);const n=this.#t.retina.pixelRatio,r=this.size;e.height=r.height=o.height*n,e.width=r.width=o.width*n;const a=_("(color-gamut: p3)");this.render.setContextSettings({alpha:!0,colorSpace:a?.matches&&s.hdr?"display-p3":"srgb",desynchronized:!0,willReadFrequently:!1}),this.render.setContext(e.getContext("2d",this.render.settings)),this.#F((t=>{t.disconnect()})),s.retina.init(),this.initBackground(),this.#F((t=>{const s=this.domElement;s&&s instanceof Node&&t.observe(s,{attributes:!0})}))}resize(){const t=this.domElement;if(!t)return!1;const s=this.#t,i=this.renderCanvas;if(void 0===i)return!1;const h=s.canvas.#$,o={width:t.offsetWidth,height:t.offsetHeight},e=s.retina.pixelRatio,n={width:o.width*e,height:o.height*e};if(o.height===h.height&&o.width===h.width&&n.height===i.height&&n.width===i.width)return!1;const r={...h};h.height=o.height,h.width=o.width;const a=this.size;return i.width=a.width=n.width,i.height=a.height=n.height,this.#t.started&&s.particles.setResizeFactor({width:h.width/r.width,height:h.height/r.height}),!0}setPointerEvents(t){this.domElement&&(this.#R=t,this.#B())}setZoom(t,s){this.zoom=t,this.#O=s}stop(){this.#F((t=>{t.disconnect()})),this.#k=void 0,this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#t,s=t.updateActualOptions();t.particles.setDensity(),this.#E(),s&&await t.refresh()}#E=()=>{for(const t of this.#D)t.resize?.()};#L=()=>{const t=this.domElement,s=this.#t.actualOptions;if(t){this.#T?this.#U():this.#I();for(const i in s.style){if(!i||!(i in s.style))continue;const h=s.style[i];h&&t.style.setProperty(i,h,"important")}}};#B=()=>{const t=this.domElement;if(!t)return;this.#F((t=>{t.disconnect()})),this.#L(),this.initBackground();const s=this.#R;t.style.pointerEvents=s,t.style.setProperty("pointer-events",s),this.#F((s=>{t instanceof Node&&s.observe(t,{attributes:!0})}))};#I=()=>{const t=this.domElement,s=this.#S;t&&s&&Fs(t,s,!0)};#F=t=>{this.#k&&t(this.#k)};#U=()=>{const t=this.domElement;t&&Fs(t,K(this.#t.actualOptions.fullScreen.zIndex),!0)}}class Ls{#t;#A;#q;#V;constructor(t){this.#t=t,this.#A={visibilityChange:()=>{this.#j()},resize:()=>{this.#Y()}}}addListeners(){this.#H(!0)}removeListeners(){this.#H(!1)}#j=()=>{const t=this.#t;t.actualOptions.pauseOnBlur&&(Z().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))};#Y=()=>{this.#V&&(clearTimeout(this.#V),this.#V=void 0);const t=async()=>{const t=this.#t.canvas;await t.windowResize()};this.#V=setTimeout((()=>{t()}),this.#t.actualOptions.resize.delay*G)};#H=t=>{const s=this.#A;this.#W(t),Q(document,J,s.visibilityChange,t,!1)};#W=t=>{const s=this.#A,i=this.#t;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void Q(globalThis,tt,s.resize,t);const h=i.canvas.domElement;this.#q&&!t?(h&&this.#q.unobserve(h),this.#q.disconnect(),this.#q=void 0):!this.#q&&t&&h&&(this.#q=new ResizeObserver((t=>{t.find((t=>t.target===h))&&this.#Y()})),this.#q.observe(h))}}function Es(t){if(!bt(t.outMode,t.checkModes))return;const s=t.radius*O;t.coord>t.maxCoord-s?t.setCb(-t.radius):t.coord<s&&t.setCb(t.radius)}class Us{backColor;bubble;destroyed;direction;effect;effectClose;effectData;fillColor;fillEnabled;fillOpacity;group;id;ignoresResizeRatio;initialPosition;initialVelocity;isRotating;justWarped;lastPathTime;misplaced;moveCenter;offset;opacity;options;outType;pathRotation;position;randomIndexData;retina;roll;rotation;shape;shapeClose;shapeData;sides;size;slow;spawning;strokeColor;strokeOpacity;strokeWidth;unbreakable;velocity;zIndexFactor;#X={fillOpacity:k,opacity:k,strokeOpacity:k};#N=st.origin;#_={sin:0,cos:0};#K={a:1,b:0,c:0,d:1};#t;#s;constructor(t,s){this.#s=t,this.#t=s}destroy(t){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const s=this.#t,i=this.shape?s.shapeDrawers.get(this.shape):void 0;i?.particleDestroy?.(this);for(const i of s.particleDestroyedPlugins)i.particleDestroyed?.(this,t);for(const i of s.particleUpdaters)i.particleDestroyed?.(this,t);this.#t.dispatchEvent(it.particleDestroyed,{particle:this})}draw(t){const s=this.#t.canvas.render;s.drawParticlePlugins(this,t),s.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:ht)}getFillColor(){return this.#Z(this.bubble.color??$s(this.fillColor))}getMass(){return this.getRadius()**i*Math.PI*R}getOpacity(){const t=(H-this.zIndexFactor)**this.options.zIndex.opacityRate,s=this.bubble.opacity??yt(this.opacity?.value??k),i=this.strokeOpacity??k;return this.#X.fillOpacity=s*(this.fillOpacity??k)*t,this.#X.opacity=s*t,this.#X.strokeOpacity=s*i*t,this.#X}getPosition(){return this.#N.x=this.position.x+this.offset.x,this.#N.y=this.position.y+this.offset.y,this.#N.z=this.position.z,this.#N}getRadius(){return this.bubble.radius??this.size.value}getRotateData(){const t=this.getAngle();return this.#_.sin=Math.sin(t),this.#_.cos=Math.cos(t),this.#_}getStrokeColor(){return this.#Z(this.bubble.color??$s(this.strokeColor))}getTransformData(t){const s=this.getRotateData(),i=this.isRotating;return this.#K.a=s.cos*(t.a??ot.a),this.#K.b=i?s.sin*(t.b??B):t.b??ot.b,this.#K.c=i?-s.sin*(t.c??B):t.c??ot.c,this.#K.d=s.cos*(t.d??ot.d),this.#K}init(t,s,i,h){const o=this.#t;this.id=t,this.group=h,this.justWarped=!1,this.effectClose=!0,this.shapeClose=!0,this.pathRotation=!1,this.lastPathTime=0,this.destroyed=!1,this.unbreakable=!1,this.isRotating=!1,this.rotation=0,this.misplaced=!1,this.retina={maxDistance:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},this.size={value:1,max:1,min:1,enable:!1},this.outType=et.normal,this.ignoresResizeRatio=!0;const e=ms(this.#s,o,o.actualOptions.particles),n=e.reduceDuplicates,r=e.shape.type;this.effect=nt(e.effect.type,this.id,n),this.shape=nt(r,this.id,n);const a=e.effect,c=e.shape;if(i){if(i.effect?.type&&i.effect.type!==this.effect){const t=nt(i.effect.type,this.id,n);t&&(this.effect=t,a.load(i.effect))}if(i.shape?.type&&i.shape.type!==this.shape){const t=nt(i.shape.type,this.id,n);t&&(this.shape=t,c.load(i.shape))}}if(this.effect===S){const t=[...this.#t.effectDrawers.keys()];this.effect=t[Math.floor(rt()*t.length)]}if(this.shape===S){const t=[...this.#t.shapeDrawers.keys()];this.shape=t[Math.floor(rt()*t.length)]}this.effectData=this.effect?function(t,s,i,h){return f({close:s.close},nt(s.options[t],i,h))}(this.effect,a,this.id,n):void 0,this.shapeData=this.shape?function(t,s,i,h){return f({close:s.close},nt(s.options[t],i,h))}(this.shape,c,this.id,n):void 0,e.load(i);const l=this.effectData,d=this.shapeData;l&&e.load(l.particles),d&&e.load(d.particles),this.effectClose=l?.close??e.effect.close,this.shapeClose=d?.close??e.shape.close,this.options=e,o.retina.initParticle(this);for(const t of o.particleUpdaters)t.preInit?.(this);let u,p;this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this.#G(s),this.initialVelocity=this.#Q(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/o.zLayers,this.sides=24,this.effect&&(u=o.effectDrawers.get(this.effect)),u?.loadEffect&&u.loadEffect(this),this.shape&&(p=o.shapeDrawers.get(this.shape)),p?.loadShape&&p.loadShape(this);const v=p?.getSidesCount;v&&(this.sides=v(this)),this.spawning=!1;for(const t of o.particleUpdaters)t.init(this);u?.particleInit?.(o,this),p?.particleInit?.(o,this);for(const t of o.particleCreatedPlugins)t.particleCreated?.(this)}isInsideCanvas(t){return this.#J({direction:t}).inside}isInsideCanvasForOutMode(t,s){return this.#J({direction:s,outMode:t}).inside}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const s=t%mt,i=s<ht?s+mt:s;return i>=Math.PI*R&&i<Math.PI*U*R}if(this.roll.horizontal){const s=(t+Math.PI*R)%(Math.PI*O),i=s<ht?s+Math.PI*O:s;return i>=Math.PI&&i<Math.PI*O}if(this.roll.vertical){const s=t%(Math.PI*O),i=s<ht?s+Math.PI*O:s;return i>=Math.PI&&i<Math.PI*O}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){for(const t of this.#t.particleUpdaters)t.reset?.(this)}#tt=(t,s)=>{let i=at,h=t?st.create(t.x,t.y,s):void 0;const o=this.#t,e=o.particlePositionPlugins,n=this.options.move.outModes,r=this.getRadius(),a=o.canvas.size,c=new AbortController,{signal:l}=c;for(;!l.aborted;){for(const t of e){const i=t.particlePosition?.(h,this);if(i)return st.create(i.x,i.y,s)}const t=Mt({size:a,position:h}),c=st.create(t.x,t.y,s);this.#st(c,r,n.left??n.default),this.#st(c,r,n.right??n.default),this.#it(c,r,n.top??n.default),this.#it(c,r,n.bottom??n.default);let l=!0;for(const t of o.particles.checkParticlePositionPlugins)if(l=t.checkParticlePosition?.(this,c,i)??!0,!l)break;if(l)return c;i+=ct,h=void 0}return h};#Q=()=>{const t=this.options.move,s=lt(this.direction).copy();if(t.direction===w.inside||t.direction===w.outside)return s;const i=Pt(yt(t.angle.value)),h=Pt(yt(t.angle.offset)),e={left:h-i*R,right:h+i*R};return t.straight||(s.angle+=dt(o(e.left,e.right))),t.random&&"number"==typeof t.speed&&(s.length*=rt()),s};#st=(t,s,i)=>{Es({outMode:i,checkModes:[v.bounce],coord:t.x,maxCoord:this.#t.canvas.size.width,setCb:s=>t.x+=s,radius:s})};#it=(t,s,i)=>{Es({outMode:i,checkModes:[v.bounce],coord:t.y,maxCoord:this.#t.canvas.size.height,setCb:s=>t.y+=s,radius:s})};#ht=(t,s)=>{const i=this.getRadius(),h=this.#t.canvas.size,o=this.position,e=s===v.bounce;return t===ut.bottom?{inside:e?o.y+i<h.height:o.y-i<h.height,reason:"default"}:t===ut.left?{inside:e?o.x-i>ht:o.x+i>ht,reason:"default"}:t===ut.right?{inside:e?o.x+i<h.width:o.x-i<h.width,reason:"default"}:t===ut.top?{inside:e?o.y-i>ht:o.y+i>ht,reason:"default"}:{inside:o.x>=-i&&o.y>=-i&&o.y<=h.height+i&&o.x<=h.width+i,reason:"default"}};#ot=(t,s)=>({canvasSize:this.#t.canvas.size,direction:t,outMode:s,particle:this,radius:this.getRadius()});#J=t=>{const s=this.#ht(t.direction,t.outMode),i=this.#t,h=this.shape?i.shapeDrawers.get(this.shape):void 0,o=this.effect?i.effectDrawers.get(this.effect):void 0,e=h?.isInsideCanvas,n=o?.isInsideCanvas;if(!e&&!n)return s;const r=this.#ot(t.direction,t.outMode),a=e?this.#et(e(r),"shape"):void 0,c=n?this.#et(n(r),"effect"):void 0;if(a&&c){const t=Math.max(a.margin??ht,c.margin??ht);return{inside:a.inside&&c.inside,margin:t>ht?t:void 0,reason:"combined"}}return a??c??s};#Z=t=>t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?function(t,s,i){return{h:t.h,s:t.s,l:t.l+(s===D.darken?-$:$)*i}}(t,this.roll.alter.type,this.roll.alter.value):t:t;#G=t=>{const s=this.#t,i=Math.floor(yt(this.options.zIndex.value)),h=this.#tt(t,ft(i,pt,s.zLayers));if(!h)throw new Error("a valid position cannot be found for particle");switch(this.position=h,this.initialPosition=this.position.copy(),this.moveCenter={...vt(this.options.move.center,s.canvas.size),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=wt(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case w.inside:this.outType=et.inside;break;case w.outside:this.outType=et.outside}this.offset=gt.origin};#et=(t,s)=>"boolean"==typeof t?{inside:t,reason:s}:{inside:t.inside,margin:t.margin,reason:t.reason??s}}class As{#nt;#rt=new Map;#at=[];#ct;#lt;#dt=[];#ut;constructor(t){this.#nt=t,this.#ct=0,this.#ut=0}clear(){this.#rt.clear();const t=this.#lt;t&&(this.#nt=t),this.#lt=void 0}insert(t){const{x:s,y:i}=t.getPosition(),h=this.#ft(s,i);this.#rt.has(h)||this.#rt.set(h,[]),this.#rt.get(h)?.push(t)}query(t,s,i=[]){const h=this.#pt(t);if(!h)return i;const o=Math.floor(h.minX/this.#nt),e=Math.floor(h.maxX/this.#nt),n=Math.floor(h.minY/this.#nt),r=Math.floor(h.maxY/this.#nt);for(let h=o;h<=e;h++)for(let o=n;o<=r;o++){const e=this.#rt.get(`${h}_${o}`);if(e)for(const h of e)s&&!s(h)||t.contains(h.getPosition())&&i.push(h)}return i}queryCircle(t,s,i,h=[]){const o=this.#vt(t.x,t.y,s),e=this.query(o,i,h);return this.#wt(),e}queryRectangle(t,s,i,h=[]){const o=this.#gt(t.x,t.y,s.width,s.height),e=this.query(o,i,h);return this.#wt(),e}setCellSize(t){this.#lt=t}#vt(t,s,i){return(this.#at[this.#ct++]??=new jt(t,s,i)).reset(t,s,i)}#gt(t,s,i,h){return(this.#dt[this.#ut++]??=new Yt(t,s,i,h)).reset(t,s,i,h)}#ft(t,s){return`${Math.floor(t/this.#nt)}_${Math.floor(s/this.#nt)}`}#pt(t){if(t instanceof jt){const s=t.radius,{x:i,y:h}=t.position;return{minX:i-s,maxX:i+s,minY:h-s,maxY:h+s}}if(t instanceof Yt){const{x:s,y:i}=t.position,{width:h,height:o}=t.size;return{minX:s,maxX:s+h,minY:i,maxY:i+o}}return null}#wt(){this.#ct=0,this.#ut=0}}class qs{checkParticlePositionPlugins;grid;#yt;#t;#mt;#Mt;#bt;#Pt;#xt;#Ct;#s;#zt;#kt;#St;#Rt;#Dt;#$t;constructor(t,s){this.#s=t,this.#t=s,this.#bt=0,this.#yt=[],this.#zt=[],this.#Mt=0,this.#mt=new Map,this.#Pt=new Map,this.#$t=this.#Ot(this.#t.zLayers),this.grid=new As(xt),this.checkParticlePositionPlugins=[],this.#xt=[],this.#Ct=[],this.#St=[],this.#kt=[],this.#Dt=[]}get count(){return this.#yt.length}addParticle(t,s,i,h){const o=this.#t.actualOptions.particles.number.limit.mode,e=void 0===i?this.#Mt:this.#mt.get(i)??this.#Mt,n=this.count;if(e>Ct)switch(o){case m.delete:{const t=n+Tt-e;t>zt&&this.removeQuantity(t);break}case m.wait:if(n>=e)return}try{const o=this.#zt.pop()??new Us(this.#s,this.#t);o.init(this.#bt,t,s,i);let e=!0;return h&&(e=h(o)),e?(this.#yt.push(o),this.#Tt(o),this.#bt++,this.#t.dispatchEvent(it.particleAdded,{particle:o}),o):void this.#zt.push(o)}catch(t){kt().warning(`error adding particle: ${t}`)}}clear(){this.#yt=[],this.#Pt.clear(),this.#It(this.#t.zLayers)}destroy(){this.#yt=[],this.#zt.length=0,this.#Pt.clear(),this.#$t=[],this.checkParticlePositionPlugins=[],this.#xt=[],this.#Ct=[],this.#St=[],this.#kt=[],this.#Dt=[]}drawParticles(t){for(let s=this.#$t.length-It;s>=St;s--){const i=this.#$t[s];if(i)for(const s of i)s.draw(t)}}filter(t){return this.#yt.filter(t)}find(t){return this.#yt.find(t)}get(t){return this.#yt[t]}async init(){const t=this.#t,s=t.actualOptions;this.checkParticlePositionPlugins=[],this.#Dt=[],this.#Ct=[],this.#St=[],this.#xt=[],this.#kt=[],this.#Pt.clear(),this.#It(t.zLayers),this.grid=new As(xt*t.retina.pixelRatio);for(const s of t.plugins)s.redrawInit&&await s.redrawInit(),s.checkParticlePosition&&this.checkParticlePositionPlugins.push(s),s.update&&this.#Dt.push(s),s.particleUpdate&&this.#Ct.push(s),s.postUpdate&&this.#St.push(s),s.particleReset&&this.#xt.push(s),s.postParticleUpdate&&this.#kt.push(s);await this.#t.initDrawersAndUpdaters();for(const s of this.#t.effectDrawers.values())await(s.init?.(t));for(const s of this.#t.shapeDrawers.values())await(s.init?.(t));let i=!1;for(const s of t.plugins)if(i=s.particlesInitialization?.()??i,i)break;if(!i){const t=s.particles,i=t.groups;for(const s in i){const h=i[s];if(h)for(let i=this.count,o=0;o<h.number.value&&i<t.number.value;i++,o++)this.addParticle(void 0,h,s)}for(let s=this.count;s<t.number.value;s++)this.addParticle()}}push(t,s,i,h){for(let o=0;o<t;o++)this.addParticle(s,i,h)}async redraw(){this.clear(),await this.init(),this.#t.canvas.render.drawParticles({value:0,factor:0})}remove(t,s,i){this.removeAt(this.#yt.indexOf(t),void 0,s,i)}removeAt(t,s=Rt,i,h){if(t<St||t>this.count)return;let o=0;for(let e=t;o<s&&e<this.count;e++)this.#Ft(e,i,h)&&(e--,o++)}removeQuantity(t,s){this.removeAt(St,t,s)}setDensity(){const t=this.#t.actualOptions,s=t.particles.groups;let i=0;for(const t of this.#t.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in s){const h=s[t];if(!h)continue;const o=ms(this.#s,this.#t,h);this.#Bt(o,i,t)}this.#Bt(t.particles,i)}setResizeFactor(t){this.#Rt=t}update(t){this.grid.clear();for(const s of this.#Dt)s.update?.(t);const s=this.#Lt(t);for(const s of this.#St)s.postUpdate?.(t);if(this.#Et(t,s),s.size)for(const t of s)this.remove(t);this.#Rt=void 0}#Ut=(...t)=>{this.#zt.push(...t)};#Bt=(t,s,i,h)=>{const o=t.number;if(!o.density.enable)return void(void 0===i?this.#Mt=o.limit.value:(h?.number.limit.value??o.limit.value)&&this.#mt.set(i,h?.number.limit.value??o.limit.value));const e=this.#At(o.density),n=o.value,r=Math.min(n,o.limit.value>Ct?o.limit.value:n)*e+s,a=Math.min(this.count,this.filter((t=>t.group===i)).length);void 0===i?this.#Mt=o.limit.value*e:this.#mt.set(i,o.limit.value*e),a<r?this.push(Math.abs(r-a),void 0,t,i):a>r&&this.removeQuantity(a-r,i)};#Ot=t=>{const s=Math.max(Math.floor(t),It);return Array.from({length:s},(()=>[]))};#qt=t=>{const s=this.#$t.length-It;return s<=St?St:Math.min(Math.max(Math.floor(t),St),s)};#Vt=(t,s)=>{let i=St,h=t.length;for(;i<h;){const o=Math.floor((i+h)/O),e=t[o];e&&e.id<s?i=o+It:h=o}return i};#At=t=>{const s=this.#t;if(!t.enable)return Dt;const h=s.canvas.size;return h.width&&h.height?h.width*h.height/(t.height*t.width*s.retina.pixelRatio**i):Dt};#Tt=t=>{const s=this.#qt(t.position.z),i=this.#$t[s];i&&(i.splice(this.#Vt(i,t.id),$t,t),this.#Pt.set(t.id,s))};#Ft=(t,s,i)=>{const h=this.#yt[t];return!!h&&h.group===s&&(this.#yt.splice(t,Ot),this.#jt(h),h.destroy(i),this.#t.dispatchEvent(it.particleRemoved,{particle:h}),this.#Ut(h),!0)};#jt=t=>{const s=this.#Pt.get(t.id)??this.#qt(t.position.z),i=this.#$t[s];if(!i)return void this.#Pt.delete(t.id);const h=this.#Vt(i,t.id);i[h]?.id===t.id?(i.splice(h,Ot),this.#Pt.delete(t.id)):this.#Pt.delete(t.id)};#It=t=>{const s=Math.max(Math.floor(t),It);if(this.#$t.length===s)for(const t of this.#$t)t.length=St;else this.#$t=this.#Ot(s)};#Yt=t=>{const s=this.#qt(t.position.z),i=this.#Pt.get(t.id);if(void 0===i)return void this.#Tt(t);if(i===s)return;const h=this.#$t[i];if(h){const s=this.#Vt(h,t.id);h[s]?.id===t.id&&h.splice(s,Ot)}const o=this.#$t[s];o?(o.splice(this.#Vt(o,t.id),$t,t),this.#Pt.set(t.id,s)):this.#Pt.set(t.id,s)};#Lt=t=>{const s=new Set,i=this.#Rt;for(const h of this.#yt){i&&!h.ignoresResizeRatio&&(h.position.x*=i.width,h.position.y*=i.height,h.initialPosition.x*=i.width,h.initialPosition.y*=i.height),h.ignoresResizeRatio=!1;for(const t of this.#xt)t.particleReset?.(h);for(const s of this.#Ct){if(h.destroyed)break;s.particleUpdate?.(h,t)}h.destroyed?s.add(h):this.grid.insert(h)}return s};#Et=(t,s)=>{for(const i of this.#yt)if(i.destroyed)s.add(i);else{for(const s of this.#t.particleUpdaters)s.update(i,t);if(!i.spawning)for(const s of this.#kt)s.postParticleUpdate?.(i,t);this.#Yt(i)}}}class Vs{pixelRatio;reduceFactor;#t;constructor(t){this.#t=t,this.pixelRatio=Ft,this.reduceFactor=Bt}init(){const t=this.#t;this.pixelRatio=t.actualOptions.detectRetina?devicePixelRatio:Ft,this.reduceFactor=Bt;const s=this.pixelRatio,i=t.canvas,h=i.domElement;h&&(i.size.width=h.offsetWidth*s,i.size.height=h.offsetHeight*s)}initParticle(t){const s=this.pixelRatio,i=t.options.move,h=i.distance,o=t.retina;o.maxSpeed=yt(i.gravity.maxSpeed)*s,o.moveDrift=yt(i.drift)*s,o.moveSpeed=yt(i.speed)*s;const e=o.maxDistance;e.horizontal=void 0===h.horizontal?void 0:h.horizontal*s,e.vertical=void 0===h.vertical?void 0:h.vertical*s}}function js(t){return!t.destroyed}function Ys(t,s,...i){const h=new Ms(t,s);return ys(h,...i),h}class Hs{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;id;pageHidden;particleCreatedPlugins;particleDestroyedPlugins;particlePositionPlugins;particleUpdaters;particles;plugins;retina;shapeDrawers;started;zLayers;#Ht;#Wt;#Xt={value:0,factor:0};#Nt;#_t;#Kt;#Zt;#Gt;#Qt;#Jt;#ts;#ss;#is;#hs;#s;#os;#es;constructor(t){const{dispatchCallback:s,pluginManager:i,id:h,onDestroy:o,sourceOptions:e}=t;this.#s=i,this.#Nt=s,this.#ss=o,this.id=Symbol(h),this.fpsLimit=120,this.hdr=!1,this.#os=!1,this.#Ht=0,this.#Kt=0,this.#ts=0,this.#Gt=!0,this.started=!1,this.destroyed=!1,this.#hs=!0,this.#Jt=0,this.zLayers=100,this.pageHidden=!1,this.#es=e,this.#Qt=e,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new Vs(this),this.canvas=new Bs(this.#s,this),this.particles=new qs(this.#s,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this.#is=Ys(this.#s,this),this.actualOptions=Ys(this.#s,this),this.#Zt=new Ls(this),this.dispatchEvent(it.containerBuilt)}get animationStatus(){return!this.#hs&&!this.pageHidden&&js(this)}get options(){return this.#is}get sourceOptions(){return this.#es}addLifeTime(t){this.#ts+=t}alive(){return!this.#Kt||this.#ts<=this.#Kt}destroy(t=!0){if(js(this)){this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,t]of this.effectDrawers)t.destroy?.(this);for(const[,t]of this.shapeDrawers)t.destroy?.(this);for(const t of this.plugins)t.destroy?.();this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.plugins.length=0,this.#s.clearPlugins(this),this.destroyed=!0,this.#ss(t),this.dispatchEvent(it.containerDestroyed)}}dispatchEvent(t,s){this.#Nt(t,{container:this,data:s})}draw(t){if(!js(this))return;let s=t;this.#_t=Lt((t=>{s&&(this.#Jt=void 0,s=!1),this.#ns(t)}))}async export(t,s={}){for(const i of this.plugins){if(!i.export)continue;const h=await i.export(t,s);if(h.supported)return h.blob}kt().error(`Export plugin with type ${t} not found`)}async init(){if(!js(this))return;const t=new Map;for(const s of this.#s.plugins){const i=await s.getPlugin(this);i.preInit&&await i.preInit(),t.set(s,i)}await this.initDrawersAndUpdaters(),this.#is=Ys(this.#s,this,this.#Qt,this.sourceOptions),this.actualOptions=Ys(this.#s,this,this.#is),this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[s,i]of t)s.needsPlugin(this.actualOptions)&&(this.plugins.push(i),i.particleCreated&&this.particleCreatedPlugins.push(i),i.particleDestroyed&&this.particleDestroyedPlugins.push(i),i.particlePosition&&this.particlePositionPlugins.push(i));this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:s,duration:i,fpsLimit:h,hdr:o,smooth:e,zLayers:n}=this.actualOptions;this.hdr=o,this.zLayers=n,this.#Kt=yt(i)*G,this.#Ht=yt(s)*G,this.#ts=0,this.fpsLimit=h>Ut?h:Et,this.#os=e;for(const t of this.plugins)await(t.init?.());await this.particles.init(),this.dispatchEvent(it.containerInit),this.particles.setDensity();for(const t of this.plugins)t.particlesSetup?.();this.dispatchEvent(it.particlesSetup)}async initDrawersAndUpdaters(){const t=this.#s;this.effectDrawers=await t.getEffectDrawers(this,!0),this.shapeDrawers=await t.getShapeDrawers(this,!0),this.particleUpdaters=await t.getUpdaters(this,!0)}pause(){if(js(this)&&(void 0!==this.#_t&&(At(this.#_t),this.#_t=void 0),!this.#hs)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this.#hs=!0),this.dispatchEvent(it.containerPaused)}}play(t){if(!js(this))return;const s=this.#hs||t;if(!this.#Gt||this.actualOptions.autoPlay){if(this.#hs&&(this.#hs=!1),s)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(it.containerPlay),this.draw(s??!1)}else this.#Gt=!1}async refresh(){if(js(this))return this.stop(),this.start()}async reset(t){if(js(this))return this.#Qt=t,this.#es=t,this.#is=Ys(this.#s,this,this.#Qt,this.sourceOptions),this.actualOptions=Ys(this.#s,this,this.#is),this.refresh()}async start(){js(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise((t=>{const s=async()=>{this.#Zt.addListeners();for(const t of this.plugins)await(t.start?.());this.dispatchEvent(it.containerStarted),this.play(),t()};this.#Wt=setTimeout((()=>{s()}),this.#Ht)})))}stop(){if(js(this)&&this.started){this.#Wt&&(clearTimeout(this.#Wt),this.#Wt=void 0),this.#Gt=!0,this.started=!1,this.#Zt.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop();for(const t of this.plugins)t.stop?.();this.particleCreatedPlugins.length=0,this.particleDestroyedPlugins.length=0,this.particlePositionPlugins.length=0,this.#es=this.#is,this.dispatchEvent(it.containerStopped)}}updateActualOptions(){let t=!1;for(const s of this.plugins)s.updateActualOptions&&(t=s.updateActualOptions()||t);return t}#ns=t=>{try{if(!this.#os&&void 0!==this.#Jt&&t<this.#Jt+G/this.fpsLimit)return void this.draw(!1);if(this.#Jt??=t,function(t,s,i=qt,h=!1){t.value=s,t.factor=h?qt/i:qt*s/G}(this.#Xt,t-this.#Jt,this.fpsLimit,this.#os),this.addLifeTime(this.#Xt.value),this.#Jt=t,this.#Xt.value>G)return void this.draw(!1);if(this.canvas.render.drawParticles(this.#Xt),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){kt().error("error in animation loop",t)}}}export{Hs as Container}
|