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