UNPKG

@tsparticles/engine

Version:

Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.

2 lines 74.9 kB
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{}))}(this,function(t){"use strict";const e=t=>(...e)=>{t(...e)},i={debug:e(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:e(console.info),log:e(console.log),trace:e(console.trace),verbose:e(console.log),warning:e(console.warn)};function s(t){t.debug&&(i.debug=e(t.debug)),t.error&&(i.error=e(t.error)),t.info&&(i.info=e(t.info)),t.log&&(i.log=e(t.log)),t.trace&&(i.trace=e(t.trace)),t.verbose&&(i.verbose=e(t.verbose)),t.warning&&(i.warning=e(t.warning))}function n(){return i}var a;t.MoveDirection=void 0,(a=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",a.bottomLeft="bottom-left",a.bottomRight="bottom-right",a.left="left",a.none="none",a.right="right",a.top="top",a.topLeft="top-left",a.topRight="top-right",a.outside="outside",a.inside="inside";const r="generated",o="source-over",l="resize",c="visibilitychange",h=100,d=.5,u=1e3,p={x:0,y:0,z:0},f={a:1,b:0,c:0,d:1},g="random",m="mid",y=2*Math.PI,v="true",P="false",w="canvas",b=255,M=360,x=100,z=100,S=.25,C=.75,k=400;function D(t){return"z"in t?t.z:p.z}class I{x;y;z;constructor(t=p.x,e=p.y,i=p.z){this.x=t,this.y=e,this.z=i}static get origin(){return I.create(p.x,p.y,p.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 I.create(t.x,t.y,D(t))}static create(t,e,i){return"number"==typeof t?new I(t,e??p.y,i??p.z):new I(t.x,t.y,D(t))}add(t){return I.create(this.x+t.x,this.y+t.y,this.z+D(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=D(t)}copy(){return I.clone(this)}div(t){return I.create(this.x/t,this.y/t,this.z/t)}getLengthSq(){return this.x**2+this.y**2}mult(t){return I.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 I.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),p.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=D(t)}sub(t){return I.create(this.x-t.x,this.y-t.y,this.z-D(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=D(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class O extends I{constructor(t=p.x,e=p.y){super(t,e,p.z)}static get origin(){return O.create(p.x,p.y)}static clone(t){return O.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new O(t,e??p.y):new O(t.x,t.y)}}function L(t){return"boolean"==typeof t}function R(t){return"string"==typeof t}function _(t){return"number"==typeof t}function T(t){return"object"==typeof t&&null!==t}function E(t){return Array.isArray(t)}function F(t){return null==t}const A=Math.PI/180;let B=Math.random;const H={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function U(t=Math.random){B=t}function V(){return B}function $(){return j(B(),0,1-Number.EPSILON)}function N(t,e){return $()*(e-t)+t}function q(t){return H.nextFrame(t)}function W(t){H.cancel(t)}function j(t,e,i){return Math.min(Math.max(t,e),i)}function X(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function Y(t){const e=Z(t);let i=Q(t);return e===i&&(i=0),N(i,e)}function G(t){return _(t)?t:Y(t)}function Q(t){return _(t)?t:t.min}function Z(t){return _(t)?t:t.max}function K(t,e){if(t===e||void 0===e&&_(t))return t;const i=Q(t),s=Z(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:K(i,s)}function J(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}}function tt(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function et(t,e,i){return tt(t,e)<=i*i}function it(t){return t*A}function st(e,i,s){if(_(e))return it(e);switch(e){case t.MoveDirection.top:return-Math.PI*d;case t.MoveDirection.topRight:return-Math.PI*S;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*S;case t.MoveDirection.bottom:return Math.PI*d;case t.MoveDirection.bottomLeft:return Math.PI*C;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*C;case t.MoveDirection.inside:return Math.atan2(s.y-i.y,s.x-i.x);case t.MoveDirection.outside:return Math.atan2(i.y-s.y,i.x-s.x);default:return $()*y}}function nt(t){const e=O.origin;return e.length=1,e.angle=t,e}function at(t,e,i,s){return O.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function rt(t){return{x:(t.position?.x??$()*h)*t.size.width/h,y:(t.position?.y??$()*h)*t.size.height/h}}function ot(t){const{position:e,size:i}=t;return{x:e?.x??$()*i.width,y:e?.y??$()*i.height}}var lt,ct;t.OutModeDirection=void 0,(lt=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",lt.left="left",lt.right="right",lt.top="top",t.PixelMode=void 0,(ct=t.PixelMode||(t.PixelMode={})).precise="precise",ct.percent="percent";function ht(t){return"__proto__"===t||"constructor"===t||"prototype"===t}function dt(){return globalThis.document}function ut(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function pt(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function ft(t,e){return t===e||E(e)&&e.includes(t)}function gt(t,e,i=!0){return t[void 0!==e&&i?e%t.length:Math.floor($()*t.length)]}function mt(e,i,s,n){let a=!0;return n&&n!==t.OutModeDirection.bottom||(a=e.top<i.height+s.x),!a||n&&n!==t.OutModeDirection.left||(a=e.right>s.x),!a||n&&n!==t.OutModeDirection.right||(a=e.left<i.width+s.y),!a||n&&n!==t.OutModeDirection.top||(a=e.bottom>s.y),a}function yt(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function vt(t,...e){for(const i of e){if(F(i))continue;if(!T(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):T(t)&&!Array.isArray(t)||(t=Object.create(null));const e=Object.keys(i);if(!e.some(t=>{const e=i[t];return T(e)||Array.isArray(e)})){const s=i,n=t;for(const t of e){if(ht(t))continue;const e=s[t];void 0!==e&&(n[t]=e)}continue}for(const s of e){if(ht(s))continue;const e=t,n=i[s];e[s]=Array.isArray(n)?n.map(t=>vt(void 0,t)):vt(e[s],n)}}return t}function Pt(t,e){return E(t)?t.map((t,i)=>e(t,i)):e(t,0)}function wt(t,e,i){return E(t)?gt(t,e,i):t}function bt(e,i){return function(e,i){if(e.mode!==t.PixelMode.percent){const{mode:t,...i}=e;return i}return"x"in e?{x:e.x/h*i.width,y:e.y/h*i.height}:{width:e.width/h*i.width,height:e.height/h*i.height}}(e,i)}function Mt(t){const e=dt().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||F(s))continue;const n=t.getPropertyValue?.(s);if(!n)continue;const a=t.getPropertyPriority?.(s);a?e.setProperty(s,n,a):e.setProperty(s,n)}return e}let xt,zt;function St(t){if(xt!==t||!zt){xt=t;const e=dt().createElement("div").style,i=10,s={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(i),"z-index":t.toString(i),top:"0",left:"0","pointer-events":"none"};for(const t in s){const i=s[t];void 0!==i&&e.setProperty(t,i)}zt=e}return zt}function Ct(t,e,i,s,n){if(s){let s={passive:!0};L(n)?s.capture=n:void 0!==n&&(s=n),t.addEventListener(e,i,s)}else{const s=n;t.removeEventListener(e,i,s)}}async function kt(t,e,i,s=!1){let n=e.get(t);return n&&!s||(n=await Promise.all([...i.values()].map(e=>e(t))),e.set(t,n)),n}async function Dt(t,e,i,s=!1){let n=e.get(t);if(!n||s){const s=await Promise.all([...i.entries()].map(([e,i])=>i(t).then(t=>[e,t])));n=new Map(s),e.set(t,n)}return n}class It{#e;constructor(){this.#e=new Map}addEventListener(t,e){this.removeEventListener(t,e);let i=this.#e.get(t);i||(i=[],this.#e.set(t,i)),i.push(e)}dispatchEvent(t,e){const i=this.#e.get(t);i?.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 i=this.#e.get(t);if(!i)return;const s=i.length,n=i.indexOf(e);n<0||(1===s?this.#e.delete(t):i.splice(n,1))}}var Ot;t.EventType=void 0,(Ot=t.EventType||(t.EventType={})).configAdded="configAdded",Ot.containerInit="containerInit",Ot.particlesSetup="particlesSetup",Ot.containerStarted="containerStarted",Ot.containerStopped="containerStopped",Ot.containerDestroyed="containerDestroyed",Ot.containerPaused="containerPaused",Ot.containerPlay="containerPlay",Ot.containerBuilt="containerBuilt",Ot.particleAdded="particleAdded",Ot.particleDestroyed="particleDestroyed",Ot.particleRemoved="particleRemoved";class Lt{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;#i=new Set;#s=new Map;#n;#a=new Set;#r=!1;#o=!1;#l=new Set;constructor(t){this.#n=t}get configs(){const t={};for(const[e,i]of this.#s)t[e]=i;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(e){const i=e.key??e.name??"default";this.#s.set(i,e),this.#n.dispatchEvent(t.EventType.configAdded,{data:{name:i,config:e}})}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,i=!1){!i&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){for(const i of t)this.initializers.shapes.set(i,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 Dt(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 Dt(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return kt(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this.#r&&!this.#o){this.#o=!0,this.#a=new Set,this.#i=new Set(this.#l);try{for(const t of this.#i)await this.#c(t,this.#a,this.#i)}finally{this.#l.clear(),this.#o=!1,this.#r=!0}}}loadParticlesOptions(t,e,...i){const s=this.updaters.get(t);s&&s.forEach(t=>t.loadOptions?.(e,...i))}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.#c(e,this.#a,this.#i):this.#l.add(e)}async#c(t,e,i){e.has(t)||(e.add(t),i.add(t),await t(this.#n))}}const Rt="100%";class _t{pluginManager=new Lt(this);#h=[];#d=new It;#r=!1;get items(){return this.#h}get version(){return"4.4.0"}addEventListener(t,e){this.#d.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.#d.dispatchEvent(t,e)}async init(){this.#r||(await this.pluginManager.init(),this.#r=!0)}item(t){const e=this.items,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){let e;await this.init(),"undefined"!=typeof HTMLElement&&t.element instanceof HTMLElement&&(e=t.element);const{Container:i}=await Promise.resolve().then(function(){return Si}),s=t.id??e?.id??`tsparticles${Math.floor(1e4*$()).toString()}`,{index:a,url:o}=t,l=o?await async function(t){const e=wt(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(n().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:o,index:a}):t.options,c=wt(l,a),{items:h}=this,d=h.findIndex(t=>t.id.description===s),u=new i({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:s,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(u);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:c});if(d>=0){const t=this.item(d),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),h.splice(d,e,u)}else h.push(u);const p="undefined"!=typeof OffscreenCanvas&&t.element instanceof OffscreenCanvas?t.element:(t=>{const e=dt();let i;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===w)i=t,i.dataset[r]??=P,i.dataset[r]===v&&(i.style.width||=Rt,i.style.height||=Rt,i.style.pointerEvents="none",i.style.setProperty("pointer-events","none"));else{const s=t.getElementsByTagName(w).item(0);s?(i=s,i.dataset[r]=P):(i=e.createElement(w),i.dataset[r]=v,t.appendChild(i)),i.style.width||=Rt,i.style.height||=Rt,i.style.pointerEvents="none",i.style.setProperty("pointer-events","none")}return i})(((t,e)=>{const i=dt();let s=e??i.getElementById(t);return s||(s=i.createElement("canvas"),s.id=t,s.dataset[r]=v,i.body.append(s),s)})(s,e));return u.canvas.loadCanvas(p),await u.start(),u}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this.#d.removeEventListener(t,e)}}var Tt,Et,Ft,At,Bt,Ht,Ut,Vt,$t,Nt,qt,Wt,jt;!function(t){t.circle="circle",t.rectangle="rectangle"}(Tt||(Tt={}));class Xt{position;type;constructor(t,e,i){this.position={x:t,y:e},this.type=i}_resetPosition(t,e){this.position.x=t,this.position.y=e}}class Yt extends Xt{radius;constructor(t,e,i){super(t,e,Tt.circle),this.radius=i}contains(t){return et(t,this.position,this.radius)}intersects(t){const e=this.position,i=t.position,s=this.radius,n=Math.abs(i.x-e.x),a=Math.abs(i.y-e.y);if(t instanceof Yt||t.type===Tt.circle){return s+t.radius>Math.hypot(n,a)}if(t instanceof Gt||t.type===Tt.rectangle){const e=t,{width:i,height:r}=e.size;return Math.pow(n-i,2)+Math.pow(a-r,2)<=s**2||n<=s+i&&a<=s+r||n<=i||a<=r}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class Gt extends Xt{size;constructor(t,e,i,s){super(t,e,Tt.rectangle),this.size={height:s,width:i}}contains(t){const e=this.size.width,i=this.size.height,s=this.position;return t.x>=s.x&&t.x<=s.x+e&&t.y>=s.y&&t.y<=s.y+i}intersects(t){if(t instanceof Yt)return t.intersects(this);if(!(t instanceof Gt))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,a=t.size,r=a.width,o=a.height;return n.x<s.x+e&&n.x+r>s.x&&n.y<s.y+i&&n.y+o>s.y}reset(t,e,i,s){return this._resetPosition(t,e),this.size.width=i,this.size.height=s,this}}t.RotateDirection=void 0,(Et=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",Et.counterClockwise="counter-clockwise",Et.random="random",t.AnimationMode=void 0,(Ft=t.AnimationMode||(t.AnimationMode={})).auto="auto",Ft.increase="increase",Ft.decrease="decrease",Ft.random="random",t.HdrMode=void 0,(At=t.HdrMode||(t.HdrMode={})).standard="standard",At.natural="natural",At.vivid="vivid",At.cinematic="cinematic",At.dynamic="dynamic",t.LimitMode=void 0,(Bt=t.LimitMode||(t.LimitMode={})).delete="delete",Bt.wait="wait",t.OutMode=void 0,(Ht=t.OutMode||(t.OutMode={})).bounce="bounce",Ht.none="none",Ht.out="out",Ht.destroy="destroy",Ht.split="split",t.AlterType=void 0,(Ut=t.AlterType||(t.AlterType={})).darken="darken",Ut.enlighten="enlighten",t.DestroyType=void 0,(Vt=t.DestroyType||(t.DestroyType={})).none="none",Vt.max="max",Vt.min="min",t.GradientType=void 0,($t=t.GradientType||(t.GradientType={})).linear="linear",$t.radial="radial",$t.random="random",t.ParticleOutType=void 0,(Nt=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",Nt.inside="inside",Nt.outside="outside",t.StartValueType=void 0,(qt=t.StartValueType||(t.StartValueType={})).max="max",qt.min="min",qt.random="random",t.AnimationStatus=void 0,(Wt=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",Wt.decreasing="decreasing",t.DrawLayer=void 0,(jt=t.DrawLayer||(t.DrawLayer={}))[jt.BackgroundElement=0]="BackgroundElement",jt[jt.BackgroundDraw=1]="BackgroundDraw",jt[jt.BackgroundMask=2]="BackgroundMask",jt[jt.CanvasSetup=3]="CanvasSetup",jt[jt.PluginContent=4]="PluginContent",jt[jt.Particles=5]="Particles",jt[jt.CanvasCleanup=6]="CanvasCleanup",jt[jt.Foreground=7]="Foreground";class Qt{load(t){F(t)||this.doLoad(t)}}function Zt(t,...e){for(const i of e)t.load(i)}function Kt(t,e,i){void 0!==i&&(t[e]=i)}function Jt(t,e,i){void 0!==i&&(t[e]=K(i))}function te(t,e,i){void 0!==i&&t[e].load(i)}function ee(t,e,i,s){if(void 0!==i){const n=t;n[e]??=s(),n[e].load(i)}}class ie extends Qt{count=0;decay=0;delay=0;enable=!1;speed=1;sync=!1;doLoad(t){Jt(this,"count",t.count),Kt(this,"enable",t.enable),Jt(this,"speed",t.speed),Jt(this,"decay",t.decay),Jt(this,"delay",t.delay),Kt(this,"sync",t.sync)}}class se extends ie{mode=t.AnimationMode.auto;startValue=t.StartValueType.random;doLoad(t){super.doLoad(t),Kt(this,"mode",t.mode),Kt(this,"startValue",t.startValue)}}class ne extends ie{max;min;offset=0;sync=!0;constructor(t,e){super(),this.min=t,this.max=e}doLoad(t){super.doLoad(t),Kt(this,"max",t.max),Kt(this,"min",t.min),Jt(this,"offset",t.offset)}}class ae extends Qt{h=new ne(0,M);l=new ne(0,z);s=new ne(0,x);doLoad(t){this.h.load(t.h),this.s.load(t.s),this.l.load(t.l)}}class re extends Qt{value="";static create(t,e){const i=new re;return i.load(t),void 0!==e&&(R(e)||E(e)?i.load({value:e}):i.load(e)),i}doLoad(t){F(t.value)||(this.value=t.value)}}class oe extends re{animation=new ae;static create(t,e){const i=new oe;return i.load(t),void 0!==e&&(R(e)||E(e)?i.load({value:e}):i.load(e)),i}doLoad(t){super.doLoad(t);const e=t.animation;void 0!==e&&(void 0===e.enable?this.animation.load(t.animation):this.animation.h.load(e))}}class le extends Qt{color;draw;element;image="";opacity=1;position="";repeat="";size="";constructor(){super(),this.color=new re,this.color.value=""}doLoad(t){void 0!==t.color&&(this.color=re.create(this.color,t.color)),Kt(this,"element",t.element),Kt(this,"draw",t.draw),Kt(this,"image",t.image),Kt(this,"position",t.position),Kt(this,"repeat",t.repeat),Kt(this,"size",t.size),Kt(this,"opacity",t.opacity)}}class ce extends Qt{enable=!0;zIndex=0;doLoad(t){Kt(this,"enable",t.enable),Kt(this,"zIndex",t.zIndex)}}class he extends Qt{enable=!0;mode=t.HdrMode.standard;peakNits=400;doLoad(e){if(void 0!==e.enable&&!L(e.enable))throw new Error(`Invalid HDR "enable" value: expected a boolean, got "${String(e.enable)}"`);if(void 0!==e.mode&&("string"!=typeof e.mode||!Object.values(t.HdrMode).includes(e.mode)))throw new Error(`Invalid HDR "mode" value: expected one of ${Object.values(t.HdrMode).join(", ")}, got "${i=e.mode,String(i)}"`);var i;if(void 0!==e.peakNits&&(!_(e.peakNits)||!Number.isFinite(e.peakNits)||e.peakNits<=0))throw new Error(`Invalid HDR "peakNits" value: expected a positive number, got "${String(e.peakNits)}"`);Kt(this,"enable",e.enable),Kt(this,"mode",e.mode),Kt(this,"peakNits",e.peakNits)}}class de extends Qt{delay=.5;enable=!0;doLoad(t){Kt(this,"delay",t.delay),Kt(this,"enable",t.enable)}}class ue extends Qt{close=!0;options={};type=[];doLoad(t){const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=vt(this.options[t]??{},i))}Kt(this,"close",t.close),Kt(this,"type",t.type)}}class pe extends Qt{color;enable=!0;opacity=1;doLoad(t){void 0!==t.color&&(this.color=oe.create(this.color,t.color)),Kt(this,"enable",t.enable),Jt(this,"opacity",t.opacity)}}class fe extends Qt{offset=0;value=90;doLoad(t){Jt(this,"offset",t.offset),Jt(this,"value",t.value)}}class ge extends Qt{mode=t.PixelMode.percent;radius=0;x=50;y=50;doLoad(t){Kt(this,"x",t.x),Kt(this,"y",t.y),Kt(this,"mode",t.mode),Kt(this,"radius",t.radius)}}class me extends Qt{acceleration=9.81;enable=!1;inverse=!1;maxSpeed=50;doLoad(t){Jt(this,"acceleration",t.acceleration),Kt(this,"enable",t.enable),Kt(this,"inverse",t.inverse),Jt(this,"maxSpeed",t.maxSpeed)}}class ye extends Qt{value=0;doLoad(t){F(t.value)||(this.value=K(t.value))}}class ve extends ye{animation=new ie;doLoad(t){super.doLoad(t),te(this,"animation",t.animation)}}class Pe extends Qt{clamp=!0;delay=new ye;enable=!1;generator;options={};doLoad(t){Kt(this,"clamp",t.clamp),this.delay.load(t.delay),Kt(this,"enable",t.enable),this.generator=t.generator,t.options&&(this.options=vt(this.options,t.options))}}class we extends Qt{bottom;default=t.OutMode.out;left;right;top;doLoad(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 be extends Qt{acceleration=0;enable=!1;position;doLoad(t){Jt(this,"acceleration",t.acceleration),Kt(this,"enable",t.enable),t.position&&(this.position=vt({},t.position))}}class Me extends Qt{angle=new fe;center=new ge;decay=0;direction=t.MoveDirection.none;distance={};drift=0;enable=!1;gravity=new me;outModes=new we;path=new Pe;random=!1;size=!1;speed=2;spin=new be;straight=!1;vibrate=!1;warp=!1;doLoad(t){this.angle.load(_(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),Jt(this,"decay",t.decay),Kt(this,"direction",t.direction),void 0!==t.distance&&(this.distance=_(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),Jt(this,"drift",t.drift),Kt(this,"enable",t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(T(e)?this.outModes.load(e):this.outModes.load({default:e})),this.path.load(t.path),Kt(this,"random",t.random),Kt(this,"size",t.size),Jt(this,"speed",t.speed),this.spin.load(t.spin),Kt(this,"straight",t.straight),Kt(this,"vibrate",t.vibrate),Kt(this,"warp",t.warp)}}class xe extends Qt{color;opacity;width=0;doLoad(t){void 0!==t.color&&(this.color=oe.create(this.color,t.color)),Jt(this,"width",t.width),Jt(this,"opacity",t.opacity)}}class ze extends Qt{color;fill;stroke;doLoad(t){void 0!==t.color&&(this.color=oe.create(this.color,t.color)),ee(this,"fill",t.fill,()=>new pe),ee(this,"stroke",t.stroke,()=>new xe)}}class Se extends ye{value=1}class Ce extends Qt{horizontal=new Se;vertical=new Se;doLoad(t){this.horizontal.load(t.horizontal),this.vertical.load(t.vertical)}}class ke extends Qt{enable=!1;height=1080;width=1920;doLoad(t){Kt(this,"enable",t.enable),Kt(this,"width",t.width),Kt(this,"height",t.height)}}class De extends Qt{mode=t.LimitMode.delete;value=0;doLoad(t){Kt(this,"mode",t.mode),Kt(this,"value",t.value)}}class Ie extends Qt{density=new ke;limit=new De;value=0;doLoad(t){this.density.load(t.density),this.limit.load(t.limit),Kt(this,"value",t.value)}}class Oe extends Qt{close=!0;options={};type="circle";doLoad(t){const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=vt(this.options[t]??{},i))}Kt(this,"close",t.close),Kt(this,"type",t.type)}}class Le extends ye{opacityRate=1;sizeRate=1;velocityRate=1;doLoad(t){super.doLoad(t),Kt(this,"opacityRate",t.opacityRate),Kt(this,"sizeRate",t.sizeRate),Kt(this,"velocityRate",t.velocityRate)}}class Re extends Qt{bounce=new Ce;effect=new ue;groups={};move=new Me;number=new Ie;paint;palette;reduceDuplicates=!1;shape=new Oe;zIndex=new Le;#u;#p;constructor(t,e){super(),this.#p=t,this.#u=e,this.paint=new ze,this.paint.color=new oe,this.paint.color.value="#fff",this.paint.fill=new pe,this.paint.fill.enable=!0}doLoad(t){if(t.palette&&(this.palette=t.palette,this.#f(this.palette)),void 0!==t.groups)for(const e of Object.keys(t.groups)){if(!(e in t.groups))continue;const i=t.groups[e];void 0!==i&&(this.groups[e]=vt(this.groups[e]??{},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 e=t.paint;if(e&&(E(e)?this.paint=Pt(e,t=>{const e=new ze;return e.load(t),e}):E(this.paint)?(this.paint=new ze,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.zIndex.load(t.zIndex),this.#u){for(const e of this.#p.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this.#u,this,t);const e=this.#p.updaters.get(this.#u);if(e)for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}#f(t){const e=this.#p.getPalette(t);if(!e)return;const i=e.colors,s=(E(i)?i:[i]).flatMap(t=>{const e=t.fill,i=t.stroke,s=e?{color:{value:e.value},enable:e.enable,opacity:e.opacity}:void 0;return i?[{fill:s,stroke:{color:{value:i.value},opacity:i.opacity,width:i.width||0}}]:[{fill:s}]}),n=s.length>1?s:s[0]??{};this.load({paint:n,blend:{enable:!0,mode:e.blendMode}})}}function _e(t,e,...i){const s=new Re(t,e);return Zt(s,...i),s}class Te extends Qt{autoPlay=!0;background;clear=!0;defaultThemes={};delay=0;detectRetina=!0;duration=0;fpsLimit=120;fullScreen;hdr;key;name;palette;particles;pauseOnBlur=!0;pauseOnOutsideViewport=!0;preset;resize;smooth=!1;style={};zLayers=100;#u;#p;constructor(t,e){super(),this.#p=t,this.#u=e,this.background=new le,this.fullScreen=new ce,this.hdr=new he,this.particles=_e(this.#p,this.#u),this.resize=new de}doLoad(e){void 0!==e.preset&&(this.preset=e.preset,Pt(this.preset,t=>{this.#g(t)})),void 0!==e.palette&&(this.palette=e.palette,this.#f(this.palette)),Kt(this,"autoPlay",e.autoPlay),Kt(this,"clear",e.clear),Kt(this,"key",e.key),Kt(this,"name",e.name),Jt(this,"delay",e.delay),Kt(this,"detectRetina",e.detectRetina),Jt(this,"duration",e.duration),Kt(this,"fpsLimit",e.fpsLimit);const i=e.hdr;L(i)?(this.hdr.enable=i,this.hdr.mode=t.HdrMode.standard,this.hdr.peakNits=400):this.hdr.load(i),Kt(this,"pauseOnBlur",e.pauseOnBlur),Kt(this,"pauseOnOutsideViewport",e.pauseOnOutsideViewport),Kt(this,"zLayers",e.zLayers),this.background.load(e.background);const s=e.fullScreen;L(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.particles.load(e.particles),this.resize.load(e.resize),this.style=vt(this.style,e.style),Kt(this,"smooth",e.smooth),this.#p.plugins.forEach(t=>{t.loadOptions(this.#u,this,e)})}#f(t){const e=this.#p.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})}#g(t){this.load(this.#p.getPreset(t))}}const Ee=new Map,Fe=1.15,Ae=1.05,Be=.2126,He=.7152,Ue=.0722;function Ve(t,e){let i=Ee.get(t);return i||(i=e(),Ee.size>2e3&&Ee.clear(),Ee.set(t,i)),i}function $e(t){return j(t*(2.51*t+.03)/(t*(2.43*t+.59)+.14),0,1)}function Ne(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function qe(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function We(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function je(t,e,i,s=!0){if(!e)return;const n=R(e)?{value:e}:e;if(R(n.value))return Xe(t,n.value,i,s);if(E(n.value)){const e=gt(n.value,i,s);if(!e)return;return je(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function Xe(t,e,i,s=!0){if(!e)return;const n=R(e)?{value:e}:e;if(R(n.value))return n.value===g?ti():Qe(t,n.value);if(E(n.value)){const e=gt(n.value,i,s);if(!e)return;return Xe(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function Ye(t,e,i,s=!0){const n=je(t,e,i,s);return n?Ge(n):void 0}function Ge(t){const e=t.r/b,i=t.g/b,s=t.b/b,n=Math.max(e,i,s),a=Math.min(e,i,s),r={h:0,l:(n+a)*d,s:0};return n!==a&&(r.s=r.l<d?(n-a)/(n+a):(n-a)/(2-n-a),r.h=e===n?(i-s)/(n-a):i===n?2+(s-e)/(n-a):4+(e-i)/(n-a)),r.l*=z,r.s*=x,r.h*=60,r.h<0&&(r.h+=M),r.h>=M&&(r.h-=M),r}function Qe(t,e){return We(t,e)}function Ze(t,e,i){if(i<0&&i++,i>1&&i--,6*i<1)return t+6*(e-t)*i;if(2*i<1)return e;if(3*i<2){return t+(e-t)*(2/3-i)*6}return t}function Ke(t){const e=(t.h%M+M)%M,i=Math.max(0,Math.min(x,t.s)),s=Math.max(0,Math.min(z,t.l)),n=e/M,a=i/x,r=s/z;if(0===i){const t=Math.round(r*b);return{r:t,g:t,b:t}}const o=r<d?r*(1+a):r+a-r*a,l=2*r-o,c=1/3,h=Math.min(b,b*Ze(l,o,n+c)),u=Math.min(b,b*Ze(l,o,n)),p=Math.min(b,b*Ze(l,o,n-c));return{r:Math.round(h),g:Math.round(u),b:Math.round(p)}}function Je(t){const e=(t.h%M+M)%M,i=Math.max(0,Math.min(x,t.s)),s=Math.max(0,Math.min(z,t.l)),n=e/M,a=i/x,r=s/z;if(0===i){const t=r*b;return{r:t,g:t,b:t}}const o=r<d?r*(1+a):r+a-r*a,l=2*r-o,c=1/3;return{r:Math.min(b,b*Ze(l,o,n+c)),g:Math.min(b,b*Ze(l,o,n)),b:Math.min(b,b*Ze(l,o,n-c))}}function ti(t,e){const i=t??0;if(e)return{r:N(i,b),g:N(i,b),b:N(i,b)};const s=()=>Math.floor(N(i,256));return{b:s(),g:s(),r:s()}}function ei(e,i,s,n,a){const r=i?4:2,o=s??1;return Ve(i?`rgb-${e.r.toFixed(r)}-${e.g.toFixed(r)}-${e.b.toFixed(r)}-hdr-${o.toString()}-${(n??k).toString()}-${a??t.HdrMode.standard}`:`rgb-${e.r.toFixed(r)}-${e.g.toFixed(r)}-${e.b.toFixed(r)}-sdr-${o.toString()}`,()=>i?function(e,i,s=400,n=t.HdrMode.standard){const a=s/203,r=function(e,i,s,n){const a=e.r/b,r=e.g/b,o=e.b/b;if(n!==t.HdrMode.natural&&n!==t.HdrMode.vivid&&n!==t.HdrMode.cinematic&&n!==t.HdrMode.dynamic)return{b:o,g:r,r:a};const l=Math.max(1,i),c=Be*a+He*r+Ue*o,h=function(t,e,i){if(t<=i)return $e(t);const s=t+(t-i)*(e-1);return $e(s)}(c,i,s),d=c>0?h/c:1;return function(e,i,s,n,a){switch(n){case t.HdrMode.vivid:{const t=(e+i+s)/3;return{b:j(j(t+(s-t)*Fe,0,a)*Ae,0,a),g:j(j(t+(i-t)*Fe,0,a)*Ae,0,a),r:j(j(t+(e-t)*Fe,0,a)*Ae,0,a)}}case t.HdrMode.cinematic:{const t=1.05*e,n=.95*s,r=(t+i+n)/3;return{b:j(r+1.1*(n-r),0,a),g:j(r+1.1*(i-r),0,a),r:j(r+1.1*(t-r),0,a)}}case t.HdrMode.dynamic:{const t=Be*e+He*i+Ue*s,n=Math.min(1,2*t),r=1-n,o=(e+i+s)/3,l=j(o+(e-o)*Fe,0,a)*Ae,c=j(o+(i-o)*Fe,0,a)*Ae,h=j(o+(s-o)*Fe,0,a)*Ae;return{b:j(s*r+h*n,0,a),g:j(i*r+c*n,0,a),r:j(e*r+l*n,0,a)}}case t.HdrMode.standard:case t.HdrMode.natural:default:return{b:s,g:i,r:e}}}(j(a*d,0,l),j(r*d,0,l),j(o*d,0,l),n,l)}(e,a,.18,n);return`color(display-p3 ${r.r.toString()} ${r.g.toString()} ${r.b.toString()} / ${(i??1).toString()})`}(e,s,n,a):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(e,s))}function ii(e,i,s,n,a){const r=i?4:2,o=s??1;return Ve(i?`hsl-${e.h.toFixed(r)}-${e.s.toFixed(r)}-${e.l.toFixed(r)}-hdr-${o.toString()}-${(n??k).toString()}-${a??t.HdrMode.standard}`:`hsl-${e.h.toFixed(r)}-${e.s.toFixed(r)}-${e.l.toFixed(r)}-sdr-${o.toString()}`,()=>i?ei(Je(e),!0,s,n,a):`hsla(${e.h.toString()}, ${e.s.toString()}%, ${e.l.toString()}%, ${o.toString()})`)}function si(t,e,i,s,n){let a=t,r=e;if("r"in a||(a=n?Je(t):Ke(t)),"r"in r||(r=n?Je(e):Ke(e)),n){const t={b:Ne(a.b/b),g:Ne(a.g/b),r:Ne(a.r/b)},e={b:Ne(r.b/b),g:Ne(r.g/b),r:Ne(r.r/b)},n=i+s;return{b:qe((t.b*i+e.b*s)/n)*b,g:qe((t.g*i+e.g*s)/n)*b,r:qe((t.r*i+e.r*s)/n)*b}}return{b:X(a.b,r.b,i,s),g:X(a.g,r.g,i,s),r:X(a.r,r.r,i,s)}}function ni(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function ai(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=G(i.speed)/h*s,e.decay=1-G(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=G(i.count),e.time=0,e.delayTime=G(i.delay)*u,i.sync||(e.velocity*=$(),e.value*=$()),e.initialValue=e.value,e.offset=K(i.offset)):e.velocity=0}function ri(e,i,s,n){if(!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;if(e.time??=0,(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=s.value),(e.delayTime??0)>0&&e.time<(e.delayTime??0))return;const a=e.offset?Y(e.offset):0,r=(e.velocity??0)*s.factor+3.6*a,o=e.decay??1,l=e.max,c=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=r,e.value<c&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=r,e.value>l&&(e.loops??=0,e.loops++,i?e.status=t.AnimationStatus.decreasing:e.value-=l)),e.velocity&&1!==o&&(e.velocity*=o),e.value=j(e.value,c,l)}function oi(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const li=function(){const t=globalThis.tsParticles;return t?.pluginManager?t:new _t}(),ci=globalThis;ci.__tsParticlesInternals=ci.__tsParticlesInternals??{},ci.tsParticles=li,ci.getParticlesLogger=n,ci.setParticlesLogger=s,ci.getParticlesRandom=$,ci.getParticlesRandomFn=V,ci.setParticlesRandom=U;function hi(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class di{#m;#y;#v;#P;#w;#u;#b;#M;#x;#z;#S;#C;#p;#k;#D;#I={};#O=[void 0,void 0];#L={};constructor(t,e,i){this.#p=t,this.#u=e,this.#P=i,this.#b=null,this.#m=null,this.#y=new Set,this.#D=[],this.#k=[],this.#v=[],this.#w=[],this.#x=[],this.#z=[],this.#S=[],this.#C={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[]}}get settings(){return this.#M}canvasClear(){this.#u.actualOptions.clear&&this.draw(t=>{t.clearRect(p.x,p.y,this.#P.size.width,this.#P.size.height)})}clear(){for(const t of this.#v)if(t.canvasClear?.())return;for(const e of Object.values(t.DrawLayer))if("number"==typeof e)for(const t of this.#R(e))if(t.canvasClear?.())return;this.canvasClear()}destroy(){this.stop(),this.#m=null,this.#y.clear(),this.#D=[],this.#k=[],this.#v=[],this.#w=[],this.#x=[],this.#z=[],this.#S=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#C[e]=[])}draw(t){const e=this.#b;if(e)return t(e)}drawParticle(t,e){if(t.spawning||t.destroyed)return;const i=t.getRadius();if(i<=0)return;const s=t.getFillColor(),n=t.getStrokeColor();let[a,r]=this.#_(t);if(a??=s,r??=n,!a&&!r)return;const o=this.#u,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:h,opacity:d,strokeOpacity:u}=t.getOpacity(),p=this.#L,f=this.#I,g=a?ii(a,o.hdr,h*d,o.peakNits,o.hdrMode):void 0,m=r?ii(r,o.hdr,u*d,o.peakNits,o.hdrMode):g;p.a=p.b=p.c=p.d=void 0,f.fill=g,f.stroke=m,this.draw(s=>{for(const i of this.#S)i.drawParticleSetup?.(s,t,e);this.#T(s,t,i,d,f,p),this.#E({container:o,context:s,particle:t,delta:e,colorStyles:f,radius:i*c**l.sizeRate,opacity:d,transform:p}),this.#F(t);for(const i of this.#z)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this.#x)this.#A(i,s,t,e)})}drawParticles(e){const{particles:i,actualOptions:s}=this.#u;this.clear(),i.update(e),this.draw(n=>{const a=this.#P.size.width,r=this.#P.size.height;if(this.#m)try{n.drawImage(this.#m,p.x,p.y,a,r)}catch{this.#B("background-element-draw-error","Error drawing background element onto canvas")}const o=s.background;if(o.draw)try{o.draw(n,e)}catch{this.#B("background-draw-error","Error in background.draw callback")}for(const e of this.#R(t.DrawLayer.BackgroundMask))e.canvasPaint?.();for(const i of this.#R(t.DrawLayer.CanvasSetup))i.drawSettingsSetup?.(n,e);for(const i of this.#R(t.DrawLayer.PluginContent))i.draw?.(n,e);i.drawParticles(e);for(const i of this.#R(t.DrawLayer.CanvasCleanup))i.clearDraw?.(n,e),i.drawSettingsCleanup?.(n,e)})}init(){this.initUpdaters(),this.initPlugins(),this.#H(),this.paint()}initPlugins(){this.#v=[],this.#w=[],this.#x=[],this.#S=[],this.#z=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#C[e]=[]);for(const e of this.#u.plugins)(e.particleFillColor??e.particleStrokeColor)&&this.#w.push(e),e.drawParticle&&this.#x.push(e),e.drawParticleSetup&&this.#S.push(e),e.drawParticleCleanup&&this.#z.push(e),e.canvasClear&&this.#v.push(e),e.canvasPaint&&this.#R(t.DrawLayer.BackgroundMask).push(e),e.drawSettingsSetup&&this.#R(t.DrawLayer.CanvasSetup).push(e),e.draw&&this.#R(t.DrawLayer.PluginContent).push(e),(e.clearDraw??e.drawSettingsCleanup)&&this.#R(t.DrawLayer.CanvasCleanup).push(e)}initUpdaters(){this.#D=[],this.#k=[];for(const t of this.#u.particleUpdaters)t.afterDraw&&this.#k.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#D.push(t)}paint(){let e=!1;for(const i of this.#R(t.DrawLayer.BackgroundMask))if(e=i.canvasPaint?.()??!1,e)break;e||this.paintBase()}paintBase(t){this.draw(e=>{e.fillStyle=t??"rgba(0,0,0,0)",e.fillRect(p.x,p.y,this.#P.size.width,this.#P.size.height)})}paintImage(t,e){this.draw(i=>{if(!t)return;const s=i.globalAlpha;i.globalAlpha=e,i.drawImage(t,p.x,p.y,this.#P.size.width,this.#P.size.height),i.globalAlpha=s})}setContext(t){this.#b=t,this.#b&&(this.#b.globalCompositeOperation=o)}setContextSettings(t){this.#M=t}stop(){this.draw(t=>{t.clearRect(p.x,p.y,this.#P.size.width,this.#P.size.height)})}#F(t){for(const e of this.#k)e.afterDraw?.(t)}#T(t,e,i,s,n,a){for(const r of this.#D){if(r.getColorStyles){const{fill:a,stroke:o}=r.getColorStyles(e,t,i,s);a&&(n.fill=a),o&&(n.stroke=o)}if(r.getTransformValues){const t=r.getTransformValues(e);for(const e in t)hi(a,t,e)}r.beforeDraw?.(e)}}#U(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}#V(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}#E(t){const{container:e,context:i,particle:s,delta:n,colorStyles:a,radius:r,opacity:o,transform:l}=t,{effectDrawers:c,shapeDrawers:h}=e,d=s.getPosition(),u=s.getTransformData(l),p={x:d.x,y:d.y};i.setTransform(u.a,u.b,u.c,u.d,d.x,d.y),a.fill&&(i.fillStyle=a.fill);const f=!!s.fillEnabled,g=s.strokeWidth??0;i.lineWidth=g,a.stroke&&(i.strokeStyle=a.stroke);const m={context:i,particle:s,radius:r,drawRadius:1*r,opacity:o,delta:n,pixelRatio:e.retina.pixelRatio,fill:f,stroke:g>0,transformData:u,position:{...d},drawPosition:p,drawScale:1};for(const t of e.plugins)t.drawParticleTransform?.(m);const y=s.effect?c.get(s.effect):void 0,v=s.shape?h.get(s.shape):void 0;this.#V(y,m),this.#$(v,m),this.#N(v,m),this.#q(v,m),this.#U(y,m),i.resetTransform()}#A(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}#N(t,e){if(!t)return;const{context:i,fill:s,particle:n,stroke:a}=e;n.shape&&(i.beginPath(),t.draw(e),n.shapeClose&&i.closePath(),s&&i.fill(),a&&i.stroke())}#q(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}#$(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}#R(t){return this.#C[t]}#_(t){let e,i;for(const s of this.#w)if(!e&&s.particleFillColor&&(e=Ye(this.#p,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=Ye(this.#p,s.particleStrokeColor(t))),e&&i)break;return this.#O[0]=e,this.#O[1]=i,this.#O}#H(){const t=this.#u.actualOptions.background;if(this.#m=null,t.element)if("string"==typeof t.element){if("undefined"!=typeof document){const e=document.querySelector(t.element);"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement||"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?this.#m=e:e?this.#B("background-element-not-supported",`Background element "${t.element}" is not a supported drawable element (canvas, video, or img)`):this.#B("background-element-not-found",`Background element selector "${t.element}" not found`)}}else("undefined"!=typeof HTMLCanvasElement&&t.element instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t.element instanceof OffscreenCanvas||"undefined"!=typeof HTMLVideoElement&&t.element instanceof HTMLVideoElement||"undefined"!=typeof HTMLImageElement&&t.element instanceof HTMLImageElement)&&(this.#m=t.element)}#B(t,e){this.#y.has(t)||(this.#y.add(t),n().warning(e))}}const ui=new WeakMap;function pi(t,e,i=!1){if(!e)return;const s=t.style,n=new Set;for(let t=0;t<s.length;t++){const e=s.item(t);e&&n.add(e)}for(let t=0;t<e.length;t++){const i=e.item(t);i&&n.add(i)}for(const t of n){const n=e.getPropertyValue(t);n?s.setProperty(t,n,i?"important":""):s.removeProperty(t)}}class fi{domElement;render;renderCanvas;size;zoom=1;#u;#W;#j;#X;#Y;#p;#G;#Q;#Z;#K;constructor(t,e){this.#p=t,this.#u=e,this.render=new di(t,e,this),this.#Z={height:0,width:0};const i=e.retina.pixelRatio,s=this.#Z;this.size={height:s.height*i,width:s.width*i},this.#W=!1,this.#Q=[],this.#G="none"}get#J(){return this.#u.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this.#W){const t=this.domElement;t?.remove(),this.domElement=void 0,this.renderCanvas=void 0}else this.#tt();this.render.destroy(),this.#Q=[]}getZoomCenter(){const t=this.#u.retina.pixelRatio,{width:e,height:i}=this.size;return this.#K?this.#K:{x:e*d/t,y:i*d/t}}init(){this.#et(t=>{t.disconnect()}),this.#X=pt(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this.#it()}),this.resize(),this.#st(),this.#et(t=>{const e=this.domElement;e&&e instanceof Node&&t.observe(e,{attributes:!0})}),this.initPlugins(),this.#nt(),this.initBackground(),this.#at(),this.render.init()}initBackground(){const t=this.#u,e=t.actualOptions.background,i=this.domElement;if(!i)return;const s=i.style,n=je(this.#p,e.color);if(n){const i=t.actualOptions.hdr;s.backgroundColor=ei(n,t.hdr,e.opacity,i.peakNits,i.mode)}else s.backgroundColor="";s.backgroundImage=e.image||"",s.backgroundPosition=e.position||"",s.backgroundRepeat=e.repeat||"",s.backgroundSize=e.size||""}initPlugins(){this.#Q=[];for(const t of this.#u.plugins)t.resize&&this.#Q.push(t)}loadCanvas(t){this.#W&&this.domElement&&this.domElement.remove();const e=(t=>"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)(t)?t:void 0;this.domElement=e,this.#W=!!e&&"true"===e.dataset[r],this.renderCanvas=e?(t=>{const e=ui.get(t);if(e)return e;if("function"!=typeof t.transferControlToOffscreen)throw new TypeError("OffscreenCanvas is required but not supported by this browser");try{const e=t.transferControlToOffscreen();return ui.set(t,e),e}catch{throw new TypeError("OffscreenCanvas transfer failed")}})(e):t;const i=this.domElement;i&&(i.ariaHidden="true",this.#Y=Mt(i.style));const s=this.#Z,n=this.renderCanvas;i?(s.height=i.offsetHeight,s.width=i.offsetWidth):(s.height=n.height,s.width=n.width);const a=this.#u.retina.pixelRatio,o=this.size;n.height=o.height=s.height*a,n.width=o.width=s.width*a}resize(){const t=this.domElement;if(!t)return!1;const e=this.#u,i=this.renderCanvas;if(void 0===i)return!1;const s=e.canvas.#Z,n={width:t.offsetWidth,height:t.offsetHeight},a=e.retina.pixelRatio,r={width:n.width*a,height:n.height*a};if(n.height===s.height&&n.width===s.width&&r.height===i.height&&r.width===i.width)return!1;const o={...s};s.height=n.height,s.width=n.width;const l=this.size;return i.width=l.width=r.width,i.height=l.height=r.height,this.#u.started&&e.particles.setResizeFactor({width:s.width/o.width,height:s.height/o.height}),!0}setPointerEvents(t){this.domElement&&(this.#G=t,this.#it())}setZoom(t,e){this.zoom=t,this.#K=e}stop(){this.#et(t=>{t.disconnect()}),this.#X=void 0,this.#rt(),this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#u,e=t.updateActualOptions();t.particles.setDensity(),this.#ot(),e&&await t.refresh()}#ot(){for(const t of this.#Q)t.resize?.()}#nt(){const t=this.#u,e=t.actualOptions.hdr.enable&&ut("(color-gamut: p3)")?.matches&&ut("(dynamic-range: high)")?.matches;t.hdr=e??!1,t.hdrMode=t.actualOptions.hdr.mode,t.peakNits=t.actualOptions.hdr.peakNits;const i=this.renderCanvas;if(!i)return;let s;this.render.setContextSettings({alpha:!0,desynchronized:!0,willReadFrequently:!1,...e?{colorSpace:"display-p3",colorType:"float16"}:{colorSpace:"srgb"}});try{s=i.getContext("2d",this.render.settings)}catch{s=null}if(e&&!s){t.hdr=!1;const e={alpha:!0,desynchronized:!0,willReadFrequently:!1,colorSpace:"srgb"};this.render.setContextSettings(e);try{s=i.getContext("2d",e)}catch{s=null}}this.render.setContext(s)}#at(){this.#rt();const t=ut("(color-gamut: p3)"),e=ut("(dynamic-range: high)"),i=()=>{this.#lt(),this.#nt(),this.initBackground()},s=[];t&&(t.addEventListener("change",i),s.push({handler:i,mql:t})),e&&(e.addEventListener("change",i),s.push({handler:i,mql:e})),this.#j=s}#st(){const t=this.domElement,e=this.#u.actualOptions;if(t){this.#J?this.#ct():this.#tt();for(const i in e.style){if(!i||!(i in e.style))continue;const s=e.style[i];s&&t.style.setProperty(i,s,"important")}}}#lt(){const t=this.renderCanvas;t&&(this.domElement||(this.renderCanvas=new OffscreenCanvas(t.width,t.height)))}#rt(){if(this.#j){for(const{handler:t,mql:e}of this.#j)e.removeEventListener("change",t);this.#j=void 0}}#it(){const t=this.domElement;if(!t)return;this.#et(t=>{t.disconnect()}),this.#st(),this.initBackground();const e=this.#G;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this.#et(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})}#tt(){const t=this.domElement,e=this.#Y;t&&e&&pi(t,e,!0)}#et(t){this.#X&&t(this.#X)}#ct(){const t=this.domElement;t&&pi(t,St(this.#u.actualOptions.fullScreen.zIndex),!0)}}class gi{#u;#ht;#dt;#ut;constructor(t){this.#u=t,this.#ht={visibilityChange:()=>{this.#pt()},resize:()=>{this.#ft()}}}addListeners(){this.#gt(!0)}removeListeners(){this.#gt(!1)}#pt(){const t=this.#u;t.actualOptions.pauseOnBlur&&(dt().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))}#ft(){this.#ut&&(clearTimeout(this.#ut),this.#ut=void 0);const t=async()=>{const t=this.#u.canvas;await t.windowResize()};this.#ut=setTimeout(()=>{t()},this.#u.actualOptions.resize.delay*u)}#gt(t){const e=this.#ht;this.#mt(t),Ct(document,c,e.visibilityChange,t,!1)}#mt(t){const e=this.#ht,i=this.#u;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void Ct(globalThis,l,e.resize,t);const s=i.canvas.domElement;this.#dt&&!t?(s&&this.#dt.unobserve(s),this.#dt.disconnect(),this.#dt=void 0):!this.#dt&&t&&s&&(this.#dt=new ResizeObserver(t=>{t.find(t=>t.target===s)&&this.#ft()}),this.#dt.observe(s))}}function mi(t){if(!ft(t.outMode,t.checkModes))return;const e=2*t.radius;t.coord>t.maxCoord-e?t.setCb(-t.radius):t.coord<e&&t.setCb(t.radius)}function yi(t,e){const i=t%e;return i<0?i+e:i}function vi(t,e,i,s){const n=_e(i,e,e.actualOptions.particles),a=n.reduceDuplicates;t.effect=wt(n.effect.type,t.id,a),t.shape=wt(n.shape.type,t.id,a);const r=n.effect,o=n.shape;if(s){if(s.effect){const e=s.effect.type;if(e&&e!==t.effect){const i=wt(e,t.id,a);i&&(t.effect=i)}r.load(s.effect)}if(s.shape){const e=s.shape.type;if(e&&e!==t.shape){const i=wt(e,t.id,a);i&&(t.shape=i)}o.load(s.shape)}}if(t.effect===g){const i=[...e.effectDrawers.keys()];t.effect=i[Math.floor($()*i.length)]}if(t.shape===g){const i=[...e.shapeDrawers.keys()];t.shape=i[Math.floor($()*i.length)]}t.effectData=t.effect?function(t,e,i,s){const n=e.options[t];return vt({close:e.close},wt(n,i,s))}(t.effect,r,t.id,a):void 0,t.shapeData=t.shape?function(t,e,i,s){const n=e.options[t];return vt({close:e.close},wt(n,i,s))}(t.shape,o,t.id,a):void 0,n.load(s);const l=t.effectData,c=t.shapeData;return l&&n.load(l.particles),c&&n.load(c.particles),t.effectClose=l?.close??n.effect.close,t.shapeClose=c?.close??n.shape.close,n}class Pi{backColor;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;spawning;strokeColor;strokeOpacity;strokeWidth;unbreakable;velocity;zIndexFactor;#yt={fillOpacity:1,opacity:1,strokeOpacity:1};#vt=I.origin;#Pt={sin:0,cos:0};#wt={a:1,b:0,c:0,d:1};#u;#bt=[];#p;constructor(t,e){this.#p=t,this.#u=e}addModifier(t){this.#bt.push(t),this.#bt.sort((t,e)=>t.priority-e.priority)}clearModifiers(){this.#bt.length=0}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.clearModifiers();const i=this.#u,s=this.shape?i.shapeDrawers.get(this.shape):void 0;s?.particleDestroy?.(this);for(const t of i.particleDestroyedPlugins)t.particleDestroyed?.(this,e);for(const t of i.particleUpdaters)t.particleDestroyed?.(this,e);this.#u.dispatchEvent(t.EventType.particleDestroyed,{particle:this})}draw(t){const e=this.#u.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this.#Mt(this.#xt(ni(this.fillColor),t=>t.fillColor))}getMass(){return this.getRadius()**2*Math.PI*d}getModifier(t){return this.#bt.find(e=>e.id===t)}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=G(this.opacity?.value??1),s=this.#xt(void 0,t=>t.opacity)??i,n=this.fillOpacity??1,a=this.strokeOpacity??1;return this.#yt.fillOpacity=n,this.#yt.opacity=s*e,this.#yt.strokeOpacity=a,this.#yt}getPosition(){return this.#vt.x=this.position.x+this.offset.x,this.#vt.y=this.position.y+this.offset.y,this.#vt.z=this.position.z,this.#vt}getRadius(){return this.#xt(this.size.value,t=>t.radius)}getRotateData(){const t=this.getAngle();return this.#Pt.sin=Math.sin(t),this.#Pt.cos=Math.cos(t),this.#Pt}getStrokeColor(){return this.#Mt(this.#xt(ni(this.strokeColor),t=>t.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this.#wt.a=e.cos*(t.a??f.a),this.#wt.b=i?e.sin*(t.b??1):t.b??f.b,this.#wt.c=i?-e.sin*(t.c??1):t.c??f.c,this.#wt.d=e.cos*(t.d??f.d),this.#wt}init(e,i,s,n){const a=this.#u;!function(e,i,s){e.id=i,e.group=s,e.justWarped=!1,e.effectClose=!0,e.shapeClose=!0,e.pathRotation=!1,e.lastPathTime=0,e.destroyed=!1,e.unbreakable=!1,e.isRotating=!1,e.rotation=0,e.misplaced=!1,e.retina={maxDistance:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},e.size={value:1,max:1,min:1,enable:!1},e.outType=t.ParticleOutType.normal,e.ignoresResizeRatio=!0}(this,e,n),this.options=vi(this,a,this.#p,s),a.retina.initParticle(this),function(t,e){for(const i of t)i.preInit?.(e)}(a.particleUpdaters,this),this.#zt(i),this.initialVelocity=this.#St(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/a.zLayers,this.sides=24,function(t,e){let i,s;t.effect&&(i=e.effectDrawers.get(t.effect)),i?.loadEffect&&i.loadEffect(t),t.shape&&(s=e.shapeDrawers.get(t.shape)),s?.loadShape&&s.loadShape(t);const n=s?.getSidesCount;n&&(t.sides=n(t))}(this,a),this.spawning=!1,function(t,e){for(const i of t)i.init(e)}(a.particleUpdaters,this),function(t,e){const i=e.shape?t.shapeDrawers.get(e.shape):void 0,s=e.effect?t.effectDrawers.get(e.effect):void 0;s?.particleInit?.(t,e),i?.particleInit?.(t,e)}(a,this),function(t,e){for(const i of t.particleCreatedPlugins)i.particleCreated?.(e)}(a,this)}isInsideCanvas(t){return this.#Ct({direction:t}).inside}isInsideCanvasForOutMode(t,e){return this.#Ct({direction:e,outMode:t}).inside}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const e=yi(t,y);return e>=Math.PI*d&&e<3*Math.PI*d}if(this.roll.horizontal){const e=yi(t+Math.PI*d,y);return e>=Math.PI&&e<2*Math.PI}if(this.roll.vertical){const e=yi(t,y);return e>=Math.PI&&e<2*Math.PI}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}removeModifier(t){const e=this.#bt.findIndex(e=>e.id===t);e>=0&&this.#bt.splice(e,1)}reset(){for(const t of this.#u.particleUpdaters)t.reset?.(this)}#xt(t,e){let i=t;for(const t of this.#bt)if(t.enabled){const s=e(t);void 0!==s&&(i=s)}return i}#kt(t,e){let i=0,s=t?I.create(t.x,t.y,e):void 0;const n=this.#u,a=n.particlePositionPlugins,r=this.options.move.outModes,o=this.getRadius(),l=n.canvas.size;for(;;){for(const t of a){const i=t.particlePosition?.(s,this);if(i)return I.create(i.x,i.y,e)}const t=ot({size:l,position:s}),c=I.create(t.x,t.y,e);this.#Dt(c,o,r.left??r.default),this.#Dt(c,o,r.right??r.default),this.#It(c,o,r.top??r.default),this.#It(c,o,r.bottom??r.default);let h=!0;for(const t of n.particles.checkParticlePositionPlugins)if(h=t.checkParticlePosition?.(this,c,i)??!0,!h)break;if(h)return c;i+=1,s=void 0}}#St(){const e=this.options.move,i=nt(this.direction).copy();if(e.direction===t.MoveDirection.inside||e.direction===t.MoveDirection.outside)return i;const s=it(G(e.angle.value)),n=it(G(e.angle.offset)),a={left:n-s*d,right:n+s*d};return e.straight||(i.angle+=Y(K(a.left,a.right))),e.random&&"number"==typeof e.speed&&(i.length*=$()),i}#Dt(e,i,s){mi({outMode:s,checkModes:[t.OutMode.bounce],coord:e.x,maxCoord:this.#u.canvas.size.width,setCb:t=>e.x+=t,radius:i})}#It(e,i,s){mi({outMode:s,checkModes:[t.OutMode.bounce],coord:e.y,maxCoord:this.#u.canvas.size.height,setCb:t=>e.y+=t,radius:i})}#Ot(e,i){const s=this.getRadius(),n=this.#u.canvas.size,a=this.position,r=i===t.OutMode.bounce;return e===t.OutModeDirection.bottom?{inside:r?a.y+s<n.height:a.y-s<n.height,reason:"default"}:e===t.OutModeDirection.left?{inside:r?a.x-s>0:a.x+s>0,reason:"default"}:e===t.OutModeDirection.right?{inside:r?a.x+s<n.width:a.x-s<n.width,reason:"default"}:e===t.OutModeDirection.top?{inside:r?a.y-s>0:a.y+s>0,reason:"default"}:{inside:a.x>=-s&&a.y>=-s&&a.y<=n.height+s&&a.x<=n.width+s,reason:"default"}}#Lt(t,e){return{canvasSize:this.#u.canvas.size,direction:t,outMode:e,particle:this,radius:this.getRadius()}}#Ct(t){const e=this.#Ot(t.direction,t.outMode),i=this.#u,s=this.shape?i.shapeDrawers.get(this.shape):void 0,n=this.effect?i.effectDrawers.get(this.effect):void 0,a=s?.isInsideCanvas,r=n?.isInsideCanvas;if(!a&&!r)return e;const o=this.#Lt(t.direction,t.outMode),l=a?this.#Rt(a(o),"shape"):void 0,c=r?this.#Rt(r(o),"effect"):void 0;if(l&&c){const t=Math.max(l.margin??0,c.margin??0);return{inside:l.inside&&c.inside,margin:t>0?t:void 0,reason:"combined"}}return l??c??e}#Mt(t){return t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?oi(t,this.roll.alter.type,this.roll.alter.value):t:t}#zt(e){const i=this.#u,s=Math.floor(G(this.options.zIndex.value)),n=this.#kt(e,j(s,0,i.zLayers));if(!n)throw new Error("a valid position cannot be found for particle");this.position=n,this.initialPosition=this.position.copy();const a=i.canvas.size;switch(this.moveCenter={...bt(this.options.move.center,a),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=st(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case t.MoveDirection.inside:this.outType=t.ParticleOutType.inside;break;case t.MoveDirection.outside:this.outType=t.ParticleOutType.outside}this.offset=O.origin}#Rt(t,e){return"boolean"==typeof t?{inside:t,reason:e}:{inside:t.inside,margin:t.margin,reason:t.reason??e}}}class wi{#_t;#Tt=new Map;#Et=[];#Ft;#At;#Bt=[];#Ht;constructor(t){this.#_t=t,this.#Ft=0,this.#Ht=0}clear(){this.#Tt.clear();const t=this.#At;t&&(this.#_t=t),this.#At=void 0}insert(t){const{x:e,y:i}=t.getPosition(),s=this.#Ut(e,i);this.#Tt.has(s)||this.#Tt.set(s,[]),this.#Tt.get(s)?.push(t)}query(t,e,i=[]){const s=this.#Vt(t);if(!s)return i;const n=Math.floor(s.minX/this.#_t),a=Math.floor(s.maxX/this.#_t),r=Math.floor(s.minY/this.#_t),o=Math.floor(s.maxY/this.#_t);for(let s=n;s<=a;s++)for(let n=r;n<=o;n++){const a=`${s}_${n}`,r=this.#Tt.get(a);if(r)for(const s of r)e&&!e(s)||t.contains(s.getPosition())&&i.push(s)}return i}queryCircle(t,e,i,s=[]){const n=this.#$t(t.x,t.y,e),a=this.query(n,i,s);return this.#Nt(),a}queryRectangle(t,e,i,s=[]){const n=this.#qt(t.x,t.y,e.width,e.height),a=this.query(n,i,s);return this.#Nt(),a}setCellSize(t){this.#At=t}#$t(t,e,i){return(this.#Et[this.#Ft++]??=new Yt(t,e,i)).reset(t,e,i)}#qt(t,e,i,s){return(this.#Bt[this.#Ht++]??=new Gt(t,e,i,s)).reset(t,e,i,s)}#Ut(t,e){return`${Math.floor(t/this.#_t)}_${Math.floor(e/this.#_t)}`}#Vt(t){if(t instanceof Yt){const e=t.radius,{x:i,y:s}=t.position;return{minX:i-e,maxX:i+e,minY:s-e,maxY:s+e}}if(t instanceof Gt){const{x:e,y:i}=t.position,{width:s,height:n}=t.size;return{minX:e,maxX:e+s,minY:i,maxY:i+n}}return null}#Nt(){this.#Ft=0,this.#Ht=0}}class bi{checkParticlePositionPlugins;grid;#Wt;#u;#jt;#Xt;#Yt;#Gt;#Qt;#Zt;#p;#Kt;#Jt;#te;#ee;#ie;#se;constructor(t,e){this.#p=t,this.#u=e,this.#Yt=0,this.#Wt=[],this.#Kt=[],this.#Xt=0,this.#jt=new Map,this.#Gt=new Map,this.#se=this.#ne(this.#u.zLayers),this.grid=new wi(100),this.checkParticlePositionPlugins=[],this.#Qt=[],this.#Zt=[],this.#te=[],this.#Jt=[],this.#ie=[]}get count(){return this.#Wt.length}addParticle(e,i,s,a){const r=this.#u.actualOptions.particles.number.limit.mode,o=void 0===s?this.#Xt:this.#jt.get(s)??this.#Xt,l=this.count;if(o>0)switch(r){case t.LimitMode.delete:{const t=l+1-o;t>0&&this.removeQuantity(t);break}case t.LimitMode.wait:if(l>=o)return}try{const n=this.#Kt.pop()??new Pi(this.#p,this.#u);n.init(this.#Yt,e,i,s);let r=!0;return a&&(r=a(n)),r?(this.#Wt.push(n),this.#ae(n),this.#Yt++,this.#u.dispatchEvent(t.EventType.particleAdded,{particle:n}),n):void this.#Kt.push(n)}catch(t){n().warning(`error adding particle: ${t}`)}}clear(){this.#Wt=[],this.#Gt.clear(),this.#re(this.#u.zLayers)}destroy(){this.#Wt=[],this.#Kt.length=0,this.#Gt.clear(),this.#se=[],this.checkParticlePositionPlugins=[],this.#Qt=[],this.#Zt=[],this.#te=[],this.#Jt=[],this.#ie=[]}drawParticles(t){for(let e=this.#se.length-1;e>=0;e--){const i=this.#se[e];if(i)for(const e of i)e.draw(t)}}filter(t){return this.#Wt.filter(t)}find(t){return this.#Wt.find(t)}get(t){return this.#Wt[t]}async init(){const t=this.#u,e=t.actualOptions;this.checkParticlePositionPlugins=[],this.#ie=[],this.#Zt=[],this.#te=[],this.#Qt=[],this.#Jt=[],this.#Gt.clear(),this.#re(t.zLayers),this.grid=new wi(100*t.retina.pixelRatio);for(const e of t.plugins)e.redrawInit&&await e.redrawInit(),e.checkParticlePosition&&this.checkParticlePositionPlugins.push(e),e.update&&this.#ie.push(e),e.particleUpdate&&this.#Zt.push(e),e.postUpdate&&this.#te.push(e),e.particleReset&&this.#Qt.push(e),e.postParticleUpdate&&this.#Jt.push(e);await this.#u.initDrawersAndUpdaters();for(const e of this.#u.effectDrawers.values())await(e.init?.(t));for(const e of this.#u.shapeDrawers.values())await(e.init?.(t));let i=!1;for(const e of t.plugins)if(i=e.particlesInitialization?.()??i,i)break;if(!i){const t=e.particles,i=t.groups;for(const e in i){const s=i[e];if(s)for(let i=this.count,n=0;n<s.number.value&&i<t.number.value;i++,n++)this.addParticle(void 0,s,e)}for(let e=this.count;e<t.number.value;e++)this.addParticle()}}push(t,e,i,s){for(let n=0;n<t;n++)this.addParticle(e,i,s)}async redraw(){this.clear(),await this.init(),this.#u.canvas.render.drawParticles({value:0,factor:0})}remove(t,e,i){this.removeAt(this.#Wt.indexOf(t),void 0,e,i)}removeAt(t,e=1,i,s){if(t<0||t>this.count)return;let n=0;for(let a=t;n<e&&a<this.count;a++)this.#oe(a,i,s)&&(a--,n++)}removeQuantity(t,e){this.removeAt(0,t,e)}setDensity(){const t=this.#u.actualOptions,e=t.particles.groups;let i=0;for(const t of this.#u.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in e){const s=e[t];if(!s)continue;const n=_e(this.#p,this.#u,s);this.#le(n,i,t)}this.#le(t.particles,i)}setResizeFactor(t){this.#ee=t}update(t){this.grid.clear();for(const e of this.#ie)e.update?.(t);const e=this.#ce(t);for(const e of this.#te)e.postUpdate?.(t);if(this.#he(t,e),e.size)for(const t of e)this.remove(t);this.#ee=void 0}#de(...t){this.#Kt.push(...t)}#le(t,e,i,s){const n=t.number;if(!n.density.enable)return void(void 0===i?this.#Xt=n.limit.value:(s?.number.limit.value??n.limit.value)&&this.#jt.set(i,s?.number.limit.value??n.limit.value));const a=this.#ue(n.density),r=n.value,o=n.limit.value>0?n.limit.value:r,l=Math.min(r,o)*a+e,c=Math.min(this.count,this.filter(t=>t.group===i).length);void 0===i?this.#Xt=n.limit.value*a:this.#jt.set(i,n.limit.value*a),c<l?this.push(Math.abs(l-c),void 0,t,i):c>l&&this.removeQuantity(c-l,i)}#ne(t){const e=Math.max(Math.floor(t),1);return Array.from({length:e},()=>[])}#pe(t){const e=this.#se.length-1;return e<=0?0:Math.min(Math.max(Math.floor(t),0),e)}#ue(t){const e=this.#u;if(!t.enable)return 1;const i=e.canvas.size,s=e.retina.pixelRatio;return i.width&&i.height?i.width*i.height/(t.height*t.width*s**2):1}#ae(t){const e=this.#pe(t.position.z),i=this.#se[e];i&&(i.push(t),this.#Gt.set(t.id,e))}#oe(e,i,s){const n=this.#Wt[e];return!!n&&(n.group===i&&(this.#Wt.splice(e,1),this.#fe(n),n.destroy(s),this.#u.dispatchEvent(t.EventType.particleRemoved,{particle:n}),this.#de(n),!0))}#fe(t){const e=this.#Gt.get(t.id)??this.#pe(t.position.z),i=this.#se[e];if(!i)return void this.#Gt.delete(t.id);const s=i.findIndex(e=>e.id===t.id);s>=0&&i.splice(s,1),this.#Gt.delete(t.id)}#re(t){const e=Math.max(Math.floor(t),1);if(this.#se.length===e)for(const t of this.#se)t.length=0;else this.#se=this.#ne(e)}#ge(t){const e=this.#pe(t.position.z),i=this.#Gt.get(t.id);if(void 0===i)return void this.#ae(t);if(i===e)return;const s=this.#se[i];if(s){const e=s.findIndex(e=>e.id===t.id);e>=0&&s.splice(e,1)}const n=this.#se[e];if(n){if(n.push(t),n.length>=2){const e=n[n.length-2];e&&t.id<e.id&&n.sort((t,e)=>t.id-e.id)}this.#Gt.set(t.id,e)}else this.#Gt.set(t.id,e)}#ce(t){const e=new Set,i=this.#ee;for(const s of this.#Wt){i&&!s.ignoresResizeRatio&&(s.position.x*=i.width,s.position.y*=i.height,s.initialPosition.x*=i.width,s.initialPosition.y*=i.height),s.ignoresResizeRatio=!1;for(const t of this.#Qt)t.particleReset?.(s);for(const e of this.#Zt){if(s.destroyed)break;e.particleUpdate?.(s,t)}s.destroyed?e.add(s):this.grid.insert(s)}return e}#he(t,e){for(const i of this.#Wt)if(i.destroyed)e.add(i);else{for(const e of this.#u.particleUpdaters)e.update(i,t);if(!i.spawning)for(const e of this.#Jt)e.postParticleUpdate?.(i,t);this.#ge(i)}}}class Mi{pixelRatio;reduceFactor;#u;constructor(t){this.#u=t,this.pixelRatio=1,this.reduceFactor=1}init(){const t=this.#u,e=t.actualOptions;this.pixelRatio=e.detectRetina?devicePixelRatio:1,this.reduceFactor=1;const i=this.pixelRatio,s=t.canvas,n=s.domElement;n&&(s.size.width=n.offsetWidth*i,s.size.height=n.offsetHeight*i)}initParticle(t){const e=t.options,i=this.pixelRatio,s=e.move,n=s.distance,a=t.retina;a.maxSpeed=G(s.gravity.maxSpeed)*i,a.moveDrift=G(s.drift)*i,a.moveSpeed=G(s.speed)*i;const r=a.maxDistance;r.horizontal=void 0===n.horizontal?void 0:n.horizontal*i,r.vertical=void 0===n.vertical?void 0:n.vertical*i}}function xi(t){return!t.destroyed}function zi(t,e,...i){const s=new Te(t,e);return Zt(s,...i),s}var Si=Object.freeze({__proto__:null,Container:class{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;hdrMode;id;pageHidden;particleCreatedPlugins;particleDestroyedPlugins;particlePositionPlugins;particleUpdaters;particles;peakNits;plugins;retina;shapeDrawers;started;zLayers;#me;#ye;#ve={value:0,factor:0};#Pe;#we;#be;#Me;#xe;#ze;#Se;#Ce;#ke;#De;#Ie;#p;#Oe;#Le;constructor(e){const{dispatchCallback:i,pluginManager:s,id:n,onDestroy:a,sourceOptions:r}=e;this.#p=s,this.#Pe=i,this.#ke=a,this.id=Symbol(n),this.fpsLimit=120,this.hdr=!1,this.hdrMode=t.HdrMode.standard,this.peakNits=400,this.#Oe=!1,this.#me=0,this.#be=0,this.#Ce=0,this.#xe=!0,this.started=!1,this.destroyed=!1,this.#Ie=!0,this.#Se=0,this.zLayers=100,this.pageHidden=!1,this.#Le=r,this.#ze=r,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new Mi(this),this.canvas=new fi(this.#p,this),this.particles=new bi(this.#p,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this.#De=zi(this.#p,this),this.actualOptions=zi(this.#p,this),this.#Me=new gi(this),this.dispatchEvent(t.EventType.containerBuilt)}get animationStatus(){return!this.#Ie&&!this.pageHidden&&xi(this)}get options(){return this.#De}get sourceOptions(){return this.#Le}addLifeTime(t){this.#Ce+=t}alive(){return!this.#be||this.#Ce<=this.#be}destroy(e=!0){if(xi(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.#p.clearPlugins(this),this.destroyed=!0,this.#ke(e),this.dispatchEvent(t.EventType.containerDestroyed)}}dispatchEvent(t,e){this.#Pe(t,{container:this,data:e})}draw(t){if(!xi(this))return;let e=t;this.#we=q(t=>{e&&(this.#Se=void 0,e=!1),this.#Re(t)})}async export(t,e={}){for(const i of this.plugins){if(!i.export)continue;const s=await i.export(t,e);if(s.supported)return s.blob}n().error(`Export plugin with type ${t} not found`)}async init(){if(!xi(this))return;const e=new Map;for(const t of this.#p.plugins){const i=await t.getPlugin(this);i.preInit&&await i.preInit(),e.set(t,i)}await this.initDrawersAndUpdaters(),this.#De=zi(this.#p,this,this.#ze,this.sourceOptions),this.actualOptions=zi(this.#p,this,this.#De),this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[t,i]of e)t.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:i,duration:s,fpsLimit:n,smooth:a,zLayers:r}=this.actualOptions,o=this.actualOptions.hdr;this.hdrMode=o.mode,this.peakNits=o.peakNits,this.zLayers=r,this.#be=G(s)*u,this.#me=G(i)*u,this.#Ce=0,this.fpsLimit=n>0?n:120,this.#Oe=a;for(const t of this.plugins)await(t.init?.());await this.particles.init(),this.dispatchEvent(t.EventType.containerInit),this.particles.setDensity();for(const t of this.plugins)t.particlesSetup?.();this.dispatchEvent(t.EventType.particlesSetup)}async initDrawersAndUpdaters(){const t=this.#p;this.effectDrawers=await t.getEffectDrawers(this,!0),this.shapeDrawers=await t.getShapeDrawers(this,!0),this.particleUpdaters=await t.getUpdaters(this,!0)}pause(){if(xi(this)&&(void 0!==this.#we&&(W(this.#we),this.#we=void 0),!this.#Ie)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this.#Ie=!0),this.dispatchEvent(t.EventType.containerPaused)}}play(e){if(!xi(this))return;const i=this.#Ie||e;if(!this.#xe||this.actualOptions.autoPlay){if(this.#Ie&&(this.#Ie=!1),i)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(t.EventType.containerPlay),this.draw(i??!1)}else this.#xe=!1}async refresh(){if(xi(this))return this.stop(),this.start()}async reset(t){if(xi(this))return this.#ze=t,this.#Le=t,this.#De=zi(this.#p,this,this.#ze,this.sourceOptions),this.actualOptions=zi(this.#p,this,this.#De),this.refresh()}async start(){xi(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise(e=>{const i=async()=>{this.#Me.addListeners();for(const t of this.plugins)await(t.start?.());this.dispatchEvent(t.EventType.containerStarted),this.play(),e()};this.#ye=setTimeout(()=>{i()},this.#me)}))}stop(){if(xi(this)&&this.started){this.#ye&&(clearTimeout(this.#ye),this.#ye=void 0),this.#xe=!0,this.started=!1,this.#Me.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.#Le=this.#De,this.dispatchEvent(t.EventType.containerStopped)}}updateActualOptions(){let t=!1;for(const e of this.plugins)e.updateActualOptions&&(t=e.updateActualOptions()||t);return t}#Re(t){try{if(!this.#Oe&&void 0!==this.#Se&&t<this.#Se+u/this.fpsLimit)return void this.draw(!1);if(this.#Se??=t,function(t,e,i=60,s=!1){t.value=e,t.factor=s?60/i:60*e/u}(this.#ve,t-this.#Se,this.fpsLimit,this.#Oe),this.addLifeTime(this.#ve.value),this.#Se=t,this.#ve.value>u)return void this.draw(!1);if(this.canvas.render.drawParticles(this.#ve),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){n().error("error in animation loop",t)}}}});t.AnimatableColor=oe,t.AnimationOptions=ie,t.AnimationValueWithRandom=ve,t.Background=le,t.BaseRange=Xt,t.Circle=Yt,t.ColorAnimation=ne,t.Fill=pe,t.FullScreen=ce,t.HDROptions=he,t.HslAnimation=ae,t.Move=Me,t.MoveAngle=fe,t.MoveCenter=ge,t.MoveGravity=me,t.MovePath=Pe,t.OptionLoader=Qt,t.Options=Te,t.OptionsColor=re,t.OutModes=we,t.Paint=ze,t.ParticlesBounce=Ce,t.ParticlesBounceFactor=Se,t.ParticlesDensity=ke,t.ParticlesNumber=Ie,t.ParticlesNumberLimit=De,t.ParticlesOptions=Re,t.RangedAnimationOptions=se,t.RangedAnimationValueWithRandom=class extends ve{animation=new se},t.Rectangle=Gt,t.ResizeEvent=de,t.Shape=Oe,t.Spin=be,t.Stroke=xe,t.ValueWithRandom=ye,t.Vector=O,t.Vector3d=I,t.ZIndex=Le,t.alterHsl=oi,t.animate=q,t.areBoundsInside=mt,t.calcExactPositionOrRandomFromSize=ot,t.calcPositionFromSize=function(t){return void 0!==t.position?.x&&void 0!==t.position.y?{x:t.position.x*t.size.width/h,y:t.position.y*t.size.height/h}:void 0},t.calcPositionOrRandomFromSize=rt,t.calcPositionOrRandomFromSizeRanged=function(t){const e={x:void 0!==t.position?.x?G(t.position.x):void 0,y:void 0!==t.position?.y?G(t.position.y):void 0};return rt({size:t.size,position:e})},t.calculateBounds=yt,t.cancelAnimation=W,t.canvasFirstIndex=0,t.canvasTag=w,t.checkDistance=et,t.circleBounce=function(t,e){const{x:i,y:s}=t.velocity.sub(e.velocity),[n,a]=[t.position,e.position],{dx:r,dy:o}=J(a,n);if(i*r+s*o<0)return;const l=-Math.atan2(o,r),c=t.mass,h=e.mass,d=t.velocity.rotate(l),u=e.velocity.rotate(l),p=at(d,u,c,h),f=at(u,d,c,h),g=p.rotate(-l),m=f.rotate(-l);t.velocity.x=g.x*t.factor.x,t.velocity.y=g.y*t.factor.y,e.velocity.x=m.x*e.factor.x,e.velocity.y=m.y*e.factor.y},t.circleBounceDataFromParticle=function(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:O.create(G(t.options.bounce.horizontal.value),G(t.options.bounce.vertical.value))}},t.clamp=j,t.cloneStyle=Mt,t.collisionVelocity=at,t.colorMix=si,t.colorToRgb=Xe,t.countOffset=1,t.decayOffset=1,t.deepExtend=vt,t.defaultAlpha=1,t.defaultAngle=0,t.defaultCompositeValue=o,t.defaultDensityFactor=1,t.defaultFps=60,t.defaultFpsLimit=120,t.defaultLoops=0,t.defaultOpacity=1,t.defaultRatio=1,t.defaultReduceFactor=1,t.defaultRemoveQuantity=1,t.defaultRetryCount=0,t.defaultRgbMin=0,t.defaultTime=0,t.defaultTransform=f,t.defaultTransformValue=1,t.defaultVelocity=0,t.defaultZoom=1,t.degToRad=it,t.deleteCount=1,t.double=2,t.doublePI=y,t.empty=0,t.executeOnSingleOrMultiple=Pt,t.generatedAttribute=r,t.generatedFalse=P,t.generatedTrue=v,t.getDistance=function(t,e){return Math.sqrt(tt(t,e))},t.getDistanceSq=tt,t.getDistances=J,t.getFullScreenStyle=St,t.getHslAnimationFromHsl=function(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:M},s:{enable:!1,value:t.s,min:0,max:x},l:{enable:!1,value:t.l,min:0,max:z}};return e&&(ai(s.h,e.h,i),ai(s.s,e.s,i),ai(s.l,e.l,i)),s},t.getHslFromAnimation=ni,t.getItemMapFromInitializer=Dt,t.getItemsFromInitializer=kt,t.getLinkColor=function(t,e,i,s){if(i===g)return ti();if(i!==m)return i;{const i=t.getFillColor()??t.getStrokeColor(),n=e?.getFillColor()??e?.getStrokeColor();if(i&&n&&e)return si(i,n,t.getRadius(),e.getRadius(),s);{const t=i??n;if(t)return Ke(t)}}},t.getLinkRandomColor=function(t,e,i,s){const n=R(e)?e:e.value;return n===g?s?je(t,{value:n}):i?g:m:n===m?m:je(t,{value:n})},t.getLogger=n,t.getParticleBaseVelocity=nt,t.getParticleDirectionAngle=st,t.getPosition=bt,t.getRandom=$,t.getRandomFn=V,t.getRandomInRange=N,t.getRandomRgbColor=ti,t.getRangeMax=Z,t.getRangeMin=Q,t.getRangeValue=G,t.getStyleFromHsl=ii,t.getStyleFromRgb=ei,t.hMax=M,t.hMin=0,t.hPhase=60,t.half=d,t.hslToRgb=Ke,t.hslToRgbFloat=Je,t.hslaToRgba=function(t){const e=Ke(t);return{a:t.a,b:e.b,g:e.g,r:e.r}},t.identity=1,t.inverseFactorNumerator=1,t.isArray=E,t.isBoolean=L,t.isFunction=function(t){return"function"==typeof t},t.isInArray=ft,t.isNull=F,t.isNumber=_,t.isObject=T,t.isPointInside=function(t,e,i,s,n){return mt(yt(t,s??0),e,i,n)},t.isString=R,t.itemFromArray=gt,t.itemFromSingleOrMultiple=wt,t.lFactor=1,t.lMax=z,t.lMin=0,t.lengthOffset=1,t.loadExtendProperty=function(t,e,i){if(void 0!==i){const s=e;if("__proto__"===s||"constructor"===s||"prototype"===s)return;const n=t,a=Object.prototype.hasOwnProperty.call(n,s)?n[s]:{};n[s]=vt(a,i)}},t.loadLazyProperty=ee,t.loadMinIndex=0,t.loadNestedProperty=te,t.loadOptionProperty=function(t,e,i,...s){const n=t;n[e]??=new i;const a=n[e];for(const t of s)a.load(t?.[e])},t.loadOptions=Zt,t.loadParticlesOptions=_e,t.loadProperty=Kt,t.loadRandomFactor=1e4,t.loadRangeProperty=Jt,t.manageListener=Ct,t.maxNits=k,t.midColorValue=m,t.millisecondsToSeconds=u,t.minCount=0,t.minDistance=0,t.minFpsLimit=0,t.minIndex=0,t.minLimit=0,t.minRadius=0,t.minStrokeWidth=0,t.minVelocity=0,t.minZ=0,t.minimumSize=0,t.mix=X,t.none=0,t.one=1,t.originPoint=p,t.parseAlpha=function(t){return t?t.endsWith("%")?parseFloat(t)/h:parseFloat(t):1},t.percentDenominator=h,t.phaseNumerator=1,t.quarter=S,t.randomColorValue=g,t.randomInRangeValue=Y,t.rangeColorToHsl=Ye,t.rangeColorToRgb=je,t.removeDeleteCount=1,t.removeMinIndex=0,t.resizeEvent=l,t.rgbMax=b,t.rgbToHsl=Ge,t.sMax=x,t.sMin=0,t.sNormalizedOffset=1,t.safeDocument=dt,t.safeMatchMedia=ut,t.safeMutationObserver=pt,t.setAnimationFunctions=function(t,e){H.nextFrame=t,H.cancel=e},t.setLogger=s,t.setRandom=U,t.setRangeValue=K,t.sextuple=6,t.spatialHashGridCellSize=100,t.squareExp=2,t.stringToAlpha=function(t,e){return We(t,e)?.a},t.stringToRgb=Qe,t.threeQuarter=C,t.triple=3,t.tryCountIncrement=1,t.tsParticles=li,t.updateColor=function(t,e,i){if(!t)return;const{h:s,s:n,l:a}=t;ri(s,!1,e),ri(n,!0,e),ri(a,!0,e)},t.updateColorValue=ri,t.visibilityChangeEvent=c,t.zIndexFactorOffset=1}),Object.assign(globalThis.window||globalThis,{tsParticles:(globalThis.__tsParticlesInternals.engine||{}).tsParticles}),delete(globalThis.window||globalThis).tsparticlesInternalExports;