@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 • 78.9 kB
JavaScript
!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 r(){return s}var a;t.MoveDirection=void 0,(a=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",a.bottomLeft="bottom-left",a.bottomRight="bottom-right",a.left="left",a.none="none",a.right="right",a.top="top",a.topLeft="top-left",a.topRight="top-right",a.outside="outside",a.inside="inside";const 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,k=100,C=.25,O=.75,L=1e4,I=400;function D(t){return"z"in t?t.z:g.z}class R{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 R.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 R.create(t.x,t.y,D(t))}static create(t,e,i){return"number"==typeof t?new R(t,e??g.y,i??g.z):new R(t.x,t.y,D(t))}add(t){return R.create(this.x+t.x,this.y+t.y,this.z+D(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=D(t)}copy(){return R.clone(this)}div(t){return R.create(this.x/t,this.y/t,this.z/t)}getLengthSq(){return this.x*this.x+this.y*this.y}mult(t){return R.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 R.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=D(t)}sub(t){return R.create(this.x-t.x,this.y-t.y,this.z-D(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=D(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class _ extends R{constructor(t=g.x,e=g.y){super(t,e,g.z)}static get origin(){return _.create(g.x,g.y)}static clone(t){return _.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new _(t,e??g.y):new _(t.x,t.y)}}function E(t){return"boolean"==typeof t}function T(t){return"string"==typeof t}function F(t){return"number"==typeof t}function A(t,e){return Object.values(t).some(t=>t===e)}function B(t,e,i){return A(t,e)?e:i}function H(t){return"object"==typeof t&&null!==t}function U(t){return Array.isArray(t)}function V(t){return null==t}const N=Math.PI/180;let $=Math.random;const q={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function W(t=Math.random){$=t}function j(){return $}function G(){return Z($(),0,1-Number.EPSILON)}function X(t,e){return G()*(e-t)+t}function Y(t){return q.nextFrame(t)}function Q(t){q.cancel(t)}function Z(t,e,i){return Math.min(Math.max(t,e),i)}function K(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function J(t){const e=it(t);let i=et(t);return e===i&&(i=0),X(i,e)}function tt(t){return F(t)?t:J(t)}function et(t){return F(t)?t:t.min}function it(t){return F(t)?t:t.max}function st(t,e){if(t===e||void 0===e&&F(t))return t;const i=et(t),s=it(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:st(i,s)}function nt(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function rt(t,e,i){return nt(t,e)<=i*i}function at(t){return t*N}function ot(e,i,s){if(F(e))return at(e);switch(e){case t.MoveDirection.top:return-Math.PI*p;case t.MoveDirection.topRight:return-Math.PI*C;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*C;case t.MoveDirection.bottom:return Math.PI*p;case t.MoveDirection.bottomLeft:return Math.PI*O;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*O;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 G()*P}}function lt(t){const e=_.origin;return e.length=1,e.angle=t,e}function ct(t,e,i,s){return _.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function ht(t){return{x:(t.position?.x??G()*u)*t.size.width/u,y:(t.position?.y??G()*u)*t.size.height/u}}function dt(t){const{position:e,size:i}=t;return{x:e?.x??G()*i.width,y:e?.y??G()*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||U(e)&&e.includes(t)}function bt(t,e,i=!0){return t[void 0!==e&&i?e%t.length:Math.floor(G()*t.length)]}function Mt(e,i,s,n){let r=!0;return n&&n!==t.OutModeDirection.bottom||(r=e.top<i.height+s.x),!r||n&&n!==t.OutModeDirection.left||(r=e.right>s.x),!r||n&&n!==t.OutModeDirection.right||(r=e.left<i.width+s.y),!r||n&&n!==t.OutModeDirection.top||(r=e.bottom>s.y),r}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(V(i))continue;if(!H(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):H(t)&&!Array.isArray(t)||(t=Object.create(null));const e=Object.keys(i);if(!e.some(t=>{const e=i[t];return H(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 U(t)?t.map((t,i)=>e(t,i)):e(t,0)}function kt(t,e,i){return U(t)?bt(t,e,i):t}function Ct(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 Ot(t){const e=yt().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||V(s))continue;const n=t.getPropertyValue?.(s);if(!n)continue;const r=t.getPropertyPriority?.(s);r?e.setProperty(s,n,r):e.setProperty(s,n)}return e}let Lt,It;function Dt(t){if(Lt!==t||!It){Lt=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};E(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 Et(t,e){const i=await Promise.all([...e.entries()].map(([e,i])=>i(t).then(t=>[e,t])));return new Map(i)}async function Tt(t){const e=kt(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(U(t))return t.every(t=>H(t)&&!U(t));return H(t)&&!U(t)}(e))return e;r().error("invalid configuration data while retrieving config file")}else r().error(`${t.status.toString()} while retrieving config file`)}catch(t){r().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,Nt,$t,qt,Wt,jt,Gt,Xt,Yt,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;presets=new Map;#i=0;#s=new Set;#n=new Map;#r;#a=new Set;#o=new Set;#l=!1;#c;#h=!1;#d;#u=new Set;#p=[];#f;constructor(t){this.#r=t;const e=new WeakMap,i=()=>this.#i>0?Promise.resolve():t.init();this.#d=new Proxy(t,{get:(t,s)=>{if("init"===s)return i;const n=Reflect.get(t,s,t);if("function"!=typeof n)return n;let r=e.get(n);return r||(r=(...e)=>Reflect.apply(n,t,e),e.set(n,r)),r}})}get configs(){const t={};for(const[e,i]of this.#n)t[e]=i;return t}get initialized(){return this.#l}get plugins(){return this.#f??=Object.freeze([...this.#p])}addColorManager(t,e){this.#g(),this.colorManagers.set(t,e)}addConfig(e){this.#g();const i=e.key??e.name??"default";this.#n.set(i,e),this.#r.dispatchEvent(t.EventType.configAdded,{data:{name:i,config:e}})}addEasing(t,e){this.#g(),this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.#g(),this.initializers.effects.set(t,e)}addPalette(t,e){this.#g(),this.palettes.set(t,e)}addParticleUpdater(t,e){this.#g(),this.initializers.updaters.set(t,e)}addPlugin(t){if(!this.#h)throw new Error(pt(ut.pluginRegisterAfterLoad));this.getPlugin(t.id)||(this.#p.push(t),this.#f=void 0)}addPreset(t,e,i=!1){this.#g(),!i&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){this.#g();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.#p.find(e=>e.id===t)}getPreset(t){return this.presets.get(t)}async init(){if(!this.#l)return this.#c||(this.#c=Promise.resolve().then(async()=>{this.#h=!0,this.#s=new Set(this.#u);try{for(;this.#o.size>0||[...this.#s].some(t=>!this.#a.has(t));){for(const t of this.#s)await this.#m(t,this.#a,this.#s);const t=[...this.#o];t.length&&await Promise.all(t)}this.#u.clear(),this.#l=!0}finally{this.#h=!1,this.#c=void 0}})),this.#c}async register(...t){this.#g();for(const e of t)this.#h?(this.#u.add(e),await this.#m(e,this.#a,this.#s)):this.#u.add(e)}#g(){if(this.#l)throw new Error(pt(ut.pluginRegisterAfterLoad))}async#m(t,e,i){if(e.has(t))return;e.add(t),i.add(t),this.#i++;const s=(async()=>t(this.#d))();this.#o.add(s);try{await s}catch(i){throw e.delete(t),i}finally{this.#i--,this.#o.delete(s)}}}class te{pluginManager=new Jt(this);#y=0;#v=new WeakMap;#P=[];#w=new Bt;#l=!1;#b=0;#M=new Map;get items(){return this.#P}get version(){return"4.6.0"}addEventListener(t,e){this.#w.addEventListener(t,e)}checkVersion(t){if(this.version!==t)throw new Error(pt(ut.engineVersionMismatch,this.version))}dispatchEvent(t,e){this.#w.dispatchEvent(t,e)}async init(){this.#l||(await this.pluginManager.init(),this.#l=!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?this.#x(e):void 0)??`tsparticles${Math.floor(G()*L).toString()}`,s=++this.#b;this.#M.set(i,s);try{await this.init();const{Container:n}=await Promise.resolve().then(function(){return Ei}),{index:r,url:a}=t,o=a?await Tt({fallback:t.options,url:a,index:r}):t.options;if(this.#M.get(i)!==s)return;const l=kt(o,r),{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));d.canvas.loadCanvas(u);try{await d.start()}catch(t){d.destroy(!1);const e=c.indexOf(d);throw e>=0&&c.splice(e,1),t}if(d.destroyed)return;return d}finally{this.#M.get(i)===s&&this.#M.delete(i)}}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this.#w.removeEventListener(t,e)}#z(t){let e=this.#v.get(t);return e||(e=`tsparticles${Math.floor(G()*L).toString()}_${this.#y++}`,this.#v.set(t,e)),e}#x(t){return t.id.length?t.id:this.#z(t)}}!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 rt(t,this.position,this.radius)}intersects(t){const e=this.position,i=t.position,s=this.radius,n=i.x-e.x,r=i.y-e.y;if(t instanceof ie||t.type===Ut.circle){const e=s+t.radius;return e>0&&n*n+r*r<e*e}if(t instanceof se||t.type===Ut.rectangle){const e=t,{width:i,height:a}=e.size,o=Math.abs(n),l=Math.abs(r),c=o-i,h=l-a;return c*c+h*h<=s*s||o<=s+i&&l<=s+a||o<=i||l<=a}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,r=t.size,a=r.width,o=r.height;return n.x<s.x+e&&n.x+a>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 re(t,e,i){void 0!==i&&(t[e]=st(i))}function ae(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,(Nt=t.AnimationMode||(t.AnimationMode={})).auto="auto",Nt.increase="increase",Nt.decrease="decrease",Nt.random="random",t.HdrMode=void 0,($t=t.HdrMode||(t.HdrMode={})).standard="standard",$t.natural="natural",$t.vivid="vivid",$t.cinematic="cinematic",$t.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,(Gt=t.DestroyType||(t.DestroyType={})).none="none",Gt.max="max",Gt.min="min",t.GradientType=void 0,(Xt=t.GradientType||(t.GradientType={})).linear="linear",Xt.radial="radial",Xt.random="random",t.ParticleOutType=void 0,(Yt=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",Yt.inside="inside",Yt.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){V(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){re(this,"count",t.count),ne(this,"enable",t.enable),re(this,"speed",t.speed),re(this,"decay",t.decay),re(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),re(this,"offset",t.offset)}}class pe extends le{h=new ue(0,z);l=new ue(0,k);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)||U(e)?i.load({value:e}):i.load(e)),i}doLoad(t){V(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)||U(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(e.enable))throw new Error(pt(ut.hdrEnableInvalid,String(e.enable)));if(void 0!==e.mode&&!A(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&&(!F(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),re(this,"opacity",t.opacity)}}class Me extends le{offset=0;value=90;doLoad(t){re(this,"offset",t.offset),re(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){re(this,"acceleration",t.acceleration),ne(this,"enable",t.enable),ne(this,"inverse",t.inverse),re(this,"maxSpeed",t.maxSpeed)}}class Se extends le{value=0;doLoad(t){V(t.value)||(this.value=st(t.value))}}class ke extends Se{animation=new he;doLoad(t){super.doLoad(t),ae(this,"animation",t.animation)}}class Ce 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 Oe 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 Le extends le{acceleration=0;enable=!1;position;doLoad(t){re(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 Oe;path=new Ce;random=!1;size=!1;speed=2;spin=new Le;straight=!1;vibrate=!1;warp=!1;doLoad(t){this.angle.load(F(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),re(this,"decay",t.decay),ne(this,"direction",t.direction),void 0!==t.distance&&(this.distance=F(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),re(this,"drift",t.drift),ne(this,"enable",t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(H(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),re(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 De extends le{color;opacity;width=0;doLoad(t){void 0!==t.color&&(this.color=ge.create(this.color,t.color)),re(this,"width",t.width),re(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 De)}}class _e extends Se{value=1}class Ee extends le{horizontal=new _e;vertical=new _e;doLoad(t){this.horizontal.load(t.horizontal),this.vertical.load(t.vertical)}}class Te 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 Te;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 Ee;effect=new we;groups={};move=new Ie;number=new Ae;paint;palette;reduceDuplicates=!1;shape=new Be;zIndex=new He;#S;#k;constructor(t,e){super(),this.#k=t,this.#S=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.#C(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&&(U(e)?this.paint=St(e,t=>{const e=new Re;return e.load(t),e}):U(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.#S){for(const e of this.#k.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this.#S,this,t);const e=this.#S.particleUpdaters;for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}#C(t){const e=this.#k.getPalette(t);if(!e)return;const i=e.colors,s=(U(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 Ne 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;#S;#k;constructor(t,e){super(),this.#k=t,this.#S=e,this.background=new me,this.fullScreen=new ye,this.hdr=new ve,this.particles=Ve(this.#k,this.#S),this.resize=new Pe}doLoad(e){void 0!==e.preset&&(this.preset=e.preset,St(this.preset,t=>{this.#O(t)})),void 0!==e.palette&&(this.palette=e.palette,this.#C(this.palette)),ne(this,"autoPlay",e.autoPlay),ne(this,"clear",e.clear),ne(this,"key",e.key),ne(this,"name",e.name),re(this,"delay",e.delay),ne(this,"detectRetina",e.detectRetina),re(this,"duration",e.duration),ne(this,"fpsLimit",e.fpsLimit);const i=e.hdr;E(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;E(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.#k.plugins.forEach(t=>{t.loadOptions(this.#S,this,e)})}#C(t){const e=this.#k.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})}#O(t){this.load(this.#k.getPreset(t))}}const $e=new Map,qe=1.15,We=1.05,je=.2126,Ge=.7152,Xe=.0722;function Ye(t,e){let i=$e.get(t);return i||(i=e(),$e.size>2e3&&$e.clear(),$e.set(t,i)),i}function Qe(t){return Z(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(U(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(U(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),r=Math.min(e,i,s),a={h:0,l:(n+r)*p,s:0};return n!==r&&(a.s=a.l<p?(n-r)/(n+r):(n-r)/(2-n-r),a.h=e===n?(i-s)/(n-r):i===n?2+(s-e)/(n-r):4+(e-i)/(n-r)),a.l*=k,a.s*=S,a.h*=60,a.h<0&&(a.h+=z),a.h>=z&&(a.h-=z),a}function ni(t,e){return Je(t,e)}function ri(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 ai(t){const e=(t.h%z+z)%z,i=Math.max(0,Math.min(S,t.s)),s=Math.max(0,Math.min(k,t.l)),n=e/z,r=i/S,a=s/k;if(0===i){const t=Math.round(a*x);return{r:t,g:t,b:t}}const o=a<p?a*(1+r):a+r-a*r,l=2*a-o,c=1/3,h=Math.min(x,x*ri(l,o,n+c)),d=Math.min(x,x*ri(l,o,n)),u=Math.min(x,x*ri(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(k,t.l)),n=e/z,r=i/S,a=s/k;if(0===i){const t=a*x;return{r:t,g:t,b:t}}const o=a<p?a*(1+r):a+r-a*r,l=2*a-o,c=1/3;return{r:Math.min(x,x*ri(l,o,n+c)),g:Math.min(x,x*ri(l,o,n)),b:Math.min(x,x*ri(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,r){const a=i?4:2,o=s??1;return Ye(i?`rgb-${e.r.toFixed(a)}-${e.g.toFixed(a)}-${e.b.toFixed(a)}-hdr-${o.toString()}-${(n??I).toString()}-${r??t.HdrMode.standard}`:`rgb-${e.r.toFixed(a)}-${e.g.toFixed(a)}-${e.b.toFixed(a)}-sdr-${o.toString()}`,()=>i?function(e,i,s=400,n=t.HdrMode.standard){const r=s/203,a=function(e,i,s,n){const r=e.r/x,a=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:a,r:r};const l=Math.max(1,i),c=je*r+Ge*a+Xe*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,r){switch(n){case t.HdrMode.vivid:{const t=(e+i+s)/3;return{b:Z(Z(t+(s-t)*qe,0,r)*We,0,r),g:Z(Z(t+(i-t)*qe,0,r)*We,0,r),r:Z(Z(t+(e-t)*qe,0,r)*We,0,r)}}case t.HdrMode.cinematic:{const t=1.05*e,n=.95*s,a=(t+i+n)/3;return{b:Z(a+1.1*(n-a),0,r),g:Z(a+1.1*(i-a),0,r),r:Z(a+1.1*(t-a),0,r)}}case t.HdrMode.dynamic:{const t=je*e+Ge*i+Xe*s,n=Math.min(1,2*t),a=1-n,o=(e+i+s)/3,l=Z(o+(e-o)*qe,0,r)*We,c=Z(o+(i-o)*qe,0,r)*We,h=Z(o+(s-o)*qe,0,r)*We;return{b:Z(s*a+h*n,0,r),g:Z(i*a+c*n,0,r),r:Z(e*a+l*n,0,r)}}case t.HdrMode.standard:case t.HdrMode.natural:default:return{b:s,g:i,r:e}}}(Z(r*d,0,l),Z(a*d,0,l),Z(o*d,0,l),n,l)}(e,r,.18,n);return`color(display-p3 ${a.r.toString()} ${a.g.toString()} ${a.b.toString()} / ${(i??1).toString()})`}(e,s,n,r):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,r){const a=i?4:2,o=s??1;return Ye(i?`hsl-${e.h.toFixed(a)}-${e.s.toFixed(a)}-${e.l.toFixed(a)}-hdr-${o.toString()}-${(n??I).toString()}-${r??t.HdrMode.standard}`:`hsl-${e.h.toFixed(a)}-${e.s.toFixed(a)}-${e.l.toFixed(a)}-sdr-${o.toString()}`,()=>i?ci(oi(e),!0,s,n,r):`hsla(${e.h.toString()}, ${e.s.toString()}%, ${e.l.toString()}%, ${o.toString()})`)}function di(t,e,i,s,n){let r=t,a=e;if("r"in r||(r=n?oi(t):ai(t)),"r"in a||(a=n?oi(e):ai(e)),n){const t={b:Ze(r.b/x),g:Ze(r.g/x),r:Ze(r.r/x)},e={b:Ze(a.b/x),g:Ze(a.g/x),r:Ze(a.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:K(r.b,a.b,i,s),g:K(r.g,a.g,i,s),r:K(r.r,a.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=tt(i.speed)/u*s,e.decay=1-tt(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=tt(i.count),e.time=0,e.delayTime=tt(i.delay)*f,i.sync||(e.velocity*=G(),e.value*=G()),e.initialValue=e.value,e.offset=st(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 r=e.offset?J(e.offset):0,a=(e.velocity??0)*s.factor+3.6*r,o=e.decay??1,l=e.max,c=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=a,e.value<c&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=a,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=Z(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=r,yi.setParticlesLogger=n,yi.getParticlesRandom=G,yi.getParticlesRandomFn=j,yi.setParticlesRandom=W;function vi(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class Pi{#L;#I;#D;#R;#_;#S;#E;#T;#F;#A;#B;#H;#k;#U;#V;#N={};#$=[void 0,void 0];#q={};constructor(t,e,i){this.#k=t,this.#S=e,this.#R=i,this.#E=null,this.#L=null,this.#I=new Set,this.#V=[],this.#U=[],this.#D=[],this.#_=[],this.#F=[],this.#A=[],this.#B=[],this.#H={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[]}}get settings(){return this.#T}canvasClear(){this.#S.actualOptions.clear&&this.draw(t=>{t.clearRect(g.x,g.y,this.#R.size.width,this.#R.size.height)})}clear(){const e=new Set;for(const t of this.#D)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.#W(i))if(!e.has(t)&&(e.add(t),t.canvasClear?.()))return t;this.canvasClear()}destroy(){this.stop(),this.#L=null,this.#I.clear(),this.#V=[],this.#U=[],this.#D=[],this.#_=[],this.#F=[],this.#A=[],this.#B=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#H[e]=[])}draw(t){const e=this.#E;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[r,a]=this.#j(t);if(r??=s,a??=n,!r&&!a)return;const o=this.#S,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:h,opacity:d,strokeOpacity:u}=t.getOpacity(),p=this.#q,f=this.#N,g=r?hi(r,o.hdr,h*d,o.peakNits,o.hdrMode):void 0,m=a?hi(a,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.#B)i.drawParticleSetup?.(s,t,e);this.#G(s,t,i,d,f,p),this.#X({container:o,context:s,particle:t,delta:e,colorStyles:f,radius:i*c**l.sizeRate,opacity:d,transform:p}),this.#Y(t);for(const i of this.#A)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this.#F)this.#Q(i,s,t,e)})}drawParticles(e){const{particles:i,actualOptions:s}=this.#S;this.clear(),i.update(e),this.draw(n=>{const r=this.#R.size.width,a=this.#R.size.height;if(this.#L)try{n.drawImage(this.#L,g.x,g.y,r,a)}catch{this.#Z("background-element-draw-error","Error drawing background element onto canvas")}const o=s.background;if(o.draw)try{o.draw(n,e)}catch{this.#Z("background-draw-error","Error in background.draw callback")}for(const e of this.#W(t.DrawLayer.BackgroundMask))e.canvasPaint?.();for(const i of this.#W(t.DrawLayer.CanvasSetup))i.drawSettingsSetup?.(n,e);for(const i of this.#W(t.DrawLayer.PluginContent))i.draw?.(n,e);i.drawParticles(e);for(const i of this.#W(t.DrawLayer.CanvasCleanup))i.clearDraw?.(n,e),i.drawSettingsCleanup?.(n,e)})}init(){this.initUpdaters(),this.initPlugins(),this.#K(),this.paint()}initPlugins(){this.#D=[],this.#_=[],this.#F=[],this.#B=[],this.#A=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#H[e]=[]);this.#J()}initUpdaters(){this.#V=[],this.#U=[];for(const t of this.#S.particleUpdaters)t.afterDraw&&this.#U.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#V.push(t)}paint(){let e=!1;for(const i of this.#W(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.#R.size.width,this.#R.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.#R.size.width,this.#R.size.height),i.globalAlpha=s})}setContext(t){this.#E=t,this.#E&&(this.#E.globalCompositeOperation=c)}setContextSettings(t){this.#T=t}stop(){this.draw(t=>{t.clearRect(g.x,g.y,this.#R.size.width,this.#R.size.height)})}updateBackgroundElement(){this.#K()}#Y(t){for(const e of this.#U)e.afterDraw?.(t)}#G(t,e,i,s,n,r){for(const a of this.#V){if(a.getColorStyles){const{fill:r,stroke:o}=a.getColorStyles(e,t,i,s);r&&(n.fill=r),o&&(n.stroke=o)}if(a.getTransformValues){const t=a.getTransformValues(e);for(const e in t)vi(r,t,e)}a.beforeDraw?.(e)}}#tt(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}#et(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}#X(t){const{container:e,context:i,particle:s,delta:n,colorStyles:r,radius:a,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),r.fill&&(i.fillStyle=r.fill);const f=!!s.fillEnabled,g=s.strokeWidth??0;i.lineWidth=g,r.stroke&&(i.strokeStyle=r.stroke);const m={context:i,particle:s,radius:a,drawRadius:1*a,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.#et(y,m),this.#it(v,m),this.#st(v,m),this.#nt(v,m),this.#tt(y,m),i.resetTransform()}#Q(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}#st(t,e){if(!t)return;const{context:i,fill:s,particle:n,stroke:r}=e;n.shape&&(i.beginPath(),t.draw(e),n.shapeClose&&i.closePath(),s&&i.fill(),r&&i.stroke())}#nt(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}#it(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}#W(t){return this.#H[t]}#j(t){let e,i;for(const s of this.#_)if(!e&&s.particleFillColor&&(e=ii(this.#k,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=ii(this.#k,s.particleStrokeColor(t))),e&&i)break;return this.#$[0]=e,this.#$[1]=i,this.#$}#rt(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.#H[t].push(e)}#J(){for(const t of this.#S.plugins)(t.particleFillColor??t.particleStrokeColor)&&this.#_.push(t),t.drawParticle&&this.#F.push(t),t.drawParticleSetup&&this.#B.push(t),t.drawParticleCleanup&&this.#A.push(t),t.canvasClear&&this.#D.push(t),this.#rt(t)}#at(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}#K(){const t=this.#S.actualOptions.background;if(this.#L=null,t.element)if("string"==typeof t.element){if("undefined"!=typeof document){let e;try{e=document.querySelector(t.element)}catch{return void this.#Z("background-element-invalid-selector",`Background element selector "${t.element}" is invalid`)}e&&this.#at(e)?this.#L=e:e?this.#Z("background-element-not-supported",`Background element "${t.element}" is not a supported drawable element (canvas, video, or img)`):this.#Z("background-element-not-found",`Background element selector "${t.element}" not found`)}}else this.#at(t.element)&&(this.#L=t.element)}#Z(t,e){this.#I.has(t)||(this.#I.add(t),r().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;#S;#ot;#lt;#ct;#ht;#k;#dt;#ut;#pt;#ft;constructor(t,e){this.#k=t,this.#S=e,this.render=new Pi(t,e,this),this.#pt={height:0,width:0};const i=e.retina.pixelRatio,s=this.#pt;this.size={height:s.height*i,width:s.width*i},this.#ot=!1,this.#ut=[],this.#dt="none"}get#gt(){return this.#S.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this.#ot){const t=this.domElement;t?.remove(),this.domElement=void 0,this.renderCanvas=void 0}else this.#mt();this.render.destroy(),this.#ut=[]}getZoomCenter(){const t=this.#S.retina.pixelRatio,{width:e,height:i}=this.size;return this.#ft?this.#ft:{x:e*p/t,y:i*p/t}}init(){this.#yt(t=>{t.disconnect()}),this.#ct=Pt(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this.#vt()}),this.resize(),this.#Pt(),this.#yt(t=>{const e=this.domElement;e&&e instanceof Node&&t.observe(e,{attributes:!0})}),this.initPlugins(),this.#wt(),this.initBackground(),this.#bt(),this.render.init()}initBackground(){const e=this.#S,i=e.actualOptions.background,s=this.domElement;if(!s)return;const n=s.style,r=ti(this.#k,i.color);if(r){const s=e.actualOptions.hdr;n.backgroundColor=ci(r,e.hdr,i.opacity,s.peakNits,B(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.#ut=[];for(const t of this.#S.plugins)t.resize&&this.#ut.push(t)}loadCanvas(t){this.#ot&&this.domElement&&this.domElement.remove();const e=(t=>"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)(t)?t:void 0;this.domElement=e,this.#ot=!!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.#ht=Ot(i.style));const s=this.#pt,n=this.renderCanvas;i?(s.height=i.offsetHeight,s.width=i.offsetWidth):(s.height=n.height,s.width=n.width);const r=this.#S.retina.pixelRatio,a=this.size;n.height=a.height=s.height*r,n.width=a.width=s.width*r}resize(){const t=this.domElement;if(!t)return!1;const e=this.#S,i=this.renderCanvas;if(void 0===i)return!1;const s=e.canvas.#pt,n={width:t.offsetWidth,height:t.offsetHeight},r=e.retina.pixelRatio,a={width:n.width*r,height:n.height*r};if(n.height===s.height&&n.width===s.width&&a.height===i.height&&a.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=a.width,i.height=l.height=a.height,this.#S.started&&e.particles.setResizeFactor({width:s.width/o.width,height:s.height/o.height}),!0}setPointerEvents(t){this.domElement&&(this.#dt=t,this.#vt())}setZoom(t,e){this.zoom=t,this.#ft=e}stop(){this.#yt(t=>{t.disconnect()}),this.#ct=void 0,this.#Mt(),this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#S,e=t.updateActualOptions();t.particles.setDensity(),this.#xt(),e&&await t.refresh()}#xt(){for(const t of this.#ut)t.resize?.()}#wt(){const e=this.#S,i=e.actualOptions.hdr.enable&&vt("(color-gamut: p3)")?.matches&&vt("(dynamic-range: high)")?.matches;e.hdrMode=B(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)}}#bt(){this.#Mt();const t=vt("(color-gamut: p3)"),e=vt("(dynamic-range: high)"),i=()=>{this.#wt(),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.#lt=s}#Pt(){const t=this.domElement,e=this.#S.actualOptions;if(t){this.#gt?this.#zt():this.#mt();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")}}}#Mt(){if(this.#lt){for(const{handler:t,mql:e}of this.#lt)e.removeEventListener("change",t);this.#lt=void 0}}#vt(){const t=this.domElement;if(!t)return;this.#yt(t=>{t.disconnect()}),this.#Pt(),this.initBackground();const e=this.#dt;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this.#yt(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})}#mt(){const t=this.domElement,e=this.#ht;t&&e&&bi(t,e,!0)}#yt(t){this.#ct&&t(this.#ct)}#zt(){const t=this.domElement;t&&bi(t,Dt(this.#S.actualOptions.fullScreen.zIndex),!0)}}class xi{#S;#St;#kt;#Ct;constructor(t){this.#S=t,this.#St={visibilityChange:()=>{this.#Ot()},resize:()=>{this.#Lt()}}}addListeners(){this.#It(!0)}removeListeners(){void 0!==this.#Ct&&(clearTimeout(this.#Ct),this.#Ct=void 0),this.#It(!1)}#Ot(){const t=this.#S;t.actualOptions.pauseOnBlur&&(yt().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))}#Lt(){this.#Ct&&(clearTimeout(this.#Ct),this.#Ct=void 0);const t=async()=>{await this.#S.canvas.windowResize()};this.#Ct=setTimeout(()=>{t()},this.#S.actualOptions.resize.delay*f)}#It(t){const e=this.#St;this.#Dt(t),"undefined"!=typeof document&&Rt(document,d,e.visibilityChange,t,!1)}#Dt(t){const e=this.#St,i=this.#S;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void Rt(globalThis,h,e.resize,t);const s=i.canvas.domElement;this.#kt&&!t?(s&&this.#kt.unobserve(s),this.#kt.disconnect(),this.#kt=void 0):!this.#kt&&t&&s&&(this.#kt=new ResizeObserver(t=>{t.some(t=>t.target===s)&&this.#Lt()}),this.#kt.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 ki(t,e,i,s){const n=Ve(i,e,e.actualOptions.particles),r=n.reduceDuplicates;t.effect=kt(n.effect.type,t.id,r),t.shape=kt(n.shape.type,t.id,r);const a=n.effect,o=n.shape;if(s){if(s.effect){const e=s.effect.type;if(e&&e!==t.effect){const i=kt(e,t.id,r);i&&(t.effect=i)}a.load(s.effect)}if(s.shape){const e=s.shape.type;if(e&&e!==t.shape){const i=kt(e,t.id,r);i&&(t.shape=i)}o.load(s.shape)}}if(t.effect===y){const i=[...e.effectDrawers.keys()];t.effect=i[Math.floor(G()*i.length)]}if(t.shape===y){const i=[...e.shapeDrawers.keys()];t.shape=i[Math.floor(G()*i.length)]}t.effectData=t.effect?function(t,e,i,s){const n=e.options[t];return zt({close:e.close},kt(n,i,s))}(t.effect,a,t.id,r):void 0,t.shapeData=t.shape?function(t,e,i,s){const n=e.options[t];return zt({close:e.close},kt(n,i,s))}(t.shape,o,t.id,r):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 Ci{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;#Rt={fillOpacity:1,opacity:1,strokeOpacity:1};#_t=R.origin;#Et={sin:0,cos:0};#Tt={a:1,b:0,c:0,d:1};#S;#Ft=[];#k;constructor(t,e){this.#k=t,this.#S=e}addModifier(t){this.#Ft.push(t),this.#Ft.sort((t,e)=>t.priority-e.priority)}clearModifiers(){this.#Ft.length=0}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.clearModifiers();const i=this.#S,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.#S.dispatchEvent(t.EventType.particleDestroyed,{particle:this})}draw(t){const e=this.#S.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this.#At(this.#Bt(ui(this.fillColor),t=>t.fillColor))}getMass(){return this.getRadius()**2*Math.PI*p}getModifier(t){return this.#Ft.find(e=>e.id===t)}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=tt(this.opacity?.value??1),s=this.#Bt(void 0,t=>t.opacity)??i;return this.#Rt.fillOpacity=this.fillOpacity??1,this.#Rt.opacity=s*e,this.#Rt.strokeOpacity=this.strokeOpacity??1,this.#Rt}getPosition(){return this.#_t.x=this.position.x+this.offset.x,this.#_t.y=this.position.y+this.offset.y,this.#_t.z=this.position.z,this.#_t}getRadius(){return this.#Bt(this.size.value,t=>t.radius)}getRotateData(){const t=this.getAngle();return this.#Et.sin=Math.sin(t),this.#Et.cos=Math.cos(t),this.#Et}getStrokeColor(){return this.#At(this.#Bt(ui(this.strokeColor),t=>t.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this.#Tt.a=e.cos*(t.a??m.a),this.#Tt.b=i?e.sin*(t.b??1):t.b??m.b,this.#Tt.c=i?-e.sin*(t.c??1):t.c??m.c,this.#Tt.d=e.cos*(t.d??m.d),this.#Tt}init(e,i,s,n){const r=this.#S;!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=ki(this,r,this.#k,s),r.retina.initParticle(this),function(t,e){for(const i of t)i.preInit?.(e)}(r.particleUpdaters,this),this.#Ht(i),this.initialVelocity=this.#Ut(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/r.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,r),this.spawning=!1,function(t,e){for(const i of t)i.init(e)}(r.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)}(r,this),function(t,e){for(const i of t.particleCreatedPlugins)i.particleCreated?.(e)}(r,this)}isInsideCanvas(t){return this.#Vt(t).inside}isInsideCanvasForOutMode(t,e){return this.#Vt(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.#Ft.findIndex(e=>e.id===t);e>=0&&this.#Ft.splice(e,1)}reset(){for(const t of this.#S.particleUpdaters)t.reset?.(this)}#Bt(t,e){let i=t;for(const t of this.#Ft)if(t.enabled){const s=e(t);void 0!==s&&(i=s)}return i}#Nt(t,e){let i=0,s=t?R.create(t.x,t.y,e):void 0;const n=this.#S,r=n.particlePositionPlugins,a=this.options.move.outModes,o=this.getRadius(),l=n.canvas.size;for(;;){for(const t of r){const i=t.particlePosition?.(s,this);if(i)return R.create(i.x,i.y,e)}const t=dt({size:l,position:s}),c=R.create(t.x,t.y,e);this.#$t(c,o,a.left??a.default),this.#$t(c,o,a.right??a.default),this.#qt(c,o,a.top??a.default),this.#qt(c,o,a.bottom??a.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}}#Ut(){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=at(tt(e.angle.value)),n=at(tt(e.angle.offset)),r={left:n-s*p,right:n+s*p};return e.straight||(i.angle+=J(st(r.left,r.right))),e.random&&"number"==typeof e.speed&&(i.length*=G()),i}#$t(e,i,s){zi({outMode:s,checkModes:[t.OutMode.bounce],coord:e.x,maxCoord:this.#S.canvas.size.width,setCb:t=>e.x+=t,radius:i})}#qt(e,i,s){zi({outMode:s,checkModes:[t.OutMode.bounce],coord:e.y,maxCoord:this.#S.canvas.size.height,setCb:t=>e.y+=t,radius:i})}#Wt(e,i){const s=this.getRadius(),n=this.#S.canvas.size,r=i===t.OutMode.bounce||i===t.OutMode.split,a=r?this.getPosition():this.position;return e===t.OutModeDirection.bottom?{inside:r?a.y+s<n.height:a.y-s<n.height,reason:"default"}:e===t.OutModeDirection.left?{inside:r?a.x-s>0:a.x+s>0,reason:"default"}:e===t.OutModeDirection.right?{inside:r?a.x+s<n.width:a.x-s<n.width,reason:"default"}:e===t.OutModeDirection.top?{inside:r?a.y-s>0:a.y+s>0,reason:"default"}:{inside:a.x>=-s&&a.y>=-s&&a.y<=n.height+s&&a.x<=n.width+s,reason:"default"}}#jt(t,e){return{canvasSize:this.#S.canvas.size,direction:t,outMode:e,particle:this,radius:this.getRadius()}}#Vt(e,i){const s=this.#Wt(e,i),n=this.#S,r=this.shape?n.shapeDrawers.get(this.shape):void 0,a=this.effect?n.effectDrawers.get(this.effect):void 0;if(!r?.isInsideCanvas&&!a?.isInsideCanvas)return s;const o=this.#jt(e,i),l=r?.isInsideCanvas?this.#Gt(r.isInsideCanvas(o),"shape"):void 0,c=a?.isInsideCanvas?this.#Gt(a.isInsideCanvas(o),"effect"):void 0;if(l&&c){const e=Math.max(l.margin??0,c.margin??0);return{inside:i===t.OutMode.destroy||i===t.OutMode.out?l.inside||c.inside:l.inside&&c.inside,margin:e>0?e:void 0,reason:"combined"}}return l??c??s}#At(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}#Ht(e){const i=this.#S,s=Math.floor(tt(this.options.zIndex.value)),n=this.#Nt(e,Z(s,0,i.zLayers));if(!n)throw new Error(pt(ut.particlePositionNotFound));this.position=n,this.initialPosition=this.position.copy();const r=i.canvas.size;switch(this.moveCenter={...Ct(this.options.move.center,r),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=_.origin}#Gt(t,e){return"boolean"==typeof t?{inside:t,reason:e}:{inside:t.inside,margin:t.margin,reason:t.reason??e}}}class Oi{#Xt=new Map;#Yt;#Qt=[];#Zt;#Kt;#Jt=[];#te;constructor(t){this.#Yt=t,this.#Zt=0,this.#te=0}get cellSize(){return this.#Yt}set cellSize(t){this.#Kt=t}clear(){this.#Xt.clear();const t=this.#Kt;t&&(this.#Yt=t),this.#Kt=void 0}insert(t){const{x:e,y:i}=t.getPosition(),s=this.#ee(e,i);this.#Xt.has(s)||this.#Xt.set(s,[]),this.#Xt.get(s)?.push(t)}query(t,e,i=[]){const s=this.#ie(t);if(!s||!this.#Xt.size)return i;const n=Math.floor(s.minX/this.#Yt),r=Math.floor(s.maxX/this.#Yt),a=Math.floor(s.minY/this.#Yt),o=Math.floor(s.maxY/this.#Yt);if(!Number.isSafeInteger(n)||!Number.isSafeInteger(r)||!Number.isSafeInteger(a)||!Number.isSafeInteger(o)||n>r||a>o)return i;if(!e&&(r-n+1)*(o-a+1)>Math.max(64,16*this.#Xt.size)){const e=[];for(const t of this.#Xt.keys()){const i=t.indexOf("_"),s=Number(t.slice(0,i)),l=Number(t.slice(i+1));s>=n&&s<=r&&l>=a&&l<=o&&e.push({x:s,y:l})}e.sort((t,e)=>t.x===e.x?t.y-e.y:t.x-e.x);for(const{x:s,y:n}of e)this.#se(s,n,t,void 0,i);return i}for(let s=n;s<=r;s++)for(let n=a;n<=o;n++)this.#se(s,n,t,e,i);return i}queryCircle(t,e,i,s=[]){const n=this.#ne(t.x,t.y,e);try{return this.query(n,i,s)}finally{this.#Zt--}}queryRectangle(t,e,i,s=[]){const n=this.#re(t.x,t.y,e.width,e.height);try{return this.query(n,i,s)}finally{this.#te--}}#ne(t,e,i){const s=this.#Zt++;let n=this.#Qt[s];return n||(n=new ie(t,e,i),this.#Qt[s]=n),n.reset(t,e,i)}#re(t,e,i,s){const n=this.#te++;let r=this.#Jt[n];return r||(r=new se(t,e,i,s),this.#Jt[n]=r),r.reset(t,e,i,s)}#ee(t,e){return`${Math.floor(t/this.#Yt)}_${Math.floor(e/this.#Yt)}`}#ie(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}#se(t,e,i,s,n){const r=this.#Xt.get(`${t}_${e}`);if(r)for(const t of r)s&&!s(t)||i.contains(t.getPosition())&&n.push(t)}}class Li{checkParticlePositionPlugins;#ae;#S;#oe;#le;#ce;#he;#de;#ue;#pe;#k;#fe;#ge;#me;#ye;#ve;#Pe;constructor(t,e){this.#k=t,this.#S=e,this.#he=0,this.#ae=[],this.#fe=[],this.#ce=0,this.#le=new Map,this.#de=new Map,this.#Pe=this.#we(this.#S.zLayers),this.#oe=new Oi(100),this.checkParticlePositionPlugins=[],this.#ue=[],this.#pe=[],this.#me=[],this.#ge=[],this.#ve=[]}get count(){return this.#ae.length}get grid(){return this.#oe}addParticle(e,i,s,n){if(!this.#be(s,this.count))try{const r=this.#fe.pop()??new Ci(this.#k,this.#S);r.init(this.#he,e,i,s);let a=!0;return n&&(a=n(r)),a?(this.#ae.push(r),this.#Me(r),this.#he++,this.#S.dispatchEvent(t.EventType.particleAdded,{particle:r}),r):void this.#fe.push(r)}catch(t){r().warning(`error adding particle: ${t}`)}}clear(){this.#ae=[],this.#de.clear(),this.#xe(this.#S.zLayers)}destroy(){this.#ae=[],this.#fe.length=0,this.#de.clear(),this.#Pe=[],this.checkParticlePositionPlugins=[],this.#ue=[],this.#pe=[],this.#me=[],this.#ge=[],this.#ve=[]}drawParticles(t){for(let e=this.#Pe.length-1;e>=0;e--){const i=this.#Pe[e];if(i)for(const e of i)e.draw(t)}}filter(t){return this.#ae.filter(t)}find(t){return this.#ae.find(t)}get(t){return this.#ae[t]}async init(){const t=this.#S;this.checkParticlePositionPlugins=[],this.#ve=[],this.#pe=[],this.#me=[],this.#ue=[],this.#ge=[],this.#de.clear(),this.#xe(t.zLayers),this.#oe=new Oi(100*t.retina.pixelRatio),this.#ze(t.actualOptions.particles);const e=t.actualOptions.particles.groups;for(const t in e){const i=e[t];i&&this.#ze(Ve(this.#k,this.#S,i),t,i)}await this.#Se()}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.#S.canvas.render.drawParticles({value:0,factor:0})}remove(t,e,i){this.removeAt(this.#ae.indexOf(t),void 0,e,i)}removeAt(t,e=1,i,s,n=!0){if(t<0||t>this.count)return;let r=0;for(let a=t;r<e&&a<this.count;a++)this.#ke(a,i,s,n)&&(a--,r++)}removeQuantity(t,e){this.removeAt(0,t,e)}setDensity(){const t=this.#S.actualOptions,e=t.particles.groups;let i=0;for(const t of this.#S.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in e){const s=e[t];if(!s)continue;const n=Ve(this.#k,this.#S,s);this.#Ce(n,i,t)}this.#Ce(t.particles,i)}setResizeFactor(t){this.#ye=t}update(t){this.#oe.clear();for(const e of this.#ve)e.update?.(t);const e=this.#Oe(t);for(const e of this.#me)e.postUpdate?.(t);if(this.#Le(t,e),e.size)for(const t of e)this.remove(t,t.group);this.#ye=void 0}#Ie(...t){this.#fe.push(...t)}#Ce(e,i,s,n){const r=e.number;if(!r.density.enable)return void this.#ze(e,s,n);const a=this.#De(r.density),o=r.value,l=r.limit.value>0?r.limit.value:o,c=Math.round(Math.min(o,l)*a+i),h=this.#Re(s);void 0===s?this.#ce=r.limit.value*a:this.#le.set(s,{limit:r.limit.value*a,mode:B(t.LimitMode,r.limit.mode,t.LimitMode.delete)}),h<c?this.push(Math.abs(c-h),void 0,e,s):h>c&&this.removeQuantity(h-c,s)}#ze(e,i,s){if(void 0===i){this.#ce=e.number.limit.value;const t=this.#S.actualOptions.particles.groups;for(const e of this.#le.keys())e in t||this.#le.delete(e)}else{const n=s?.number?.limit?.value??e.number.limit.value;n>0?this.#le.set(i,{limit:n,mode:B(t.LimitMode,s?.number?.limit?.mode??e.number.limit.mode,t.LimitMode.delete)}):this.#le.delete(i)}}#be(e,i){const s=this.#ce,n=this.#S.actualOptions.particles.number.limit.mode;if(s>0&&n===t.LimitMode.wait&&i>=s)return!0;const r=void 0===e?void 0:this.#le.get(e);if(r&&r.limit>0&&r.mode===t.LimitMode.wait){if(this.#Re(e)>=r.limit)return!0}if(r&&r.limit>0&&r.mode===t.LimitMode.delete){const t=this.#Re(e)+1-r.limit;t>0&&this.removeQuantity(t,e)}if(s>0&&n===t.LimitMode.delete){const t=this.count+1-s;t>0&&this.#_e(t)}return!1}#Re(t){let e=0;for(const i of this.#ae)i.group===t&&e++;return e}#we(t){const e=Math.max(Math.floor(t),1);return Array.from({length:e},()=>[])}#Ee(t){const e=this.#Pe.length-1;return e<=0?0:Math.min(Math.max(Math.floor(t),0),e)}#De(t){const e=this.#S;if(!t.enable)return 1;const i=e.canvas.size,s=e.retina.pixelRatio;if(!Number.isFinite(i.width)||!Number.isFinite(i.height)||i.width<=0||i.height<=0||!Number.isFinite(t.width)||!Number.isFinite(t.height)||t.width<=0||t.height<=0||!Number.isFinite(s)||s<=0)return 1;const n=i.width*i.height/(t.height*t.width*s**2);return Number.isFinite(n)&&n>=0?n:1}async#Te(){const t=this.#S;await t.initDrawersAndUpdaters(),t.canvas.render.initUpdaters();for(const e of t.effectDrawers.values())await(e.init?.(t));for(const e of t.shapeDrawers.values())await(e.init?.(t))}async#Se(){await this.#Fe(),await this.#Te();let t=!1;const e=this.#S;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#Fe(){const t=this.#S;for(const e of t.plugins)e.redrawInit&&await e.redrawInit(),e.checkParticlePosition&&this.checkParticlePositionPlugins.push(e),e.update&&this.#ve.push(e),e.particleUpdate&&this.#pe.push(e),e.postUpdate&&this.#me.push(e),e.particleReset&&this.#ue.push(e),e.postParticleUpdate&&this.#ge.push(e)}#Me(t){const e=this.#Ee(t.position.z),i=this.#Pe[e];i&&(i.push(t),this.#de.set(t.id,e))}#_e(t){this.removeAt(0,t,void 0,void 0,!1)}#ke(e,i,s,n=!0){const r=this.#ae[e];return!!r&&((!n||r.group===i)&&(this.#ae.splice(e,1),this.#Ae(r),r.destroy(s),this.#S.dispatchEvent(t.EventType.particleRemoved,{particle:r}),this.#Ie(r),!0))}#Ae(t){const e=this.#de.get(t.id)??this.#Ee(t.position.z),i=this.#Pe[e];if(!i)return void this.#de.delete(t.id);const s=i.findIndex(e=>e.id===t.id);s>=0&&i.splice(s,1),this.#de.delete(t.id)}#xe(t){const e=Math.max(Math.floor(t),1);if(this.#Pe.length===e)for(const t of this.#Pe)t.length=0;else this.#Pe=this.#we(e)}#Be(t){const e=this.#Ee(t.position.z),i=this.#de.get(t.id);if(void 0===i)return void this.#Me(t);if(i===e)return;const s=this.#Pe[i];if(s){const e=s.findIndex(e=>e.id===t.id);e>=0&&s.splice(e,1)}const n=this.#Pe[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.#de.set(t.id,e)}else this.#de.set(t.id,e)}#Oe(t){const e=new Set,i=this.#ye;for(const s of this.#ae){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.#ue)t.particleReset?.(s);for(const e of this.#pe){if(s.destroyed)break;e.particleUpdate?.(s,t)}s.destroyed?e.add(s):this.#oe.insert(s)}return e}#Le(t,e){for(const i of this.#ae)if(i.destroyed)e.add(i);else{for(const e of this.#S.particleUpdaters)e.update(i,t);if(!i.spawning)for(const e of this.#ge)e.postParticleUpdate?.(i,t);this.#Be(i)}}}class Ii{pixelRatio;reduceFactor;#S;constructor(t){this.#S=t,this.pixelRatio=1,this.reduceFactor=1}init(){const t=this.#S,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,r=t.retina;r.maxSpeed=tt(s.gravity.maxSpeed)*i,r.moveDrift=tt(s.drift)*i,r.moveSpeed=tt(s.speed)*i;const a=r.maxDistance;a.horizontal=void 0===n.horizontal?void 0:n.horizontal*i,a.vertical=void 0===n.vertical?void 0:n.vertical*i}}function Di(t){return!t.destroyed}function Ri(t,e,...i){const s=new Ne(t,e);return ce(s,...i),s}const _i=Object.freeze([]);var Ei=Object.freeze({__proto__:null,Container:class{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;hdrMode;id;pageHidden;particles;particleUpdaters;peakNits;retina;shapeDrawers;started;zLayers;#He;#Ue;#Ve;#Ne={value:0,factor:0};#$e;#qe;#We;#je;#Ge;#Xe;#Ye;#Qe;#Ze;#Ke;#Je=_i;#ti=_i;#ei=_i;#ii;#k;#p=_i;#si;#ni;#ri;#ai=0;#oi;constructor(e){const{dispatchCallback:i,pluginManager:s,id:n,onDestroy:r,sourceOptions:a}=e;this.#k=s,this.#$e=i,this.#Ze=r,this.id=Symbol(n),this.fpsLimit=120,this.hdr=!1,this.hdrMode=t.HdrMode.standard,this.peakNits=400,this.#si=!1,this.#He=0,this.#We=0,this.#Qe=0,this.#Ge=!0,this.started=!1,this.destroyed=!1,this.#ii=!0,this.#Ye=0,this.zLayers=100,this.pageHidden=!1,this.#ni=a,this.#Xe=a,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new Ii(this),this.canvas=new Mi(this.#k,this),this.particles=new Li(this.#k,this),this.#Ke=Ri(this.#k,this),this.actualOptions=Ri(this.#k,this),this.#je=new xi(this),this.dispatchEvent(t.EventType.containerBuilt)}get animationStatus(){return!this.#ii&&!this.pageHidden&&Di(this)}get options(){return this.#Ke}get particleCreatedPlugins(){return this.#Je}get particleDestroyedPlugins(){return this.#ti}get particlePositionPlugins(){return this.#ei}get plugins(){return this.#p}get sourceOptions(){return this.#ni}addLifeTime(t){this.#Qe+=t}alive(){return!this.#We||this.#Qe<=this.#We}destroy(e=!0){if(Di(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.#p=_i,this.destroyed=!0,this.#Ze(e),this.dispatchEvent(t.EventType.containerDestroyed)}}dispatchEvent(t,e){this.#$e(t,{container:this,data:e})}draw(t){if(!Di(this))return;if(void 0!==this.#qe){if(!t)return;Q(this.#qe),this.#qe=void 0}let e=t;this.#qe=Y(t=>{this.#qe=void 0,e&&(this.#Ye=void 0,e=!1),this.#li(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}r().error(`Export plugin with type ${t} not found`)}async init(){if(!Di(this))return;const e=this.#ai,i=new Map;for(const t of this.#k.plugins){const s=await t.getPlugin(this);if(e!==this.#ai||this.destroyed)return;if(s.preInit&&(await s.preInit(),e!==this.#ai))return;i.set(t,s)}if(await this.initDrawersAndUpdaters(),e!==this.#ai)return;this.#Ke=Ri(this.#k,this,this.#Xe,this.sourceOptions),this.actualOptions=Ri(this.#k,this,this.#Ke),this.#Se(i),this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:s,duration:n,fpsLimit:r,smooth:a,zLayers:o}=this.actualOptions,l=this.actualOptions.hdr;this.hdrMode=B(t.HdrMode,l.mode,t.HdrMode.standard),this.peakNits=l.peakNits,this.zLayers=o,this.#We=tt(n)*f,this.#He=tt(s)*f,this.#Qe=0,this.fpsLimit=r>0?r:120,this.#si=a;for(const t of this.plugins)if(await(t.init?.()),e!==this.#ai)return;if(await this.particles.init(),e===this.#ai){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.#k;this.effectDrawers=await Et(this,t.initializers.effects),this.shapeDrawers=await Et(this,t.initializers.shapes),this.particleUpdaters=await _t(this,t.initializers.updaters)}pause(){if(Di(this)&&(void 0!==this.#qe&&(Q(this.#qe),this.#qe=void 0),!this.#ii)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this.#ii=!0),this.dispatchEvent(t.EventType.containerPaused)}}play(e){if(!Di(this))return;const i=this.#ii||e;if(!this.#Ge||this.actualOptions.autoPlay){if(this.#ii&&(this.#ii=!1),i)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(t.EventType.containerPlay),this.draw(i??!1)}else this.#Ge=!1}async refresh(){if(Di(this))return this.stop(),this.start()}async reset(t){if(Di(this))return this.#Xe=t,this.#ni=t,this.#Ke=Ri(this.#k,this,this.#Xe,this.sourceOptions),this.actualOptions=Ri(this.#k,this,this.#Ke),this.refresh()}async start(){if(!Di(this)||this.started)return;if(this.#oi)return this.#oi;const e=++this.#ai;let i;const s=new Promise(t=>{i=t});return this.#ri=i,this.#oi=(async()=>{try{if(await Promise.race([this.init(),s]),e!==this.#ai)return;if(this.started=!0,await Promise.race([new Promise(t=>{this.#Ue=t,this.#Ve=setTimeout(()=>{this.#Ve=void 0,this.#Ue=void 0,t()},this.#He)}),s]),e!==this.#ai||this.destroyed)return;this.#je.addListeners();const i=async()=>{for(const t of this.plugins){if(e!==this.#ai)return;await(t.start?.())}};if(await Promise.race([i(),s]),e!==this.#ai)return;this.dispatchEvent(t.EventType.containerStarted),this.play()}catch(t){throw e!==this.#ai||this.destroyed||this.stop(),t}finally{e===this.#ai&&(this.#oi=void 0,this.#ri=void 0)}})(),this.#oi}stop(){if(Di(this)&&(this.#ai++,this.#ri?.(),this.#ri=void 0,this.#oi=void 0,this.started)){void 0!==this.#Ve&&(clearTimeout(this.#Ve),this.#Ve=void 0,this.#Ue?.(),this.#Ue=void 0),this.#Ge=!0,this.started=!1,this.#je.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop();for(const t of this.plugins)t.stop?.();this.#Je=_i,this.#ti=_i,this.#ei=_i,this.#ni=this.#Ke,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}#Se(t){const e=[],i=[],s=[],n=[];for(const[r,a]of t)r.needsPlugin(this.actualOptions)&&(e.push(a),a.particleCreated&&i.push(a),a.particleDestroyed&&s.push(a),a.particlePosition&&n.push(a));this.#p=Object.freeze(e),this.#Je=Object.freeze(i),this.#ti=Object.freeze(s),this.#ei=Object.freeze(n)}#li(t){try{if(!this.#si&&void 0!==this.#Ye&&t<this.#Ye+f/this.fpsLimit)return void this.draw(!1);if(this.#Ye??=t,function(t,e,i=60,s=!1){t.value=e,t.factor=s?60/i:60*e/f}(this.#Ne,t-this.#Ye,this.fpsLimit,this.#si),this.addLifeTime(this.#Ne.value),this.#Ye=t,this.#Ne.value>f)return void this.draw(!1);if(this.canvas.render.drawParticles(this.#Ne),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){r().error("error in animation loop",t)}}}});t.AnimatableColor=ge,t.AnimationOptions=he,t.AnimationValueWithRandom=ke,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=Ce,t.OptionLoader=le,t.Options=Ne,t.OptionsColor=fe,t.OutModes=Oe,t.Paint=Re,t.ParticlesBounce=Ee,t.ParticlesBounceFactor=_e,t.ParticlesDensity=Te,t.ParticlesNumber=Ae,t.ParticlesNumberLimit=Fe,t.ParticlesOptions=Ue,t.RangedAnimationOptions=de,t.RangedAnimationValueWithRandom=class extends ke{animation=new de},t.Rectangle=se,t.ResizeEvent=Pe,t.Shape=Be,t.Spin=Le,t.Stroke=De,t.ValueWithRandom=Se,t.Vector=_,t.Vector3d=R,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?tt(t.position.x):void 0,y:void 0!==t.position?.y?tt(t.position.y):void 0};return ht({size:t.size,position:e})},t.calculateBounds=xt,t.cancelAnimation=Q,t.canvasFirstIndex=0,t.canvasTag=M,t.checkDistance=rt,t.circleBounce=function(t,e){const{x:i,y:s}=t.velocity.sub(e.velocity),[n,r]=[t.position,e.position],a=r.x-n.x,o=r.y-n.y;if(i*a+s*o<0)return;const l=-Math.atan2(o,a),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:_.create(tt(t.options.bounce.horizontal.value),tt(t.options.bounce.vertical.value))}},t.clamp=Z,t.cloneStyle=Ot,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=at,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=Tt,t.getDistance=function(t,e){return Math.sqrt(nt(t,e))},t.getDistanceSq=nt,t.getDistances=function(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}},t.getDomContainer=At,t.getErrorMessage=pt,t.getFullScreenStyle=Dt,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:k}};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=Et,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 ai(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=r,t.getParticleBaseVelocity=lt,t.getParticleDirectionAngle=ot,t.getPosition=Ct,t.getRandom=G,t.getRandomFn=j,t.getRandomInRange=X,t.getRandomRgbColor=li,t.getRangeMax=it,t.getRangeMin=et,t.getRangeValue=tt,t.getStyleFromHsl=hi,t.getStyleFromRgb=ci,t.hMax=z,t.hMin=0,t.hPhase=60,t.half=p,t.hslToRgb=ai,t.hslToRgbFloat=oi,t.hslaToRgba=function(t){const e=ai(t);return{a:t.a,b:e.b,g:e.g,r:e.r}},t.hypot=function(t,e){return Math.sqrt(t*t+e*e)},t.identity=1,t.inverseFactorNumerator=1,t.isArray=U,t.isBoolean=E,t.isEnumValue=A,t.isFunction=function(t){return"function"==typeof t},t.isInArray=wt,t.isNull=V,t.isNumber=F,t.isObject=H,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=kt,t.lFactor=1,t.lMax=k,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,r=Object.hasOwn(n,s)?n[s]:{};n[s]=zt(r,i)}},t.loadLazyProperty=oe,t.loadMinIndex=0,t.loadNestedProperty=ae,t.loadOptionProperty=function(t,e,i,...s){const n=t;n[e]??=new i;const r=n[e];for(const t of s)r.load(t?.[e])},t.loadOptions=ce,t.loadParticlesOptions=Ve,t.loadProperty=ne,t.loadRandomFactor=L,t.loadRangeProperty=re,t.manageListener=Rt,t.maxNits=I,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=K,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=C,t.randomColorValue=y,t.randomInRangeValue=J,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){q.nextFrame=t,q.cancel=e},t.setLogger=n,t.setRandom=W,t.setRangeValue=st,t.sextuple=6,t.spatialHashGridCellSize=100,t.squareExp=2,t.stringToAlpha=function(t,e){return Je(t,e)?.a},t.stringToRgb=ni,t.threeQuarter=O,t.toEnumValue=B,t.triple=3,t.tryCountIncrement=1,t.tsParticles=mi,t.updateColor=function(t,e,i){if(!t)return;const{h:s,s:n,l:r}=t;fi(s,!1,e),fi(n,!0,e),fi(r,!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});