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.

1 lines 75.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),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="generated",i="source-over",s="resize",n="visibilitychange",a=100,o=.5,r=1e3,l={x:0,y:0,z:0},c={a:1,b:0,c:0,d:1},h="random",u="mid",d=2*Math.PI,p="true",f="false",g="canvas",m=255,y=360,v=100,P=100,w=.25,b=.75;var x;function M(t){return"z"in t?t.z:l.z}t.MoveDirection=void 0,(x=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",x.bottomLeft="bottom-left",x.bottomRight="bottom-right",x.left="left",x.none="none",x.right="right",x.top="top",x.topLeft="top-left",x.topRight="top-right",x.outside="outside",x.inside="inside";class z{x;y;z;constructor(t=l.x,e=l.y,i=l.z){this.x=t,this.y=e,this.z=i}static get origin(){return z.create(l.x,l.y,l.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 z.create(t.x,t.y,M(t))}static create(t,e,i){return"number"==typeof t?new z(t,e??l.y,i??l.z):new z(t.x,t.y,M(t))}add(t){return z.create(this.x+t.x,this.y+t.y,this.z+M(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=M(t)}copy(){return z.clone(this)}div(t){return z.create(this.x/t,this.y/t,this.z/t)}divTo(t){this.x/=t,this.y/=t,this.z/=t}getLengthSq(){return this.x**2+this.y**2}mult(t){return z.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 z.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),l.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=M(t)}sub(t){return z.create(this.x-t.x,this.y-t.y,this.z-M(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=M(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class S extends z{constructor(t=l.x,e=l.y){super(t,e,l.z)}static get origin(){return S.create(l.x,l.y)}static clone(t){return S.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new S(t,e??l.y):new S(t.x,t.y)}}function I(t){return"boolean"==typeof t}function O(t){return"string"==typeof t}function C(t){return"number"==typeof t}function D(t){return"object"==typeof t&&null!==t}function k(t){return Array.isArray(t)}function R(t){return null==t}const _=Math.PI/180;let T=Math.random;const E={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function A(){return U(T(),0,1-Number.EPSILON)}function L(t,e){return A()*(e-t)+t}function F(t){return E.nextFrame(t)}function B(t){E.cancel(t)}function U(t,e,i){return Math.min(Math.max(t,e),i)}function V(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function $(t){const e=W(t);let i=H(t);return e===i&&(i=0),L(i,e)}function q(t){return C(t)?t:$(t)}function H(t){return C(t)?t:t.min}function W(t){return C(t)?t:t.max}function N(t,e){if(t===e||void 0===e&&C(t))return t;const i=H(t),s=W(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:N(i,s)}function Q(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}}function j(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function G(t,e,i){return j(t,e)<=i*i}function X(t){return t*_}function Y(e,i,s){if(C(e))return X(e);switch(e){case t.MoveDirection.top:return-Math.PI*o;case t.MoveDirection.topRight:return-Math.PI*w;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*w;case t.MoveDirection.bottom:return Math.PI*o;case t.MoveDirection.bottomLeft:return Math.PI*b;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*b;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 A()*d}}function Z(t){const e=S.origin;return e.length=1,e.angle=t,e}function J(t,e,i,s){return S.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function K(t){return{x:(t.position?.x??A()*a)*t.size.width/a,y:(t.position?.y??A()*a)*t.size.height/a}}function tt(t){const{position:e,size:i}=t;return{x:e?.x??A()*i.width,y:e?.y??A()*i.height}}var et,it,st,nt,at,ot;t.AnimationMode=void 0,(et=t.AnimationMode||(t.AnimationMode={})).auto="auto",et.increase="increase",et.decrease="decrease",et.random="random",t.AnimationStatus=void 0,(it=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",it.decreasing="decreasing",t.DestroyType=void 0,(st=t.DestroyType||(t.DestroyType={})).none="none",st.max="max",st.min="min",t.OutModeDirection=void 0,(nt=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",nt.left="left",nt.right="right",nt.top="top",t.PixelMode=void 0,(at=t.PixelMode||(t.PixelMode={})).precise="precise",at.percent="percent",t.StartValueType=void 0,(ot=t.StartValueType||(t.StartValueType={})).max="max",ot.min="min",ot.random="random";function rt(t,e){const i=new Map,s=e?.maxSize,n=e?.ttlMs,a=e?.keyFn,o=(t,e=new WeakSet)=>{if(null===t)return"null";const i=typeof t;if("undefined"===i)return"undefined";if("number"===i||"boolean"===i||"string"===i)return JSON.stringify(t);if("function"===i)try{return t.toString()}catch{return'"[Function]"'}if("symbol"===i)try{return t.toString()}catch{return'"[Symbol]"'}if(Array.isArray(t))return`[${t.map(t=>o(t,e)).join(",")}]`;if(e.has(t))return'"[Circular]"';e.add(t);return`{${Object.keys(t).sort().map(i=>`${JSON.stringify(i)}:${o(t[i],e)}`).join(",")}}`},r=t=>a?a(t):(t=>o(t))(t);return(...e)=>{const a=r(e),o=Date.now(),l=i.get(a);if(void 0!==l){if(!(n&&o-l.ts>n))return i.delete(a),i.set(a,{value:l.value,ts:l.ts}),l.value;i.delete(a)}const c=t(...e);return i.set(a,{value:c,ts:o}),(()=>{if("number"==typeof s&&s>=0)for(;i.size>s;){const t=i.keys().next().value;if(void 0===t)break;i.delete(t)}})(),c}}function lt(){return"undefined"!=typeof matchMedia}function ct(){return globalThis.document}function ht(t){if(lt())return matchMedia(t)}function ut(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function dt(t,e){return t===e||k(e)&&e.includes(t)}function pt(t){return Math.floor(A()*t.length)}function ft(t,e,i=!0){return t[void 0!==e&&i?e%t.length:pt(t)]}function gt(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 mt(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function yt(t,...e){for(const i of e){if(R(i))continue;if(!D(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):D(t)&&!Array.isArray(t)||(t={});const e=Object.keys(i),s=new Set(["__proto__","constructor","prototype"]);if(!e.some(t=>{const e=i[t];return D(e)||Array.isArray(e)})){const n=i,a=t;for(const t of e)if(!s.has(t)&&t in n){const e=n[t];void 0!==e&&(a[t]=e)}continue}for(const n of e){if(s.has(n))continue;const e=t,a=i[n];e[n]=Array.isArray(a)?a.map(t=>yt(void 0,t)):yt(e[n],a)}}return t}function vt(t,e){return k(t)?t.map((t,i)=>e(t,i)):e(t,0)}function Pt(t,e,i){return k(t)?ft(t,e,i):t}function wt(e,i){if(!(e.mode===t.PixelMode.percent)){const{mode:t,...i}=e;return i}return"x"in e?{x:e.x/a*i.width,y:e.y/a*i.height}:{width:e.width/a*i.width,height:e.height/a*i.height}}function bt(t,e){return wt(t,e)}function xt(t){const e=ct().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||R(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}const Mt=rt(function(t){const e=ct().createElement("div").style,i={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(10),"z-index":t.toString(10),top:"0",left:"0","pointer-events":"none"};for(const t in i){const s=i[t];void 0!==s&&e.setProperty(t,s)}return e});function zt(t,e,i,s,n){if(s){let s={passive:!0};I(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 St(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 It(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 Ot{#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 Ct;t.EventType=void 0,(Ct=t.EventType||(t.EventType={})).configAdded="configAdded",Ct.containerInit="containerInit",Ct.particlesSetup="particlesSetup",Ct.containerStarted="containerStarted",Ct.containerStopped="containerStopped",Ct.containerDestroyed="containerDestroyed",Ct.containerPaused="containerPaused",Ct.containerPlay="containerPlay",Ct.containerBuilt="containerBuilt",Ct.particleAdded="particleAdded",Ct.particleDestroyed="particleDestroyed",Ct.particleRemoved="particleRemoved";class Dt{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;#o=!1;#r=!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 It(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 It(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return St(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this.#o&&!this.#r){this.#r=!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.#r=!1,this.#o=!0}}}loadParticlesOptions(t,e,...i){const s=this.updaters.get(t);s&&s.forEach(t=>t.loadOptions?.(e,...i))}async register(...t){if(this.#o)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this.#r?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 kt=t=>(...e)=>{t(...e)},Rt={debug:kt(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:kt(console.info),log:kt(console.log),trace:kt(console.trace),verbose:kt(console.log),warning:kt(console.warn)};function _t(){return Rt}const Tt="100%";class Et{pluginManager=new Dt(this);#h=[];#u=new Ot;#o=!1;get items(){return this.#h}get version(){return"4.1.1"}addEventListener(t,e){this.#u.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.#u.dispatchEvent(t,e)}async init(){this.#o||(await this.pluginManager.init(),this.#o=!0)}item(t){const e=this.items,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){let i;await this.init(),"undefined"!=typeof HTMLElement&&t.element instanceof HTMLElement&&(i=t.element);const{Container:s}=await Promise.resolve().then(function(){return fi}),n=t.id??i?.id??`tsparticles${Math.floor(1e4*A()).toString()}`,{index:a,url:o}=t,r=o?await async function(t){const e=Pt(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(_t().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:o,index:a}):t.options,l=Pt(r,a),{items:c}=this,h=c.findIndex(t=>t.id.description===n),u=new s({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:n,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(u);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,u)}else c.push(u);const d="undefined"!=typeof OffscreenCanvas&&t.element instanceof OffscreenCanvas?t.element:(t=>{const i=ct();let s;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===g)s=t,s.dataset[e]??=f,s.dataset[e]===p&&(s.style.width||=Tt,s.style.height||=Tt,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none"));else{const n=t.getElementsByTagName(g).item(0);n?(s=n,s.dataset[e]=f):(s=i.createElement(g),s.dataset[e]=p,t.appendChild(s)),s.style.width||=Tt,s.style.height||=Tt,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(((t,i)=>{const s=ct();let n=i??s.getElementById(t);return n||(n=s.createElement("canvas"),n.id=t,n.dataset[e]=p,s.body.append(n),n)})(n,i));return u.canvas.loadCanvas(d),await u.start(),u}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this.#u.removeEventListener(t,e)}}var At,Lt,Ft,Bt,Ut,Vt,$t,qt;!function(t){t.circle="circle",t.rectangle="rectangle"}(At||(At={}));class Ht{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 Wt extends Ht{radius;constructor(t,e,i){super(t,e,At.circle),this.radius=i}contains(t){return G(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 Wt||t.type===At.circle){return s+t.radius>Math.hypot(n,a)}if(t instanceof Nt||t.type===At.rectangle){const e=t,{width:i,height:o}=e.size;return Math.pow(n-i,2)+Math.pow(a-o,2)<=s**2||n<=s+i&&a<=s+o||n<=i||a<=o}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class Nt extends Ht{size;constructor(t,e,i,s){super(t,e,At.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 Wt)return t.intersects(this);if(!(t instanceof Nt))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,a=t.size,o=a.width,r=a.height;return n.x<s.x+e&&n.x+o>s.x&&n.y<s.y+i&&n.y+r>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,(Lt=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",Lt.counterClockwise="counter-clockwise",Lt.random="random",t.LimitMode=void 0,(Ft=t.LimitMode||(t.LimitMode={})).delete="delete",Ft.wait="wait",t.OutMode=void 0,(Bt=t.OutMode||(t.OutMode={})).bounce="bounce",Bt.none="none",Bt.out="out",Bt.destroy="destroy",Bt.split="split",t.AlterType=void 0,(Ut=t.AlterType||(t.AlterType={})).darken="darken",Ut.enlighten="enlighten",t.GradientType=void 0,(Vt=t.GradientType||(t.GradientType={})).linear="linear",Vt.radial="radial",Vt.random="random",t.ParticleOutType=void 0,($t=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",$t.inside="inside",$t.outside="outside",t.EasingType=void 0,(qt=t.EasingType||(t.EasingType={})).easeInBack="ease-in-back",qt.easeInBounce="ease-in-bounce",qt.easeInCirc="ease-in-circ",qt.easeInCubic="ease-in-cubic",qt.easeInElastic="ease-in-elastic",qt.easeInExpo="ease-in-expo",qt.easeInGaussian="ease-in-gaussian",qt.easeInLinear="ease-in-linear",qt.easeInQuad="ease-in-quad",qt.easeInQuart="ease-in-quart",qt.easeInQuint="ease-in-quint",qt.easeInSigmoid="ease-in-sigmoid",qt.easeInSine="ease-in-sine",qt.easeInSmoothstep="ease-in-smoothstep",qt.easeOutBack="ease-out-back",qt.easeOutBounce="ease-out-bounce",qt.easeOutCirc="ease-out-circ",qt.easeOutCubic="ease-out-cubic",qt.easeOutElastic="ease-out-elastic",qt.easeOutExpo="ease-out-expo",qt.easeOutGaussian="ease-out-gaussian",qt.easeOutLinear="ease-out-linear",qt.easeOutQuad="ease-out-quad",qt.easeOutQuart="ease-out-quart",qt.easeOutQuint="ease-out-quint",qt.easeOutSigmoid="ease-out-sigmoid",qt.easeOutSine="ease-out-sine",qt.easeOutSmoothstep="ease-out-smoothstep",qt.easeInOutBack="ease-in-out-back",qt.easeInOutBounce="ease-in-out-bounce",qt.easeInOutCirc="ease-in-out-circ",qt.easeInOutCubic="ease-in-out-cubic",qt.easeInOutElastic="ease-in-out-elastic",qt.easeInOutExpo="ease-in-out-expo",qt.easeInOutGaussian="ease-in-out-gaussian",qt.easeInOutLinear="ease-in-out-linear",qt.easeInOutQuad="ease-in-out-quad",qt.easeInOutQuart="ease-in-out-quart",qt.easeInOutQuint="ease-in-out-quint",qt.easeInOutSigmoid="ease-in-out-sigmoid",qt.easeInOutSine="ease-in-out-sine",qt.easeInOutSmoothstep="ease-in-out-smoothstep";class Qt{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(t){R(t)||(void 0!==t.count&&(this.count=N(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=N(t.speed)),void 0!==t.decay&&(this.decay=N(t.decay)),void 0!==t.delay&&(this.delay=N(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class jt extends Qt{mode;startValue;constructor(){super(),this.mode=t.AnimationMode.auto,this.startValue=t.StartValueType.random}load(t){super.load(t),R(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.startValue&&(this.startValue=t.startValue))}}class Gt extends Qt{max;min;offset;constructor(t,e){super(),this.min=t,this.max=e,this.offset=0,this.sync=!0}load(t){super.load(t),R(t)||(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.offset&&(this.offset=N(t.offset)))}}class Xt{h=new Gt(0,y);l=new Gt(0,P);s=new Gt(0,v);load(t){R(t)||(this.h.load(t.h),this.s.load(t.s),this.l.load(t.l))}}class Yt{value;constructor(){this.value=""}static create(t,e){const i=new Yt;return i.load(t),void 0!==e&&(O(e)||k(e)?i.load({value:e}):i.load(e)),i}load(t){R(t)||R(t.value)||(this.value=t.value)}}class Zt extends Yt{animation;constructor(){super(),this.animation=new Xt}static create(t,e){const i=new Zt;return i.load(t),void 0!==e&&(O(e)||k(e)?i.load({value:e}):i.load(e)),i}load(t){if(super.load(t),R(t))return;const e=t.animation;void 0!==e&&(void 0===e.enable?this.animation.load(t.animation):this.animation.h.load(e))}}class Jt{color;image;opacity;position;repeat;size;constructor(){this.color=new Yt,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(t){R(t)||(void 0!==t.color&&(this.color=Yt.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image),void 0!==t.position&&(this.position=t.position),void 0!==t.repeat&&(this.repeat=t.repeat),void 0!==t.size&&(this.size=t.size),void 0!==t.opacity&&(this.opacity=t.opacity))}}class Kt{enable;zIndex;constructor(){this.enable=!0,this.zIndex=0}load(t){R(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.zIndex&&(this.zIndex=t.zIndex))}}class te{delay;enable;constructor(){this.delay=.5,this.enable=!0}load(t){R(t)||(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.enable&&(this.enable=t.enable))}}class ee{close;options;type;constructor(){this.close=!0,this.options={},this.type=[]}load(t){if(R(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=yt(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class ie{color;enable;opacity;constructor(){this.enable=!0,this.opacity=1}load(t){R(t)||(void 0!==t.color&&(this.color=Zt.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.opacity&&(this.opacity=N(t.opacity)))}}class se{offset;value;constructor(){this.offset=0,this.value=90}load(t){R(t)||(void 0!==t.offset&&(this.offset=N(t.offset)),void 0!==t.value&&(this.value=N(t.value)))}}class ne{mode;radius;x;y;constructor(){this.x=50,this.y=50,this.mode=t.PixelMode.percent,this.radius=0}load(t){R(t)||(void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.radius&&(this.radius=t.radius))}}class ae{acceleration;enable;inverse;maxSpeed;constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(t){R(t)||(void 0!==t.acceleration&&(this.acceleration=N(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.inverse&&(this.inverse=t.inverse),void 0!==t.maxSpeed&&(this.maxSpeed=N(t.maxSpeed)))}}class oe{value;constructor(){this.value=0}load(t){R(t)||R(t.value)||(this.value=N(t.value))}}class re extends oe{animation=new Qt;load(t){if(super.load(t),R(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class le{clamp;delay;enable;generator;options;constructor(){this.clamp=!0,this.delay=new oe,this.enable=!1,this.options={}}load(t){R(t)||(void 0!==t.clamp&&(this.clamp=t.clamp),this.delay.load(t.delay),void 0!==t.enable&&(this.enable=t.enable),this.generator=t.generator,t.options&&(this.options=yt(this.options,t.options)))}}class ce{bottom;default;left;right;top;constructor(){this.default=t.OutMode.out}load(t){R(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 he{acceleration;enable;position;constructor(){this.acceleration=0,this.enable=!1}load(t){R(t)||(void 0!==t.acceleration&&(this.acceleration=N(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),t.position&&(this.position=yt({},t.position)))}}class ue{angle;center;decay;direction;distance;drift;enable;gravity;outModes;path;random;size;speed;spin;straight;vibrate;warp;constructor(){this.angle=new se,this.center=new ne,this.decay=0,this.distance={},this.direction=t.MoveDirection.none,this.drift=0,this.enable=!1,this.gravity=new ae,this.path=new le,this.outModes=new ce,this.random=!1,this.size=!1,this.speed=2,this.spin=new he,this.straight=!1,this.vibrate=!1,this.warp=!1}load(t){if(R(t))return;this.angle.load(C(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),void 0!==t.decay&&(this.decay=N(t.decay)),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.distance&&(this.distance=C(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),void 0!==t.drift&&(this.drift=N(t.drift)),void 0!==t.enable&&(this.enable=t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(D(e)?this.outModes.load(e):this.outModes.load({default:e})),this.path.load(t.path),void 0!==t.random&&(this.random=t.random),void 0!==t.size&&(this.size=t.size),void 0!==t.speed&&(this.speed=N(t.speed)),this.spin.load(t.spin),void 0!==t.straight&&(this.straight=t.straight),void 0!==t.vibrate&&(this.vibrate=t.vibrate),void 0!==t.warp&&(this.warp=t.warp)}}class de{color;opacity;width;constructor(){this.width=0}load(t){R(t)||(void 0!==t.color&&(this.color=Zt.create(this.color,t.color)),void 0!==t.width&&(this.width=N(t.width)),void 0!==t.opacity&&(this.opacity=N(t.opacity)))}}class pe{color;fill;stroke;load(t){R(t)||(void 0!==t.color&&(this.color=Zt.create(this.color,t.color)),void 0!==t.fill&&(this.fill??=new ie,this.fill.load(t.fill)),void 0!==t.stroke&&(this.stroke??=new de,this.stroke.load(t.stroke)))}}class fe extends oe{constructor(){super(),this.value=1}}class ge{horizontal;vertical;constructor(){this.horizontal=new fe,this.vertical=new fe}load(t){R(t)||(this.horizontal.load(t.horizontal),this.vertical.load(t.vertical))}}class me{enable;height;width;constructor(){this.enable=!1,this.width=1920,this.height=1080}load(t){if(R(t))return;void 0!==t.enable&&(this.enable=t.enable);const e=t.width;void 0!==e&&(this.width=e);const i=t.height;void 0!==i&&(this.height=i)}}class ye{mode;value;constructor(){this.mode=t.LimitMode.delete,this.value=0}load(t){R(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class ve{density;limit;value;constructor(){this.density=new me,this.limit=new ye,this.value=0}load(t){R(t)||(this.density.load(t.density),this.limit.load(t.limit),void 0!==t.value&&(this.value=t.value))}}class Pe{close;options;type;constructor(){this.close=!0,this.options={},this.type="circle"}load(t){if(R(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=yt(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class we extends oe{opacityRate;sizeRate;velocityRate;constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(t){super.load(t),R(t)||(void 0!==t.opacityRate&&(this.opacityRate=t.opacityRate),void 0!==t.sizeRate&&(this.sizeRate=t.sizeRate),void 0!==t.velocityRate&&(this.velocityRate=t.velocityRate))}}class be{bounce;effect;groups;move;number;paint;palette;reduceDuplicates;shape;zIndex;#d;#p;constructor(t,e){this.#p=t,this.#d=e,this.bounce=new ge,this.effect=new ee,this.groups={},this.move=new ue,this.number=new ve,this.paint=new pe,this.paint.color=new Zt,this.paint.color.value="#fff",this.paint.fill=new ie,this.paint.fill.enable=!0,this.reduceDuplicates=!1,this.shape=new Pe,this.zIndex=new we}load(t){if(R(t))return;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]=yt(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&&(k(e)?this.paint=vt(e,t=>{const e=new pe;return e.load(t),e}):k(this.paint)?(this.paint=new pe,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.zIndex.load(t.zIndex),this.#d){for(const e of this.#p.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this.#d,this,t);const e=this.#p.updaters.get(this.#d);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=(k(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 xe(t,...e){for(const i of e)t.load(i)}function Me(t,e,...i){const s=new be(t,e);return xe(s,...i),s}class ze{autoPlay;background;clear;defaultThemes;delay;detectRetina;duration;fpsLimit;fullScreen;hdr;key;name;palette;particles;pauseOnBlur;pauseOnOutsideViewport;preset;resize;smooth;style;zLayers;#d;#p;constructor(t,e){this.#p=t,this.#d=e,this.autoPlay=!0,this.background=new Jt,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new Kt,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.hdr=!0,this.particles=Me(this.#p,this.#d),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.resize=new te,this.smooth=!1,this.style={},this.zLayers=100}load(t){if(R(t))return;void 0!==t.preset&&(this.preset=t.preset,vt(this.preset,t=>{this.#g(t)})),void 0!==t.palette&&(this.palette=t.palette,this.#f(this.palette)),void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.clear&&(this.clear=t.clear),void 0!==t.key&&(this.key=t.key),void 0!==t.name&&(this.name=t.name),void 0!==t.delay&&(this.delay=N(t.delay));const e=t.detectRetina;void 0!==e&&(this.detectRetina=e),void 0!==t.duration&&(this.duration=N(t.duration));const i=t.fpsLimit;void 0!==i&&(this.fpsLimit=i),void 0!==t.hdr&&(this.hdr=t.hdr),void 0!==t.pauseOnBlur&&(this.pauseOnBlur=t.pauseOnBlur),void 0!==t.pauseOnOutsideViewport&&(this.pauseOnOutsideViewport=t.pauseOnOutsideViewport),void 0!==t.zLayers&&(this.zLayers=t.zLayers),this.background.load(t.background);const s=t.fullScreen;I(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.particles.load(t.particles),this.resize.load(t.resize),this.style=yt(this.style,t.style),void 0!==t.smooth&&(this.smooth=t.smooth),this.#p.plugins.forEach(e=>{e.loadOptions(this.#d,this,t)})}#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))}}function Se(t,e,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(l.x,l.y,e.width,e.height)}function Ie(t,e,i,s){if(!i)return;const n=t.globalAlpha;t.globalAlpha=s,t.drawImage(i,l.x,l.y,e.width,e.height),t.globalAlpha=n}function Oe(t,e){t.clearRect(l.x,l.y,e.width,e.height)}function Ce(t){const{container:e,context:i,particle:s,delta:n,colorStyles:a,radius:o,opacity:r,transform:l}=t,{effectDrawers:c,shapeDrawers:h}=e,u=s.getPosition(),d=s.getTransformData(l),p={x:u.x,y:u.y};i.setTransform(d.a,d.b,d.c,d.d,u.x,u.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:o,drawRadius:1*o,opacity:r,delta:n,pixelRatio:e.retina.pixelRatio,fill:f,stroke:g>0,transformData:d,position:{...u},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;ke(y,m),Te(v,m),Re(v,m),_e(v,m),De(y,m),i.resetTransform()}function De(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}function ke(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}function Re(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())}function _e(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}function Te(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}function Ee(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}const Ae=new Map;function Le(t,e){let i=Ae.get(t);if(!i){if(i=e(),Ae.size>=1e3){[...Ae.keys()].slice(0,500).forEach(t=>Ae.delete(t))}Ae.set(t,i)}return i}function Fe(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function Be(t,e,i,s=!0){if(!e)return;const n=O(e)?{value:e}:e;if(O(n.value))return Ue(t,n.value,i,s);if(k(n.value)){const e=ft(n.value,i,s);if(!e)return;return Be(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function Ue(t,e,i,s=!0){if(!e)return;const n=O(e)?{value:e}:e;if(O(n.value))return n.value===h?We():qe(t,n.value);if(k(n.value)){const e=ft(n.value,i,s);if(!e)return;return Ue(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function Ve(t,e,i,s=!0){const n=Be(t,e,i,s);return n?$e(n):void 0}function $e(t){const e=t.r/m,i=t.g/m,s=t.b/m,n=Math.max(e,i,s),a=Math.min(e,i,s),r={h:0,l:(n+a)*o,s:0};return n!==a&&(r.s=r.l<o?(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*=P,r.s*=v,r.h*=60,r.h<0&&(r.h+=y),r.h>=y&&(r.h-=y),r}function qe(t,e){return Fe(t,e)}function He(t){const e=(t.h%y+y)%y,i=Math.max(0,Math.min(v,t.s)),s=Math.max(0,Math.min(P,t.l)),n=e/y,a=i/v,r=s/P;if(0===i){const t=Math.round(r*m);return{r:t,g:t,b:t}}const l=(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},c=r<o?r*(1+a):r+a-r*a,h=2*r-c,u=1/3,d=Math.min(m,m*l(h,c,n+u)),p=Math.min(m,m*l(h,c,n)),f=Math.min(m,m*l(h,c,n-u));return{r:Math.round(d),g:Math.round(p),b:Math.round(f)}}function We(t){const e=t??0,i=()=>Math.floor(L(e,256));return{b:i(),g:i(),r:i()}}function Ne(t,e,i){const s=i??1;return Le(`rgb-${t.r.toFixed(2)}-${t.g.toFixed(2)}-${t.b.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?Qe(t,i):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(t,i))}function Qe(t,e){return`color(display-p3 ${(t.r/m).toString()} ${(t.g/m).toString()} ${(t.b/m).toString()} / ${(e??1).toString()})`}function je(t,e,i){const s=i??1;return Le(`hsl-${t.h.toFixed(2)}-${t.s.toFixed(2)}-${t.l.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?function(t,e){return Qe(He(t),e)}(t,i):function(t,e){return`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${(e??1).toString()})`}(t,i))}function Ge(t,e,i,s){let n=t,a=e;return"r"in n||(n=He(t)),"r"in a||(a=He(e)),{b:V(n.b,a.b,i,s),g:V(n.g,a.g,i,s),r:V(n.r,a.r,i,s)}}function Xe(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function Ye(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=q(i.speed)/a*s,e.decay=1-q(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=q(i.count),e.time=0,e.delayTime=q(i.delay)*r,i.sync||(e.velocity*=A(),e.value*=A()),e.initialValue=e.value,e.offset=N(i.offset)):e.velocity=0}function Ze(e,i,s){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 n=e.offset?$(e.offset):0,a=(e.velocity??0)*s.factor+3.6*n,o=e.decay??1,r=e.max,l=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=a,e.value<l&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=a,e.value>r&&(e.loops??=0,e.loops++,i?e.status=t.AnimationStatus.decreasing:e.value-=r)),e.velocity&&1!==o&&(e.velocity*=o),e.value=U(e.value,l,r)}function Je(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const Ke=new Et,ti=globalThis;ti.__tsParticlesInternals=ti.__tsParticlesInternals??{},ti.tsParticles=Ke;function ei(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class ii{#m;#y;#v;#P;#w;#d;#b;#x;#M;#z;#S;#I;#O;#C;#p;#D;#k;#R={};#_=[void 0,void 0];#T={};constructor(t,e,i){this.#p=t,this.#d=e,this.#y=i,this.#b=null,this.#k=[],this.#D=[],this.#w=[],this.#m=[],this.#v=[],this.#P=[],this.#M=[],this.#z=[],this.#S=[],this.#I=[],this.#C=[],this.#O=[]}get settings(){return this.#x}canvasClear(){this.#d.actualOptions.clear&&this.draw(t=>{Oe(t,this.#y.size)})}clear(){let t=!1;for(const e of this.#m)if(t=e.canvasClear?.()??!1,t)break;t||this.canvasClear()}destroy(){this.stop(),this.#k=[],this.#D=[],this.#w=[],this.#m=[],this.#v=[],this.#P=[],this.#M=[],this.#z=[],this.#S=[],this.#I=[],this.#C=[],this.#O=[]}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,o]=this.#E(t);if(a??=s,o??=n,!a&&!o)return;const r=this.#d,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:h,opacity:u,strokeOpacity:d}=t.getOpacity(),p=this.#T,f=this.#R,g=a?je(a,r.hdr,h*u):void 0,m=o?je(o,r.hdr,d*u):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.#A(s,t,i,u,f,p),Ce({container:r,context:s,particle:t,delta:e,colorStyles:f,radius:i*c**l.sizeRate,opacity:u,transform:p}),this.#L(t);for(const i of this.#z)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this.#M)Ee(i,s,t,e)})}drawParticles(t){const{particles:e}=this.#d;this.clear(),e.update(t),this.draw(i=>{for(const e of this.#C)e.drawSettingsSetup?.(i,t);for(const e of this.#I)e.draw?.(i,t);e.drawParticles(t);for(const e of this.#P)e.clearDraw?.(i,t);for(const e of this.#O)e.drawSettingsCleanup?.(i,t)})}init(){this.initUpdaters(),this.initPlugins(),this.paint()}initPlugins(){this.#w=[],this.#m=[],this.#v=[],this.#P=[],this.#M=[],this.#S=[],this.#z=[],this.#I=[],this.#C=[],this.#O=[];for(const t of this.#d.plugins)(t.particleFillColor??t.particleStrokeColor)&&this.#w.push(t),t.canvasClear&&this.#m.push(t),t.canvasPaint&&this.#v.push(t),t.drawParticle&&this.#M.push(t),t.drawParticleSetup&&this.#S.push(t),t.drawParticleCleanup&&this.#z.push(t),t.draw&&this.#I.push(t),t.drawSettingsSetup&&this.#C.push(t),t.drawSettingsCleanup&&this.#O.push(t),t.clearDraw&&this.#P.push(t)}initUpdaters(){this.#k=[],this.#D=[];for(const t of this.#d.particleUpdaters)t.afterDraw&&this.#D.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#k.push(t)}paint(){let t=!1;for(const e of this.#v)if(t=e.canvasPaint?.()??!1,t)break;t||this.paintBase()}paintBase(t){this.draw(e=>{Se(e,this.#y.size,t)})}paintImage(t,e){this.draw(i=>{Ie(i,this.#y.size,t,e)})}setContext(t){this.#b=t,this.#b&&(this.#b.globalCompositeOperation=i)}setContextSettings(t){this.#x=t}stop(){this.draw(t=>{Oe(t,this.#y.size)})}#L=t=>{for(const e of this.#D)e.afterDraw?.(t)};#A=(t,e,i,s,n,a)=>{for(const o of this.#k){if(o.getColorStyles){const{fill:a,stroke:r}=o.getColorStyles(e,t,i,s);a&&(n.fill=a),r&&(n.stroke=r)}if(o.getTransformValues){const t=o.getTransformValues(e);for(const e in t)ei(a,t,e)}o.beforeDraw?.(e)}};#E=t=>{let e,i;for(const s of this.#w)if(!e&&s.particleFillColor&&(e=Ve(this.#p,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=Ve(this.#p,s.particleStrokeColor(t))),e&&i)break;return this.#_[0]=e,this.#_[1]=i,this.#_}}const si=new WeakMap;function ni(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 ai{domElement;render;renderCanvas;size;zoom=1;#d;#F;#B;#U;#p;#V;#$;#q;#H;constructor(t,e){this.#p=t,this.#d=e,this.render=new ii(t,e,this),this.#q={height:0,width:0};const i=e.retina.pixelRatio,s=this.#q;this.size={height:s.height*i,width:s.width*i},this.#F=!1,this.#$=[],this.#V="none"}get#W(){return this.#d.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this.#F){const t=this.domElement;t?.remove(),this.domElement=void 0,this.renderCanvas=void 0}else this.#N();this.render.destroy(),this.#$=[]}getZoomCenter(){const t=this.#d.retina.pixelRatio,{width:e,height:i}=this.size;return this.#H?this.#H:{x:e*o/t,y:i*o/t}}init(){this.#Q(t=>{t.disconnect()}),this.#B=ut(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this.#j()}),this.resize(),this.#G(),this.initBackground(),this.#Q(t=>{const e=this.domElement;e&&e instanceof Node&&t.observe(e,{attributes:!0})}),this.initPlugins(),this.render.init()}initBackground(){const t=this.#d,e=t.actualOptions.background,i=this.domElement;if(!i)return;const s=i.style,n=Be(this.#p,e.color);s.backgroundColor=n?Ne(n,t.hdr,e.opacity):"",s.backgroundImage=e.image||"",s.backgroundPosition=e.position||"",s.backgroundRepeat=e.repeat||"",s.backgroundSize=e.size||""}initPlugins(){this.#$=[];for(const t of this.#d.plugins)t.resize&&this.#$.push(t)}loadCanvas(t){this.#F&&this.domElement&&this.domElement.remove();const i=this.#d,s=(t=>"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)(t)?t:void 0;this.domElement=s,this.#F=!!s&&"true"===s.dataset[e],this.renderCanvas=s?(t=>{const e=si.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 si.set(t,e),e}catch{throw new TypeError("OffscreenCanvas transfer failed")}})(s):t;const n=this.domElement;n&&(n.ariaHidden="true",this.#U=xt(n.style));const a=this.#q,o=this.renderCanvas;n?(a.height=n.offsetHeight,a.width=n.offsetWidth):(a.height=o.height,a.width=o.width);const r=this.#d.retina.pixelRatio,l=this.size;o.height=l.height=a.height*r,o.width=l.width=a.width*r;const c=ht("(color-gamut: p3)");this.render.setContextSettings({alpha:!0,colorSpace:c?.matches&&i.hdr?"display-p3":"srgb",desynchronized:!0,willReadFrequently:!1}),this.render.setContext(o.getContext("2d",this.render.settings)),this.#Q(t=>{t.disconnect()}),i.retina.init(),this.initBackground(),this.#Q(t=>{const e=this.domElement;e&&e instanceof Node&&t.observe(e,{attributes:!0})})}resize(){const t=this.domElement;if(!t)return!1;const e=this.#d,i=this.renderCanvas;if(void 0===i)return!1;const s=e.canvas.#q,n={width:t.offsetWidth,height:t.offsetHeight},a=e.retina.pixelRatio,o={width:n.width*a,height:n.height*a};if(n.height===s.height&&n.width===s.width&&o.height===i.height&&o.width===i.width)return!1;const r={...s};s.height=n.height,s.width=n.width;const l=this.size;return i.width=l.width=o.width,i.height=l.height=o.height,this.#d.started&&e.particles.setResizeFactor({width:s.width/r.width,height:s.height/r.height}),!0}setPointerEvents(t){this.domElement&&(this.#V=t,this.#j())}setZoom(t,e){this.zoom=t,this.#H=e}stop(){this.#Q(t=>{t.disconnect()}),this.#B=void 0,this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#d,e=t.updateActualOptions();t.particles.setDensity(),this.#X(),e&&await t.refresh()}#X=()=>{for(const t of this.#$)t.resize?.()};#G=()=>{const t=this.domElement,e=this.#d.actualOptions;if(t){this.#W?this.#Y():this.#N();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")}}};#j=()=>{const t=this.domElement;if(!t)return;this.#Q(t=>{t.disconnect()}),this.#G(),this.initBackground();const e=this.#V;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this.#Q(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})};#N=()=>{const t=this.domElement,e=this.#U;t&&e&&ni(t,e,!0)};#Q=t=>{this.#B&&t(this.#B)};#Y=()=>{const t=this.domElement;t&&ni(t,Mt(this.#d.actualOptions.fullScreen.zIndex),!0)}}class oi{#d;#Z;#J;#K;constructor(t){this.#d=t,this.#Z={visibilityChange:()=>{this.#tt()},resize:()=>{this.#et()}}}addListeners(){this.#it(!0)}removeListeners(){this.#it(!1)}#tt=()=>{const t=this.#d;t.actualOptions.pauseOnBlur&&(ct().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))};#et=()=>{this.#K&&(clearTimeout(this.#K),this.#K=void 0);const t=async()=>{const t=this.#d.canvas;await t.windowResize()};this.#K=setTimeout(()=>{t()},this.#d.actualOptions.resize.delay*r)};#it=t=>{const e=this.#Z;this.#st(t),zt(document,n,e.visibilityChange,t,!1)};#st=t=>{const e=this.#Z,i=this.#d;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void zt(globalThis,s,e.resize,t);const n=i.canvas.domElement;this.#J&&!t?(n&&this.#J.unobserve(n),this.#J.disconnect(),this.#J=void 0):!this.#J&&t&&n&&(this.#J=new ResizeObserver(t=>{t.find(t=>t.target===n)&&this.#et()}),this.#J.observe(n))}}function ri(t){if(!dt(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)}class li{backColor;bubble;destroyed;direction;effect;effectClose;effectData;fillColor;fillEnabled;fillOpacity;group;id;ignoresResizeRatio;initialPosition;initialVelocity;isRotating;justWarped;lastPathTime;misplaced;moveCenter;offset;opacity;options;outType;pathRotation;position;randomIndexData;retina;roll;rotation;shape;shapeClose;shapeData;sides;size;slow;spawning;strokeColor;strokeOpacity;strokeWidth;unbreakable;velocity;zIndexFactor;#nt={fillOpacity:1,opacity:1,strokeOpacity:1};#at=z.origin;#ot={sin:0,cos:0};#rt={a:1,b:0,c:0,d:1};#d;#p;constructor(t,e){this.#p=t,this.#d=e}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const i=this.#d,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.#d.dispatchEvent(t.EventType.particleDestroyed,{particle:this})}draw(t){const e=this.#d.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this.#lt(this.bubble.color??Xe(this.fillColor))}getMass(){return this.getRadius()**2*Math.PI*o}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=this.bubble.opacity??q(this.opacity?.value??1),s=this.fillOpacity??1,n=this.strokeOpacity??1;return this.#nt.fillOpacity=i*s*e,this.#nt.opacity=i*e,this.#nt.strokeOpacity=i*n*e,this.#nt}getPosition(){return this.#at.x=this.position.x+this.offset.x,this.#at.y=this.position.y+this.offset.y,this.#at.z=this.position.z,this.#at}getRadius(){return this.bubble.radius??this.size.value}getRotateData(){const t=this.getAngle();return this.#ot.sin=Math.sin(t),this.#ot.cos=Math.cos(t),this.#ot}getStrokeColor(){return this.#lt(this.bubble.color??Xe(this.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this.#rt.a=e.cos*(t.a??c.a),this.#rt.b=i?e.sin*(t.b??1):t.b??c.b,this.#rt.c=i?-e.sin*(t.c??1):t.c??c.c,this.#rt.d=e.cos*(t.d??c.d),this.#rt}init(e,i,s,n){const a=this.#d;this.id=e,this.group=n,this.justWarped=!1,this.effectClose=!0,this.shapeClose=!0,this.pathRotation=!1,this.lastPathTime=0,this.destroyed=!1,this.unbreakable=!1,this.isRotating=!1,this.rotation=0,this.misplaced=!1,this.retina={maxDistance:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},this.size={value:1,max:1,min:1,enable:!1},this.outType=t.ParticleOutType.normal,this.ignoresResizeRatio=!0;const o=a.actualOptions,r=Me(this.#p,a,o.particles),l=r.reduceDuplicates,c=r.effect.type,u=r.shape.type;this.effect=Pt(c,this.id,l),this.shape=Pt(u,this.id,l);const d=r.effect,p=r.shape;if(s){if(s.effect?.type&&s.effect.type!==this.effect){const t=Pt(s.effect.type,this.id,l);t&&(this.effect=t,d.load(s.effect))}if(s.shape?.type&&s.shape.type!==this.shape){const t=Pt(s.shape.type,this.id,l);t&&(this.shape=t,p.load(s.shape))}}if(this.effect===h){const t=[...this.#d.effectDrawers.keys()];this.effect=t[Math.floor(A()*t.length)]}if(this.shape===h){const t=[...this.#d.shapeDrawers.keys()];this.shape=t[Math.floor(A()*t.length)]}this.effectData=this.effect?function(t,e,i,s){const n=e.options[t];return yt({close:e.close},Pt(n,i,s))}(this.effect,d,this.id,l):void 0,this.shapeData=this.shape?function(t,e,i,s){const n=e.options[t];return yt({close:e.close},Pt(n,i,s))}(this.shape,p,this.id,l):void 0,r.load(s);const f=this.effectData,g=this.shapeData;f&&r.load(f.particles),g&&r.load(g.particles),this.effectClose=f?.close??r.effect.close,this.shapeClose=g?.close??r.shape.close,this.options=r,a.retina.initParticle(this);for(const t of a.particleUpdaters)t.preInit?.(this);let m,y;this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this.#ct(i),this.initialVelocity=this.#ht(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/a.zLayers,this.sides=24,this.effect&&(m=a.effectDrawers.get(this.effect)),m?.loadEffect&&m.loadEffect(this),this.shape&&(y=a.shapeDrawers.get(this.shape)),y?.loadShape&&y.loadShape(this);const v=y?.getSidesCount;v&&(this.sides=v(this)),this.spawning=!1;for(const t of a.particleUpdaters)t.init(this);m?.parti