UNPKG

@tsparticles/confetti

Version:

tsParticles confetti bundle — easily create confetti, confetti cannon, confetti explosions, confetti falling, and confetti parade animations with presets. Ready to use components available for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact,

2 lines • 133 kB
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},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(){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",r="100%",l="source-over",c="resize",d="visibilitychange",h=100,u=.5,p=1e3,g={x:0,y:0,z:0},f={a:1,b:0,c:0,d:1},m="random",y="mid",v=2*Math.PI,w="true",b="false",P="canvas",x=255,M=360,z=100,C=100,k=.25,S=.75,O=400;function D(t){return"z"in t?t.z:g.z}class I{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 I.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 I.create(t.x,t.y,D(t))}static create(t,e,i){return"number"==typeof t?new I(t,e??g.y,i??g.z):new I(t.x,t.y,D(t))}add(t){return I.create(this.x+t.x,this.y+t.y,this.z+D(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=D(t)}copy(){return I.clone(this)}div(t){return I.create(this.x/t,this.y/t,this.z/t)}getLengthSq(){return this.x**2+this.y**2}mult(t){return I.create(this.x*t,this.y*t,this.z*t)}multTo(t){this.x*=t,this.y*=t,this.z*=t}normalize(){const t=this.length;0!=t&&this.multTo(1/t)}rotate(t){return I.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),g.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=D(t)}sub(t){return I.create(this.x-t.x,this.y-t.y,this.z-D(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=D(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class E extends I{constructor(t=g.x,e=g.y){super(t,e,g.z)}static get origin(){return E.create(g.x,g.y)}static clone(t){return E.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new E(t,e??g.y):new E(t.x,t.y)}}function T(t){return"boolean"==typeof t}function L(t){return"string"==typeof t}function R(t){return"number"==typeof t}function _(t,e){return Object.values(t).some(t=>t===e)}function A(t,e,i){return _(t,e)?e:i}function F(t){return"object"==typeof t&&null!==t}function B(t){return Array.isArray(t)}function V(t){return null==t}const U=Math.PI/180;let H=Math.random;const $={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function N(){return G(H(),0,1-Number.EPSILON)}function j(t,e){return N()*(e-t)+t}function q(t){return $.nextFrame(t)}function W(t){$.cancel(t)}function G(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 Q(t){const e=Z(t);let i=Y(t);return e===i&&(i=0),j(i,e)}function X(t){return R(t)?t:Q(t)}function Y(t){return R(t)?t:t.min}function Z(t){return R(t)?t:t.max}function J(t,e){if(t===e||void 0===e&&R(t))return t;const i=Y(t),s=Z(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:J(i,s)}function tt(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}}function et(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function it(t,e){return Math.sqrt(et(t,e))}function st(t,e,i){return et(t,e)<=i*i}function nt(t){return t*U}function at(e,i,s){if(R(e))return nt(e);switch(e){case t.MoveDirection.top:return-Math.PI*u;case t.MoveDirection.topRight:return-Math.PI*k;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*k;case t.MoveDirection.bottom:return Math.PI*u;case t.MoveDirection.bottomLeft:return Math.PI*S;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*S;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 N()*v}}function ot(t){const e=E.origin;return e.length=1,e.angle=t,e}function rt(t,e,i,s){return E.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function lt(t){return{x:(t.position?.x??N()*h)*t.size.width/h,y:(t.position?.y??N()*h)*t.size.height/h}}function ct(t){const e={x:void 0!==t.position?.x?X(t.position.x):void 0,y:void 0!==t.position?.y?X(t.position.y):void 0};return lt({size:t.size,position:e})}function dt(t){const{position:e,size:i}=t;return{x:e?.x??N()*i.width,y:e?.y??N()*i.height}}function ht(t){return t?t.endsWith("%")?Number.parseFloat(t)/h:Number.parseFloat(t):1}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 gt,ft;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 wt(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function bt(t,e){return t===e||B(e)&&e.includes(t)}function Pt(t,e,i=!0){return t[void 0!==e&&i?e%t.length:Math.floor(N()*t.length)]}function xt(t,e,i,s,n){return Mt(zt(t,s??0),e,i,n)}function Mt(e,i,s,n){let a=!0;return n&&n!==t.OutModeDirection.bottom||(a=e.top<i.height+s.x),!a||n&&n!==t.OutModeDirection.left||(a=e.right>s.x),!a||n&&n!==t.OutModeDirection.right||(a=e.left<i.width+s.y),!a||n&&n!==t.OutModeDirection.top||(a=e.bottom>s.y),a}function zt(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function Ct(t,...e){for(const i of e){if(V(i))continue;if(!F(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):F(t)&&!Array.isArray(t)||(t=Object.create(null));const e=Object.keys(i);if(!e.some(t=>{const e=i[t];return F(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=>Ct(void 0,t)):Ct(e[s],n)}}return t}function kt(t,e){return B(t)?t.map((t,i)=>e(t,i)):e(t,0)}function St(t,e,i){return B(t)?Pt(t,e,i):t}function Ot(e,i){return function(e,i){if(e.mode!==t.PixelMode.percent){const{mode:t,...i}=e;return i}return"x"in e?{x:e.x/h*i.width,y:e.y/h*i.height}:{width:e.width/h*i.width,height:e.height/h*i.height}}(e,i)}function Dt(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 a=t.getPropertyPriority?.(s);a?e.setProperty(s,n,a):e.setProperty(s,n)}return e}let It,Et;function Tt(t){if(It!==t||!Et){It=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)}Et=e}return Et}function Lt(t,e,i,s,n){if(s){let s={passive:!0};T(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 Rt(t,e){return await Promise.all([...e.values()].map(e=>e(t)))}async function _t(t,e){const i=await Promise.all([...e.entries()].map(([e,i])=>i(t).then(t=>[e,t])));return new Map(i)}async function At(t){const e=St(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(B(t))return t.every(t=>F(t)&&!B(t));return F(t)&&!B(t)}(e))return e;n().error("invalid configuration data while retrieving config file")}else n().error(`${t.status.toString()} while retrieving config file`)}catch(t){n().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()===P)e=t,e.dataset[o]??=b,e.dataset[o]===w&&(e.style.width||=r,e.style.height||=r,e.style.pointerEvents="none",e.style.setProperty("pointer-events","none"));else{const s=t.getElementsByTagName(P).item(0);s?(e=s,e.dataset[o]=b):(e=i.createElement(P),e.dataset[o]=w,t.appendChild(e)),e.style.width||=r,e.style.height||=r,e.style.pointerEvents="none",e.style.setProperty("pointer-events","none")}return e}function Bt(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,(gt=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",gt.left="left",gt.right="right",gt.top="top",t.PixelMode=void 0,(ft=t.PixelMode||(t.PixelMode={})).precise="precise",ft.percent="percent";class Vt{#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 Ut,Ht,$t,Nt,jt,qt,Wt,Gt,Kt,Qt,Xt,Yt,Zt,Jt;t.EventType=void 0,(Ut=t.EventType||(t.EventType={})).configAdded="configAdded",Ut.containerInit="containerInit",Ut.particlesSetup="particlesSetup",Ut.containerStarted="containerStarted",Ut.containerStopped="containerStopped",Ut.containerDestroyed="containerDestroyed",Ut.containerPaused="containerPaused",Ut.containerPlay="containerPlay",Ut.containerBuilt="containerBuilt",Ut.particleAdded="particleAdded",Ut.particleDestroyed="particleDestroyed",Ut.particleRemoved="particleRemoved";class te{colorManagers=new Map;easingFunctions=new Map;initializers={effects:new Map,shapes:new Map,updaters:new Map};palettes=new Map;plugins=[];presets=new Map;#i=new Set;#s=new Map;#n;#a=new Set;#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}get initialized(){return this.#o}addColorManager(t,e){this.#o||this.colorManagers.set(t,e)}addConfig(e){if(this.#o)return;const i=e.key??e.name??"default";this.#s.set(i,e),this.#n.dispatchEvent(t.EventType.configAdded,{data:{name:i,config:e}})}addEasing(t,e){this.#o||this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.#o||this.initializers.effects.set(t,e)}addPalette(t,e){this.#o||this.palettes.set(t,e)}addParticleUpdater(t,e){this.#o||this.initializers.updaters.set(t,e)}addPlugin(t){this.#o||this.getPlugin(t.id)||this.plugins.push(t)}addPreset(t,e,i=!1){this.#o||!i&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){if(!this.#o)for(const i of t)this.initializers.shapes.set(i,e)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.plugins.find(e=>e.id===t)}getPreset(t){return this.presets.get(t)}async init(){if(!this.#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}}}async register(...t){if(this.#o)throw new Error(pt(ut.pluginRegisterAfterLoad));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))}}class ee{pluginManager=new te(this);#d=[];#h=new Vt;#o=!1;get items(){return this.#d}get version(){return"4.5.0"}addEventListener(t,e){this.#h.addEventListener(t,e)}checkVersion(t){if(this.version!==t)throw new Error(pt(ut.engineVersionMismatch,this.version))}dispatchEvent(t,e){this.#h.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 e;await this.init(),"undefined"!=typeof HTMLElement&&t.element instanceof HTMLElement&&(e=t.element);const{Container:i}=await Promise.resolve().then(function(){return ba}),s=t.id??e?.id??`tsparticles${Math.floor(1e4*N()).toString()}`,{index:n,url:a}=t,o=St(a?await At({fallback:t.options,url:a,index:n}):t.options,n),{items:r}=this,l=r.findIndex(t=>t.id.description===s),c=new i({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:s,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(c);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:o});if(l>=0){const t=this.item(l),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),r.splice(l,e,c)}else r.push(c);const d="undefined"!=typeof OffscreenCanvas&&t.element instanceof OffscreenCanvas?t.element:Ft(Bt(s,e));return c.canvas.loadCanvas(d),await c.start(),c}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this.#h.removeEventListener(t,e)}}!function(t){t.circle="circle",t.rectangle="rectangle"}(Ht||(Ht={}));class ie{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 se extends ie{radius;constructor(t,e,i){super(t,e,Ht.circle),this.radius=i}contains(t){return st(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 se||t.type===Ht.circle){return s+t.radius>Math.hypot(n,a)}if(t instanceof ne||t.type===Ht.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 ne extends ie{size;constructor(t,e,i,s){super(t,e,Ht.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 se)return t.intersects(this);if(!(t instanceof ne))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}}function ae(t,e,i){void 0!==i&&(t[e]=i)}function oe(t,e,i){void 0!==i&&(t[e]=J(i))}function re(t,e,i){void 0!==i&&t[e].load(i)}function le(t,e,i,s){if(void 0!==i){const n=t;n[e]??=s(),n[e].load(i)}}function ce(t,e,i,...s){const n=t;n[e]??=new i;const a=n[e];for(const t of s)a.load(t?.[e])}t.RotateDirection=void 0,($t=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",$t.counterClockwise="counter-clockwise",$t.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,(jt=t.HdrMode||(t.HdrMode={})).standard="standard",jt.natural="natural",jt.vivid="vivid",jt.cinematic="cinematic",jt.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,(Gt=t.AlterType||(t.AlterType={})).darken="darken",Gt.enlighten="enlighten",t.DestroyType=void 0,(Kt=t.DestroyType||(t.DestroyType={})).none="none",Kt.max="max",Kt.min="min",t.GradientType=void 0,(Qt=t.GradientType||(t.GradientType={})).linear="linear",Qt.radial="radial",Qt.random="random",t.ParticleOutType=void 0,(Xt=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",Xt.inside="inside",Xt.outside="outside",t.StartValueType=void 0,(Yt=t.StartValueType||(t.StartValueType={})).max="max",Yt.min="min",Yt.random="random",t.AnimationStatus=void 0,(Zt=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",Zt.decreasing="decreasing",t.DrawLayer=void 0,(Jt=t.DrawLayer||(t.DrawLayer={}))[Jt.BackgroundElement=0]="BackgroundElement",Jt[Jt.BackgroundDraw=1]="BackgroundDraw",Jt[Jt.BackgroundMask=2]="BackgroundMask",Jt[Jt.CanvasSetup=3]="CanvasSetup",Jt[Jt.PluginContent=4]="PluginContent",Jt[Jt.Particles=5]="Particles",Jt[Jt.CanvasCleanup=6]="CanvasCleanup",Jt[Jt.Foreground=7]="Foreground";class de{load(t){V(t)||this.doLoad(t)}}function he(t,...e){for(const i of e)t.load(i)}class ue extends de{count=0;decay=0;delay=0;enable=!1;speed=1;sync=!1;doLoad(t){oe(this,"count",t.count),ae(this,"enable",t.enable),oe(this,"speed",t.speed),oe(this,"decay",t.decay),oe(this,"delay",t.delay),ae(this,"sync",t.sync)}}class pe extends ue{mode=t.AnimationMode.auto;startValue=t.StartValueType.random;doLoad(t){super.doLoad(t),ae(this,"mode",t.mode),ae(this,"startValue",t.startValue)}}class ge extends ue{max;min;offset=0;sync=!0;constructor(t,e){super(),this.min=t,this.max=e}doLoad(t){super.doLoad(t),ae(this,"max",t.max),ae(this,"min",t.min),oe(this,"offset",t.offset)}}class fe extends de{h=new ge(0,M);l=new ge(0,C);s=new ge(0,z);doLoad(t){this.h.load(t.h),this.s.load(t.s),this.l.load(t.l)}}class me extends de{value="";static create(t,e){const i=new me;return i.load(t),void 0!==e&&(L(e)||B(e)?i.load({value:e}):i.load(e)),i}doLoad(t){V(t.value)||(this.value=t.value)}}class ye extends me{animation=new fe;static create(t,e){const i=new ye;return i.load(t),void 0!==e&&(L(e)||B(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 ve extends de{color;draw;element;image="";opacity=1;position="";repeat="";size="";constructor(){super(),this.color=new me,this.color.value=""}doLoad(t){void 0!==t.color&&(this.color=me.create(this.color,t.color)),ae(this,"element",t.element),ae(this,"draw",t.draw),ae(this,"image",t.image),ae(this,"position",t.position),ae(this,"repeat",t.repeat),ae(this,"size",t.size),ae(this,"opacity",t.opacity)}}class we extends de{enable=!0;zIndex=0;doLoad(t){ae(this,"enable",t.enable),ae(this,"zIndex",t.zIndex)}}class be extends de{enable=!0;mode=t.HdrMode.standard;peakNits=400;doLoad(e){if(void 0!==e.enable&&!T(e.enable))throw new Error(pt(ut.hdrEnableInvalid,String(e.enable)));if(void 0!==e.mode&&!_(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&&(!R(e.peakNits)||!Number.isFinite(e.peakNits)||e.peakNits<=0))throw new Error(pt(ut.hdrPeakNitsInvalid,String(e.peakNits)));ae(this,"enable",e.enable),ae(this,"mode",e.mode),ae(this,"peakNits",e.peakNits)}}class Pe extends de{delay=.5;enable=!0;doLoad(t){ae(this,"delay",t.delay),ae(this,"enable",t.enable)}}class xe extends de{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]=Ct(this.options[t]??{},i))}ae(this,"close",t.close),ae(this,"type",t.type)}}class Me extends de{color;enable=!0;opacity=1;doLoad(t){void 0!==t.color&&(this.color=ye.create(this.color,t.color)),ae(this,"enable",t.enable),oe(this,"opacity",t.opacity)}}class ze extends de{offset=0;value=90;doLoad(t){oe(this,"offset",t.offset),oe(this,"value",t.value)}}class Ce extends de{mode=t.PixelMode.percent;radius=0;x=50;y=50;doLoad(t){ae(this,"x",t.x),ae(this,"y",t.y),ae(this,"mode",t.mode),ae(this,"radius",t.radius)}}class ke extends de{acceleration=9.81;enable=!1;inverse=!1;maxSpeed=50;doLoad(t){oe(this,"acceleration",t.acceleration),ae(this,"enable",t.enable),ae(this,"inverse",t.inverse),oe(this,"maxSpeed",t.maxSpeed)}}class Se extends de{value=0;doLoad(t){V(t.value)||(this.value=J(t.value))}}class Oe extends Se{animation=new ue;doLoad(t){super.doLoad(t),re(this,"animation",t.animation)}}class De extends Oe{animation=new pe}class Ie extends de{clamp=!0;delay=new Se;enable=!1;generator;options={};doLoad(t){ae(this,"clamp",t.clamp),this.delay.load(t.delay),ae(this,"enable",t.enable),this.generator=t.generator,t.options&&(this.options=Ct(this.options,t.options))}}class Ee extends de{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 Te extends de{acceleration=0;enable=!1;position;doLoad(t){oe(this,"acceleration",t.acceleration),ae(this,"enable",t.enable),t.position&&(this.position=Ct({},t.position))}}class Le extends de{angle=new ze;center=new Ce;decay=0;direction=t.MoveDirection.none;distance={};drift=0;enable=!1;gravity=new ke;outModes=new Ee;path=new Ie;random=!1;size=!1;speed=2;spin=new Te;straight=!1;vibrate=!1;warp=!1;doLoad(t){this.angle.load(R(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),oe(this,"decay",t.decay),ae(this,"direction",t.direction),void 0!==t.distance&&(this.distance=R(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),oe(this,"drift",t.drift),ae(this,"enable",t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(F(e)?this.outModes.load(e):this.outModes.load({default:e})),this.path.load(t.path),ae(this,"random",t.random),ae(this,"size",t.size),oe(this,"speed",t.speed),this.spin.load(t.spin),ae(this,"straight",t.straight),ae(this,"vibrate",t.vibrate),ae(this,"warp",t.warp)}}class Re extends de{color;opacity;width=0;doLoad(t){void 0!==t.color&&(this.color=ye.create(this.color,t.color)),oe(this,"width",t.width),oe(this,"opacity",t.opacity)}}class _e extends de{color;fill;stroke;doLoad(t){void 0!==t.color&&(this.color=ye.create(this.color,t.color)),le(this,"fill",t.fill,()=>new Me),le(this,"stroke",t.stroke,()=>new Re)}}class Ae extends Se{value=1}class Fe extends de{horizontal=new Ae;vertical=new Ae;doLoad(t){this.horizontal.load(t.horizontal),this.vertical.load(t.vertical)}}class Be extends de{enable=!1;height=1080;width=1920;doLoad(t){ae(this,"enable",t.enable),ae(this,"width",t.width),ae(this,"height",t.height)}}class Ve extends de{mode=t.LimitMode.delete;value=0;doLoad(t){ae(this,"mode",t.mode),ae(this,"value",t.value)}}class Ue extends de{density=new Be;limit=new Ve;value=0;doLoad(t){this.density.load(t.density),this.limit.load(t.limit),ae(this,"value",t.value)}}class He extends de{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]=Ct(this.options[t]??{},i))}ae(this,"close",t.close),ae(this,"type",t.type)}}class $e extends Se{opacityRate=1;sizeRate=1;velocityRate=1;doLoad(t){super.doLoad(t),ae(this,"opacityRate",t.opacityRate),ae(this,"sizeRate",t.sizeRate),ae(this,"velocityRate",t.velocityRate)}}class Ne extends de{bounce=new Fe;effect=new xe;groups={};move=new Le;number=new Ue;paint;palette;reduceDuplicates=!1;shape=new He;zIndex=new $e;#u;#p;constructor(t,e){super(),this.#p=t,this.#u=e,this.paint=new _e,this.paint.color=new ye,this.paint.color.value="#fff",this.paint.fill=new Me,this.paint.fill.enable=!0}doLoad(t){if(t.palette&&(this.palette=t.palette,this.#g(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]=Ct(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&&(B(e)?this.paint=kt(e,t=>{const e=new _e;return e.load(t),e}):B(this.paint)?(this.paint=new _e,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.zIndex.load(t.zIndex),this.#u){for(const e of this.#p.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this.#u,this,t);const e=this.#u.particleUpdaters;for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}#g(t){const e=this.#p.getPalette(t);if(!e)return;const i=e.colors,s=(B(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 je(t,e,...i){const s=new Ne(t,e);return he(s,...i),s}class qe extends de{autoPlay=!0;background;clear=!0;defaultThemes={};delay=0;detectRetina=!0;duration=0;fpsLimit=120;fullScreen;hdr;key;name;palette;particles;pauseOnBlur=!0;pauseOnOutsideViewport=!0;preset;resize;smooth=!1;style={};zLayers=100;#u;#p;constructor(t,e){super(),this.#p=t,this.#u=e,this.background=new ve,this.fullScreen=new we,this.hdr=new be,this.particles=je(this.#p,this.#u),this.resize=new Pe}doLoad(e){void 0!==e.preset&&(this.preset=e.preset,kt(this.preset,t=>{this.#f(t)})),void 0!==e.palette&&(this.palette=e.palette,this.#g(this.palette)),ae(this,"autoPlay",e.autoPlay),ae(this,"clear",e.clear),ae(this,"key",e.key),ae(this,"name",e.name),oe(this,"delay",e.delay),ae(this,"detectRetina",e.detectRetina),oe(this,"duration",e.duration),ae(this,"fpsLimit",e.fpsLimit);const i=e.hdr;T(i)?(this.hdr.enable=i,this.hdr.mode=t.HdrMode.standard,this.hdr.peakNits=400):this.hdr.load(i),ae(this,"pauseOnBlur",e.pauseOnBlur),ae(this,"pauseOnOutsideViewport",e.pauseOnOutsideViewport),ae(this,"zLayers",e.zLayers),this.background.load(e.background);const s=e.fullScreen;T(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.particles.load(e.particles),this.resize.load(e.resize),this.style=Ct(this.style,e.style),ae(this,"smooth",e.smooth),this.#p.plugins.forEach(t=>{t.loadOptions(this.#u,this,e)})}#g(t){const e=this.#p.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})}#f(t){this.load(this.#p.getPreset(t))}}const We=new Map,Ge=1.15,Ke=1.05,Qe=.2126,Xe=.7152,Ye=.0722;function Ze(t,e){let i=We.get(t);return i||(i=e(),We.size>2e3&&We.clear(),We.set(t,i)),i}function Je(t){return G(t*(2.51*t+.03)/(t*(2.43*t+.59)+.14),0,1)}function ti(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ei(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function ii(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function si(t,e,i,s=!0){if(!e)return;const n=L(e)?{value:e}:e;if(L(n.value))return ni(t,n.value,i,s);if(B(n.value)){const e=Pt(n.value,i,s);if(!e)return;return si(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function ni(t,e,i,s=!0){if(!e)return;const n=L(e)?{value:e}:e;if(L(n.value))return n.value===m?ui():ri(t,n.value);if(B(n.value)){const e=Pt(n.value,i,s);if(!e)return;return ni(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function ai(t,e,i,s=!0){const n=si(t,e,i,s);return n?oi(n):void 0}function oi(t){const e=t.r/x,i=t.g/x,s=t.b/x,n=Math.max(e,i,s),a=Math.min(e,i,s),o={h:0,l:(n+a)*u,s:0};return n!==a&&(o.s=o.l<u?(n-a)/(n+a):(n-a)/(2-n-a),o.h=e===n?(i-s)/(n-a):i===n?2+(s-e)/(n-a):4+(e-i)/(n-a)),o.l*=C,o.s*=z,o.h*=60,o.h<0&&(o.h+=M),o.h>=M&&(o.h-=M),o}function ri(t,e){return ii(t,e)}function li(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 ci(t){const e=(t.h%M+M)%M,i=Math.max(0,Math.min(z,t.s)),s=Math.max(0,Math.min(C,t.l)),n=e/M,a=i/z,o=s/C;if(0===i){const t=Math.round(o*x);return{r:t,g:t,b:t}}const r=o<u?o*(1+a):o+a-o*a,l=2*o-r,c=1/3,d=Math.min(x,x*li(l,r,n+c)),h=Math.min(x,x*li(l,r,n)),p=Math.min(x,x*li(l,r,n-c));return{r:Math.round(d),g:Math.round(h),b:Math.round(p)}}function di(t){const e=(t.h%M+M)%M,i=Math.max(0,Math.min(z,t.s)),s=Math.max(0,Math.min(C,t.l)),n=e/M,a=i/z,o=s/C;if(0===i){const t=o*x;return{r:t,g:t,b:t}}const r=o<u?o*(1+a):o+a-o*a,l=2*o-r,c=1/3;return{r:Math.min(x,x*li(l,r,n+c)),g:Math.min(x,x*li(l,r,n)),b:Math.min(x,x*li(l,r,n-c))}}function hi(t){const e=ci(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}function ui(t,e){const i=t??0;if(e)return{r:j(i,x),g:j(i,x),b:j(i,x)};const s=()=>Math.floor(j(i,256));return{b:s(),g:s(),r:s()}}function pi(e,i,s,n,a){const o=i?4:2,r=s??1;return Ze(i?`rgb-${e.r.toFixed(o)}-${e.g.toFixed(o)}-${e.b.toFixed(o)}-hdr-${r.toString()}-${(n??O).toString()}-${a??t.HdrMode.standard}`:`rgb-${e.r.toFixed(o)}-${e.g.toFixed(o)}-${e.b.toFixed(o)}-sdr-${r.toString()}`,()=>i?function(e,i,s=400,n=t.HdrMode.standard){const a=s/203,o=function(e,i,s,n){const a=e.r/x,o=e.g/x,r=e.b/x;if(n!==t.HdrMode.natural&&n!==t.HdrMode.vivid&&n!==t.HdrMode.cinematic&&n!==t.HdrMode.dynamic)return{b:r,g:o,r:a};const l=Math.max(1,i),c=Qe*a+Xe*o+Ye*r,d=function(t,e,i){if(t<=i)return Je(t);const s=t+(t-i)*(e-1);return Je(s)}(c,i,s),h=c>0?d/c:1;return function(e,i,s,n,a){switch(n){case t.HdrMode.vivid:{const t=(e+i+s)/3;return{b:G(G(t+(s-t)*Ge,0,a)*Ke,0,a),g:G(G(t+(i-t)*Ge,0,a)*Ke,0,a),r:G(G(t+(e-t)*Ge,0,a)*Ke,0,a)}}case t.HdrMode.cinematic:{const t=1.05*e,n=.95*s,o=(t+i+n)/3;return{b:G(o+1.1*(n-o),0,a),g:G(o+1.1*(i-o),0,a),r:G(o+1.1*(t-o),0,a)}}case t.HdrMode.dynamic:{const t=Qe*e+Xe*i+Ye*s,n=Math.min(1,2*t),o=1-n,r=(e+i+s)/3,l=G(r+(e-r)*Ge,0,a)*Ke,c=G(r+(i-r)*Ge,0,a)*Ke,d=G(r+(s-r)*Ge,0,a)*Ke;return{b:G(s*o+d*n,0,a),g:G(i*o+c*n,0,a),r:G(e*o+l*n,0,a)}}case t.HdrMode.standard:case t.HdrMode.natural:default:return{b:s,g:i,r:e}}}(G(a*h,0,l),G(o*h,0,l),G(r*h,0,l),n,l)}(e,a,.18,n);return`color(display-p3 ${o.r.toString()} ${o.g.toString()} ${o.b.toString()} / ${(i??1).toString()})`}(e,s,n,a):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(e,s))}function gi(e,i,s,n,a){const o=i?4:2,r=s??1;return Ze(i?`hsl-${e.h.toFixed(o)}-${e.s.toFixed(o)}-${e.l.toFixed(o)}-hdr-${r.toString()}-${(n??O).toString()}-${a??t.HdrMode.standard}`:`hsl-${e.h.toFixed(o)}-${e.s.toFixed(o)}-${e.l.toFixed(o)}-sdr-${r.toString()}`,()=>i?pi(di(e),!0,s,n,a):`hsla(${e.h.toString()}, ${e.s.toString()}%, ${e.l.toString()}%, ${r.toString()})`)}function fi(t,e,i,s,n){let a=t,o=e;if("r"in a||(a=n?di(t):ci(t)),"r"in o||(o=n?di(e):ci(e)),n){const t={b:ti(a.b/x),g:ti(a.g/x),r:ti(a.r/x)},e={b:ti(o.b/x),g:ti(o.g/x),r:ti(o.r/x)},n=i+s;return{b:ei((t.b*i+e.b*s)/n)*x,g:ei((t.g*i+e.g*s)/n)*x,r:ei((t.r*i+e.r*s)/n)*x}}return{b:K(a.b,o.b,i,s),g:K(a.g,o.g,i,s),r:K(a.r,o.r,i,s)}}function mi(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function yi(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:M},s:{enable:!1,value:t.s,min:0,max:z},l:{enable:!1,value:t.l,min:0,max:C}};return e&&(vi(s.h,e.h,i),vi(s.s,e.s,i),vi(s.l,e.l,i)),s}function vi(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=X(i.speed)/h*s,e.decay=1-X(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=X(i.count),e.time=0,e.delayTime=X(i.delay)*p,i.sync||(e.velocity*=N(),e.value*=N()),e.initialValue=e.value,e.offset=J(i.offset)):e.velocity=0}function wi(e,i,s,n){if(!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;if(e.time??=0,(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=s.value),(e.delayTime??0)>0&&e.time<(e.delayTime??0))return;const a=e.offset?Q(e.offset):0,o=(e.velocity??0)*s.factor+3.6*a,r=e.decay??1,l=e.max,c=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=o,e.value<c&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=o,e.value>l&&(e.loops??=0,e.loops++,i?e.status=t.AnimationStatus.decreasing:e.value-=l)),e.velocity&&1!==r&&(e.velocity*=r),e.value=G(e.value,c,l)}function bi(t,e,i){if(!t)return;const{h:s,s:n,l:a}=t;wi(s,!1,e),wi(n,!0,e),wi(a,!0,e)}function Pi(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const xi=function(){const t=globalThis.tsParticles;return t?.pluginManager?t:new ee}();class Mi{enable=!1;mode="destination-out";load(t){V(t)||(ae(this,"mode",t.mode),ae(this,"enable",t.enable))}}class zi{id="blend";async getPlugin(t){const{BlendPluginInstance:e}=await Promise.resolve().then(function(){return Pa});return new e(t)}loadOptions(t,e,i){if(!this.needsPlugin(e)&&!this.needsPlugin(i))return;let s=e.blend;s?.load||(e.blend=s=new Mi),s.load(i?.blend)}loadParticlesOptions(t,e,i){e.blend??=new Mi,e.blend.load(i?.blend)}needsPlugin(t){return!!t?.blend?.enable||!!t?.particles?.blend?.enable}}async function Ci(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new zi)})}class ki{draw(t){!function(t){const{context:e,particle:i,radius:s}=t;i.circleRange??={min:0,max:v};const n=i.circleRange;e.arc(g.x,g.y,s,n.min,n.max,!1)}(t)}getSidesCount(){return 12}particleInit(t,e){const i=e.shapeData,s=i?.angle??{max:360,min:0};e.circleRange=F(s)?{min:nt(s.min),max:nt(s.max)}:{min:0,max:nt(s)}}}async function Si(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["circle"],()=>Promise.resolve(new ki))})}var Oi;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"}(Oi||(Oi={}));const Di=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,Ii=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class Ei{accepts(t){return t.startsWith("#")}handleColor(t){return this.#m(t.value)}handleRangeColor(t){return this.#m(t.value)}parseString(t){return this.#m(t)}#m(t){if("string"!=typeof t||!this.accepts(t))return;const e=t.replace(Di,(t,e,i,s,n)=>e+e+i+i+s+s+(void 0===n?"":n+n)),i=Ii.exec(e);return i?{a:i[Oi.a]?Number.parseInt(i[Oi.a],16)/255:1,b:Number.parseInt(i[Oi.b]??"0",16),g:Number.parseInt(i[Oi.g]??"0",16),r:Number.parseInt(i[Oi.r]??"0",16)}:void 0}}async function Ti(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hex",new Ei)})}var Li;!function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"}(Li||(Li={}));const Ri=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class _i{accepts(t){return t.startsWith("hsl")}handleColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return ci(e)}handleRangeColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return ci({h:X(e.h),l:X(e.l),s:X(e.s)})}parseString(t){if(!this.accepts(t))return;const e=Ri.exec(t);return e?hi({a:e.length>4?ht(e[Li.a]):1,h:Number.parseInt(e[Li.h]??"0",10),l:Number.parseInt(e[Li.l]??"0",10),s:Number.parseInt(e[Li.s]??"0",10)}):void 0}}async function Ai(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hsl",new _i)})}class Fi{id="move";#p;constructor(t){this.#p=t}async getPlugin(t){const{MovePluginInstance:e}=await Promise.resolve().then(function(){return Ma});return new e(this.#p,t)}loadOptions(){}needsPlugin(){return!0}}async function Bi(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{const e=t.pluginManager;e.initializers.pathGenerators??=new Map,e.addPathGenerator=(t,i)=>{e.initialized||(e.initializers.pathGenerators??=new Map,e.initializers.pathGenerators.set(t,i))},t.pluginManager.addPlugin(new Fi(t.pluginManager))})}function Vi(e,i){const s=e.value,n=e.animation,a={delayTime:X(n.delay)*p,enable:n.enable,value:X(e.value)*i,max:Z(s)*i,min:Y(s)*i,loops:0,maxLoops:X(n.count),time:0};if(n.enable){switch(a.decay=1-X(n.decay),n.mode){case t.AnimationMode.increase:a.status=t.AnimationStatus.increasing;break;case t.AnimationMode.decrease:a.status=t.AnimationStatus.decreasing;break;case t.AnimationMode.random:a.status=N()>=u?t.AnimationStatus.increasing:t.AnimationStatus.decreasing}const e=n.mode===t.AnimationMode.auto;switch(n.startValue){case t.StartValueType.min:a.value=a.min,e&&(a.status=t.AnimationStatus.increasing);break;case t.StartValueType.max:a.value=a.max,e&&(a.status=t.AnimationStatus.decreasing);break;case t.StartValueType.random:default:a.value=Q(a),e&&(a.status=N()>=u?t.AnimationStatus.increasing:t.AnimationStatus.decreasing)}}return a.initialValue=a.value,a}function Ui(e,i,s,n,a){if(e.destroyed||!i.enable||(i.maxLoops??0)>0&&(i.loops??0)>(i.maxLoops??0))return;const o=(i.velocity??0)*a.factor,r=i.min,l=i.max,c=i.decay??1;i.time??=0;const d=i.delayTime??0;if(!(d>0&&i.time<d&&(i.time+=a.value,i.time<d))){switch(i.status){case t.AnimationStatus.increasing:i.value+=o;break;case t.AnimationStatus.decreasing:i.value-=o}switch(i.velocity&&1!==c&&(i.velocity*=c),i.status){case t.AnimationStatus.increasing:i.value>=l&&(s?i.status=t.AnimationStatus.decreasing:i.value-=l,i.loops??=0,i.loops++);break;case t.AnimationStatus.decreasing:i.value<=r&&(s?i.status=t.AnimationStatus.increasing:i.value+=l,i.loops??=0,i.loops++)}!function(e,i,s,n,a){switch(i){case t.DestroyType.max:s>=a&&e.destroy();break;case t.DestroyType.min:s<=n&&e.destroy()}}(e,n,i.value,r,l),e.destroyed||(i.value=G(i.value,r,l))}}class Hi extends pe{destroy=t.DestroyType.none;load(t){super.load(t),V(t)||ae(this,"destroy",t.destroy)}}class $i extends De{animation=new Hi;value=1;load(t){if(V(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class Ni{#u;constructor(t){this.#u=t}init(t){const e=t.options.opacity;if(!e)return;t.opacity=Vi(e,1);const i=e.animation;i.enable&&(t.opacity.velocity=X(i.speed)/h*this.#u.retina.reduceFactor,i.sync||(t.opacity.velocity*=N()))}isEnabled(t){return!t.destroyed&&!t.spawning&&!!t.opacity&&t.opacity.enable&&((t.opacity.maxLoops??0)<=0||(t.opacity.maxLoops??0)>0&&(t.opacity.loops??0)<(t.opacity.maxLoops??0))}loadOptions(t,...e){ce(t,"opacity",$i,...e)}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,e){this.isEnabled(t)&&t.opacity&&t.options.opacity&&Ui(t,t.opacity,!0,t.options.opacity.animation.destroy,e)}}async function ji(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new Ni(t)))})}const qi={[t.OutModeDirection.left]:{axis:"x",canvas:"width",bounce:"horizontal",negativeEdge:"right",positiveEdge:"left",negative:!0},[t.OutModeDirection.right]:{axis:"x",canvas:"width",bounce:"horizontal",negativeEdge:"right",positiveEdge:"left",negative:!1},[t.OutModeDirection.top]:{axis:"y",canvas:"height",bounce:"vertical",negativeEdge:"bottom",positiveEdge:"top",negative:!0},[t.OutModeDirection.bottom]:{axis:"y",canvas:"height",bounce:"vertical",negativeEdge:"bottom",positiveEdge:"top",negative:!1}};class Wi{modes;#u;#y;constructor(e){this.#u=e,this.modes=[t.OutMode.bounce,t.OutMode.split],this.#y=e.plugins.filter(t=>!!t.particleBounce)}update(e,i,s,n){if(!this.modes.includes(n))return;for(const t of this.#y)if(t.particleBounce?.(e,s,i))return;const a=e.getPosition(),o=e.offset,r=e.getRadius(),l=zt(a,r),c=this.#u.canvas.size,d=!e.isInsideCanvasForOutMode(n,i);!function(e){if(e.outMode!==t.OutMode.bounce&&e.outMode!==t.OutMode.split||!(e.direction in qi))return;const i=qi[e.direction],s=e.bounds,n=e.canvasSize[i.canvas],a=e.particle.position,o=e.particle.velocity[i.axis];if(i.negative&&s[i.negativeEdge]<0?a[i.axis]=e.size+e.offset[i.axis]:!i.negative&&s[i.positiveEdge]>n&&(a[i.axis]=n-e.size-e.offset[i.axis]),!e.outOfCanvas||!(i.negative&&o<0||!i.negative&&o>0))return;e.particle.velocity[i.axis]*=-X(e.particle.options.bounce[i.bounce].value);const r=e.offset[i.axis]+e.size;a[i.axis]=i.negative?r:n-r,e.outMode===t.OutMode.split&&e.particle.destroy()}({particle:e,outMode:n,direction:i,bounds:l,canvasSize:c,offset:o,outOfCanvas:d,size:r})}}class Gi{modes;constructor(e){this.modes=[t.OutMode.destroy]}update(e,i,s,n){if(this.modes.includes(n)){switch(e.outType){case t.ParticleOutType.normal:case t.ParticleOutType.outside:if(e.isInsideCanvasForOutMode(n,i))return;break;case t.ParticleOutType.inside:{const{dx:t,dy:i}=tt(e.position,e.moveCenter),{x:s,y:n}=e.velocity;if(s<0&&t>e.moveCenter.radius||n<0&&i>e.moveCenter.radius||s>=0&&t<-e.moveCenter.radius||n>=0&&i<-e.moveCenter.radius)return;break}}e.destroy(!0)}}}class Ki{modes;#u;constructor(e){this.#u=e,this.modes=[t.OutMode.none]}update(e,i,s,n){if(!this.modes.includes(n))return;if((e.options.move.distance.horizontal&&(i===t.OutModeDirection.left||i===t.OutModeDirection.right))??(e.options.move.distance.vertical&&(i===t.OutModeDirection.top||i===t.OutModeDirection.bottom)))return;const a=e.options.move.gravity,o=this.#u,r=o.canvas.size,l=e.getRadius();if(a.enable){const s=e.position;(!a.inverse&&s.y>r.height+l&&i===t.OutModeDirection.bottom||a.inverse&&s.y<-l&&i===t.OutModeDirection.top)&&e.destroy()}else{if(e.velocity.y>0&&e.position.y<=r.height+l||e.velocity.y<0&&e.position.y>=-l||e.velocity.x>0&&e.position.x<=r.width+l||e.velocity.x<0&&e.position.x>=-l)return;xt(e.position,o.canvas.size,g,l,i)||e.destroy()}}}const Qi=E.origin;class Xi{modes;#u;constructor(e){this.#u=e,this.modes=[t.OutMode.out]}update(e,i,s,n){if(!this.modes.includes(n))return;const a=this.#u;if(e.outType===t.ParticleOutType.inside)this.#v(e,a);else{if(e.isInsideCanvasForOutMode(n,i))return;e.outType===t.ParticleOutType.outside?this.#w(e):this.#b(e,a,i)}}#v(t,e){const{x:i,y:s}=t.velocity;Qi.setTo(g),Qi.length=t.moveCenter.radius,Qi.angle=t.velocity.angle+Math.PI,Qi.addTo(t.moveCenter);const{dx:n,dy:a}=tt(t.position,Qi);if(i<=0&&n>=0||s<=0&&a>=0||i>=0&&n<=0||s>=0&&a<=0)return;t.position.x=Math.floor(Q({min:0,max:e.canvas.size.width})),t.position.y=Math.floor(Q({min:0,max:e.canvas.size.height}));const{dx:o,dy:r}=tt(t.position,t.moveCenter);t.direction=Math.atan2(-r,-o),t.velocity.angle=t.direction,t.justWarped=!0}#b(e,i,s){const n=e.options.move.warp,a=i.canvas.size,o=e.getRadius(),r={bottom:a.height+o+e.offset.y,left:-o-e.offset.x,right:a.width+o+e.offset.x,top:-o-e.offset.y},l=zt(e.position,o);s===t.OutModeDirection.right&&l.left>a.width+e.offset.x?(e.position.x=r.left,e.initialPosition.x=e.position.x,n||(e.position.y=N()*a.height,e.initialPosition.y=e.position.y),e.justWarped=!0):s===t.OutModeDirection.left&&l.right<-e.offset.x&&(e.position.x=r.right,e.initialPosition.x=e.position.x,n||(e.position.y=N()*a.height,e.initialPosition.y=e.position.y),e.justWarped=!0),s===t.OutModeDirection.bottom&&l.top>a.height+e.offset.y?(n||(e.position.x=N()*a.width,e.initialPosition.x=e.position.x),e.position.y=r.top,e.initialPosition.y=e.position.y,e.justWarped=!0):s===t.OutModeDirection.top&&l.bottom<-e.offset.y&&(n||(e.position.x=N()*a.width,e.initialPosition.x=e.position.x),e.position.y=r.bottom,e.initialPosition.y=e.position.y,e.justWarped=!0)}#w(t){t.position.x=Math.floor(Q({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.x,t.position.y=Math.floor(Q({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.y;const{dx:e,dy:i}=tt(t.position,t.moveCenter);t.moveCenter.radius&&(t.direction=Math.atan2(i,e),t.velocity.angle=t.direction),t.justWarped=!0}}class Yi{updaters;#u;constructor(t){this.#u=t,this.updaters=new Map}init(e){this.#P(e,t.OutMode.bounce,t=>new Wi(t)),this.#P(e,t.OutMode.out,t=>new Xi(t)),this.#P(e,t.OutMode.destroy,t=>new Gi(t)),this.#P(e,t.OutMode.none,t=>new Ki(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(e,i){const s=e.options.move.outModes;e.justWarped=!1,this.#x(e,i,s.bottom??s.default,t.OutModeDirection.bottom),this.#x(e,i,s.left??s.default,t.OutModeDirection.left),this.#x(e,i,s.right??s.default,t.OutModeDirection.right),this.#x(e,i,s.top??s.default,t.OutModeDirection.top)}#P(t,e,i){const s=t.options.move.outModes;!this.updaters.has(e)&&((t,e)=>t.default===e||t.bottom===e||t.left===e||t.right===e||t.top===e)(s,e)&&this.updaters.set(e,i(this.#u))}#x(t,e,i,s){for(const n of this.updaters.values())n.update(t,s,e,i)}}async function Zi(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("outModes",t=>Promise.resolve(new Yi(t)))})}class Ji{#u;#p;constructor(t,e){this.#u=e,this.#p=t}init(t){const e=this.#u,i=t.options,s=St(i.paint,t.id,i.reduceDuplicates);this.#M(s,t,e),this.#z(s,t,e)}isEnabled(t){const{fillAnimation:e,fillColor:i,strokeAnimation:s,strokeColor:n}=t,a=!!e&&(void 0!==i?.h.value&&i.h.enable||void 0!==i?.s.value&&i.s.enable||void 0!==i?.l.value&&i.l.enable),o=!!s&&(void 0!==n?.h.value&&n.h.enable||void 0!==n?.s.value&&n.s.enable||void 0!==n?.l.value&&n.l.enable);return!t.destroyed&&!t.spawning&&(a||o)}update(t,e){this.isEnabled(t)&&(bi(t.fillColor,e,this.#u.hdr),bi(t.strokeColor,e,this.#u.hdr))}#M(t,e,i){const s=t?.fill,n=t?.color,a=n??void 0;if(!s)return e.fillEnabled=!1,e.fillAnimation=void 0,e.fillColor=void 0,void(e.fillOpacity=1);const o=ye.create(void 0===a?void 0:ye.create(void 0,a),s.color);e.fillEnabled=s.enable,e.fillOpacity=X(s.opacity),e.fillAnimation=o.animation;const r=ai(this.#p,o);r&&(e.fillColor=yi(r,e.fillAnimation,i.retina.reduceFactor))}#z(t,e,i){const s=t?.stroke,n=t?.color,a=n??void 0;if(!s)return e.strokeAnimation=void 0,e.strokeColor=void 0,e.strokeOpacity=1,void(e.strokeWidth=0);const o=ye.create(void 0===a?void 0:ye.create(void 0,a),s.color);e.strokeWidth=X(s.width)*i.retina.pixelRatio,e.strokeOpacity=X(s.opacity??1),e.strokeAnimation=o.animation;const r=ai(this.#p,o)??e.getFillColor();r&&(e.strokeColor=yi(r,e.strokeAnimation,i.retina.reduceFactor))}}async function ts(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("paint",e=>Promise.resolve(new Ji(t.pluginManager,e)))})}var es;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=5]="a"}(es||(es={}));const is=/rgba?\(\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class ss{accepts(t){return t.startsWith("rgb")}handleColor(t){const e=t.value.rgb??t.value;if("r"in e&&"g"in e&&"b"in e)return e}handleRangeColor(t){const e=t.value.rgb??t.value;if("r"in e&&"g"in e&&"b"in e)return{r:X(e.r),g:X(e.g),b:X(e.b)}}parseString(t){if(!this.accepts(t))return;const e=is.exec(t);return e?{a:e.length>4?ht(e[es.a]):1,b:parseInt(e[es.b]??"0",10),g:parseInt(e[es.g]??"0",10),r:parseInt(e[es.r]??"0",10)}:void 0}}async function ns(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("rgb",new ss)})}class as extends pe{destroy=t.DestroyType.none;load(t){super.load(t),V(t)||ae(this,"destroy",t.destroy)}}class os extends De{animation=new as;value=3;load(t){if(super.load(t),V(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class rs{#u;constructor(t){this.#u=t}init(t){const e=this.#u,i=t.options.size;if(!i)return;const s=i.animation;s.enable&&(t.size.velocity=t.retina.sizeAnimationSpeed/h*e.retina.reduceFactor,s.sync||(t.size.velocity*=N()))}isEnabled(t){return!t.destroyed&&!t.spawning&&t.size.enable&&((t.size.maxLoops??0)<=0||(t.size.maxLoops??0)>0&&(t.size.loops??0)<(t.size.maxLoops??0))}loadOptions(t,...e){ce(t,"size",os,...e)}preInit(t){const e=this.#u.retina.pixelRatio,i=t.options.size;i&&(t.size=Vi(i,e),t.retina.sizeAnimationSpeed=X(i.animation.speed)*e)}reset(t){t.size.time=0,t.size.loops=0}update(t,e){this.isEnabled(t)&&t.options.size&&Ui(t,t.size,!0,t.options.size.animation.destroy,e)}}async function ls(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("size",t=>Promise.resolve(new rs(t)))})}async function cs(t){t.checkVersion("4.5.0"),await t.pluginManager.register(async t=>{await Promise.all([Ci(t),Ti(t),Ai(t),ns(t),Bi(t),Si(t),ts(t),ji(t),Zi(t),ls(t)])})}var ds;!function(t){t.move="move",t.line="line",t.bezier="bezier",t.quadratic="quadratic",t.arc="arc",t.ellipse="ellipse"}(ds||(ds={}));function hs(t,e,i){const s=i.segments[0];if(!s)return;const n=s.values[0];if(!n)return;t.moveTo(n.x*e,n.y*e);for(const s of i.segments){const i=s.values[0];if(!i)continue;const n=s.values[1],a=s.values[2],o=s.values[3];switch(s.type){case ds.move:t.moveTo(i.x*e,i.y*e);break;case ds.line:t.lineTo(i.x*e,i.y*e);break;case ds.bezier:if(!n||!a||!o)continue;t.bezierCurveTo(n.x*e,n.y*e,a.x*e,a.y*e,o.x*e,o.y*e);break;case ds.quadratic:if(!n||!a)continue;t.quadraticCurveTo(n.x*e,n.y*e,a.x*e,a.y*e);break;case ds.arc:if(!n||!a)continue;t.arc(i.x*e,i.y*e,n.x*e,a.x,a.y);break;case ds.ellipse:if(!n||!a||!o)continue;t.ellipse(i.x*e,i.y*e,n.x*e,n.y*e,a.x,o.x,o.y)}}if(!i.half)return;for(let s=i.segments.length-1;s>=0;s--){const n=i.segments[s];if(!n)continue;const a=n.values[0],o=1,r=2,l=n.values[o],c=n.values[r];switch(n.type){case ds.line:if(!a)break;t.lineTo(a.x*-e,a.y*e);break;case ds.bezier:if(!a||!l||!c)break;t.bezierCurveTo(-c.x*e,c.y*e,-l.x*e,l.y*e,-a.x*e,a.y*e);break;case ds.quadratic:if(!l||!c)break;t.quadraticCurveTo(-l.x*e,l.y*e,-c.x*e,c.y*e);case ds.arc:case ds.ellipse:}}}var us;!function(t){t.hearts="hearts",t.diamonds="diamonds",t.clubs="clubs",t.spades="spades"}(us||(us={}));const ps=u,gs=.25,fs=-ps,ms=-.25,ys=.0625,vs=.375,ws={half:!0,segments:[{type:ds.bezier,values:[{x:0,y:fs},{x:0,y:fs},{x:gs,y:fs},{x:gs,y:ms}]},{type:ds.bezier,values:[{x:gs,y:ms},{x:gs,y:ms},{x:ps,y:ms},{x:ps,y:0}]},{type:ds.bezier,values:[{x:ps,y:0},{x:ps,y:0},{x:ps,y:gs},{x:gs,y:gs}]},{type:ds.bezier,values:[{x:gs,y:gs},{x:gs,y:gs},{x:ys,y:gs},{x:ys,y:ys}]},{type:ds.bezier,values:[{x:ys,y:ys},{x:ys,y:gs},{x:gs,y:ps},{x:gs,y:ps}]},{type:ds.bezier,values:[{x:gs,y:ps},{x:gs,y:ps},{x:0,y:ps},{x:0,y:ps}]}]},bs={half:!0,segments:[{type:ds.bezier,values:[{x:0,y:ps},{x:0,y:ps},{x:vs,y:0},{x:vs,y:0}]},{type:ds.bezier,values:[{x:vs,y:0},{x:vs,y:0},{x:0,y:fs},{x:0,y:fs}]}]},Ps={half:!0,segments:[{type:ds.bezier,values:[{x:0,y:ps},{x:0,y:ps},{x:ps,y:0},{x:ps,y:ms}]},{type:ds.bezier,values:[{x:ps,y:ms},{x:ps,y:ms},{x:ps,y:fs},{x:gs,y:fs}]},{type:ds.bezier,values:[{x:gs,y:fs},{x:gs,y:fs},{x:0,y:fs},{x:0,y:ms}]}]},xs={half:!0,segments:[{type:ds.bezier,values:[{x:0,y:fs},{x:0,y:fs},{x:ps,y:ms},{x:ps,y:0}]},{type:ds.bezier,values:[{x:ps,y:0},{x:ps,y:0},{x:ps,y:gs},{x:gs,y:gs}]},{type:ds.bezier,values:[{x:gs,y:gs},{x:gs,y:gs},{x:ys,y:gs},{x:ys,y:ys}]},{type:ds.bezier,values:[{x:ys,y:ys},{x:ys,y:gs},{x:gs,y:ps},{x:gs,y:ps}]},{type:ds.bezier,values:[{x:gs,y:ps},{x:gs,y:ps},{x:0,y:ps},{x:0,y:ps}]}]},Ms={[us.hearts]:Ps,[us.diamonds]:bs,[us.clubs]:ws,[us.spades]:xs};class zs{draw(t){const{context:e,radius:i}=t;hs(e,i,Ms.clubs)}}async function Cs(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["club","clubs"],()=>Promise.resolve(new zs))})}class ks{draw(t){const{context:e,radius:i}=t;hs(e,i,Ms.diamonds)}}async function Ss(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["diamond","diamonds"],()=>Promise.resolve(new ks))})}let Os=class{draw(t){const{context:e,radius:i}=t;hs(e,i,Ms.hearts)}};async function Ds(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["heart","hearts"],()=>Promise.resolve(new Os))})}class Is{draw(t){const{context:e,radius:i}=t;hs(e,i,Ms.spades)}}async function Es(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["spade","spades"],()=>Promise.resolve(new Is))})}async function Ts(t){t.checkVersion("4.5.0"),await Promise.all([Cs(t),Ss(t),Ds(t),Es(t)])}class Ls{count;delay;duration;wait=!1;load(t){V(t)||(ae(this,"count",t.count),oe(this,"delay",t.delay),oe(this,"duration",t.duration),ae(this,"wait",t.wait))}}class Rs{delay=.1;quantity=1;load(t){V(t)||(oe(this,"quantity",t.quantity),oe(this,"delay",t.delay))}}class _s{color=!1;opacity=!1;load(t){V(t)||(ae(this,"color",t.color),ae(this,"opacity",t.opacity))}}class As{options={};replace=new _s;type="square";load(t){V(t)||(void 0!==t.options&&(this.options=Ct({},t.options??{})),this.replace.load(t.replace),ae(this,"type",t.type))}}class Fs{height=0;mode=t.PixelMode.percent;width=0;load(t){V(t)||(ae(this,"mode",t.mode),ae(this,"height",t.height),ae(this,"width",t.width))}}class Bs{fill;stroke;load(t){V(t)||(t.fill&&(this.fill??=new Me,this.fill.load(t.fill)),t.stroke&&(this.stroke??=new Re,this.stroke.load(t.stroke)))}}class Vs{autoPlay=!0;direction;domId;draggable=!1;draw=!0;fill=!0;life=new Ls;name;particles;position;rate=new Rs;shape=new As;size;spawn=new Bs;spawnFillColor;spawnStrokeColor;startCount=0;load(t){V(t)||(ae(this,"autoPlay",t.autoPlay),void 0!==t.size&&(this.size??=new Fs,this.size.load(t.size)),ae(this,"direction",t.direction),ae(this,"domId",t.domId),ae(this,"draggable",t.draggable),ae(this,"draw",t.draw),ae(this,"fill",t.fill),this.life.load(t.life),ae(this,"name",t.name),this.particles=kt(t.particles,t=>Ct({},t)),this.rate.load(t.rate),this.shape.load(t.shape),this.spawn.load(t.spawn),void 0!==t.position&&(this.position={},void 0!==t.position.x&&(this.position.x=J(t.position.x)),void 0!==t.position.y&&(this.position.y=J(t.position.y))),void 0!==t.spawnFillColor&&(this.spawnFillColor??=new ye,this.spawnFillColor.load(t.spawnFillColor)),void 0!==t.spawnStrokeColor&&(this.spawnStrokeColor??=new ye,this.spawnStrokeColor.load(t.spawnStrokeColor)),ae(this,"startCount",t.startCount))}}class Us{id="emitters";#C;constructor(t){this.#C=t}async getPlugin(t){const{EmittersPluginInstance:e}=await Promise.resolve().then(function(){return za});return new e(this.#C,t)}loadOptions(t,e,i){(this.needsPlugin(e)||this.needsPlugin(i))&&i?.emitters&&(e.emitters=kt(i.emitters,t=>{const e=new Vs;return e.load(t),e}))}needsPlugin(t){if(!t)return!1;const e=t.emitters;return B(e)&&!!e.length||void 0!==e}}const Hs=new WeakMap;var $s;async function Ns(t){t.checkVersion("4.5.0"),await t.pluginManager.register(async t=>{const e=await function(t){const e=t.pluginManager;let i=Hs.get(e);return i||(i=Promise.resolve().then(function(){return Sa}).then(({EmittersInstancesManager:t})=>new t(e)).catch(t=>{throw Hs.delete(e),t}),Hs.set(e,i)),i}(t);await async function(t){const{ShapeManager:e}=await Promise.resolve().then(function(){return ka}),i=t.pluginManager;i.emitterShapeManager??=new e,i.addEmitterShapeGenerator??=(t,e)=>{i.emitterShapeManager?.addShapeGenerator(t,e)}}(t),t.pluginManager.addPlugin(new Us(e))})}!function(t){t.emitter="emitter"}($s||($s={}));const js=["emoji"];async function qs(t,e){try{await yt().fonts.load(`${e??"400"} 36px '${t??"Verdana"}'`)}catch{}}const Ws='"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif';class Gs{#k=new Map;destroy(){for(const[t,e]of this.#k)e instanceof ImageBitmap&&e.close(),this.#k.delete(t)}draw(t){const e=t.particle.emojiDataKey;if(!e)return;const i=this.#k.get(e);i&&function(t,e){const{context:i,opacity:s}=t,n=i.globalAlpha,a=e.width,o=a*u;i.globalAlpha=s,i.drawImage(e,-o,-o,a,a),i.globalAlpha=n}(t,i)}async init(t){const e=t.actualOptions.particles.shape;if(!js.some(t=>bt(t,e.type)))return;const i=[qs(Ws)];kt(js.map(t=>e.options[t])[0],t=>{t.font&&i.push(qs(t.font))}),await Promise.all(i)}particleDestroy(t){t.emojiDataKey=void 0}particleInit(t,e){const i=e.shapeData;if(!i.value)return;const s=St(i.value,e.randomIndexData);if(!s)return;const n="string"==typeof s?{font:i.font??Ws,padding:i.padding??0,value:s}:{font:Ws,padding:0,...i,...s},a=n.font,o=n.value,r=`${o}_${a}`;if(this.#k.has(r))return void(e.emojiDataKey=r);const l=2*n.padding,c=Z(e.size.value),d=c+l,h=2*d,u=new OffscreenCanvas(h,h),p=u.getContext("2d",t.canvas.render.settings);if(!p)return;p.font=`400 ${(2*c).toString()}px ${a}`,p.textBaseline="middle",p.textAlign="center",p.fillText(o,d,d);const g=u instanceof HTMLCanvasElement?u:u.transferToImageBitmap();this.#k.set(r,g),e.emojiDataKey=r}}async function Ks(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(js,()=>Promise.resolve(new Gs))})}class Qs{draw(t){!function(t){const{context:e,radius:i}=t,s=2*i,n=i*u,a=i+n,o=-i,r=-i;e.moveTo(o,r+n),e.quadraticCurveTo(o,r,o+n,r),e.quadraticCurveTo(o+i,r,o+i,r+n),e.quadraticCurveTo(o+i,r,o+a,r),e.quadraticCurveTo(o+s,r,o+s,r+n),e.quadraticCurveTo(o+s,r+i,o+a,r+a),e.lineTo(o+i,r+s),e.lineTo(o+n,r+a),e.quadraticCurveTo(o,r+i,o,r+n)}(t)}}async function Xs(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["heart"],()=>Promise.resolve(new Qs))})}const Ys=["image","images"],Zs=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d.]+%?\))|currentcolor/gi;async function Js(t){return new Promise(e=>{t.loading=!0;const i=new Image;t.element=i,i.addEventListener("load",()=>{t.loading=!1,e()}),i.addEventListener("error",()=>{t.element=void 0,t.error=!0,t.loading=!1,n().error(`Error loading image: ${t.source}`),e()}),i.src=t.source})}async function tn(t){if("svg"!==t.type)return void await Js(t);t.loading=!0;const e=await fetch(t.source);e.ok?t.svgData=await e.text():(n().error("Image not found"),t.error=!0),t.loading=!1}function en(t,e,i,s,n=!1,a,o){const r=function(t,e,i,s=!1,n,a){const{svgData:o}=t;if(!o)return"";const r=gi(e,s,i,n,a);if(o.includes("fill"))return o.replaceAll(Zs,()=>r);const l=o.indexOf(">");return`${o.substring(0,l)} fill="${r}"${o.substring(l)}`}(t,i,s.opacity?.value??1,n,a,o),l={color:i,data:{...t,svgData:r},loaded:!1,ratio:e.width/e.height,replaceColor:e.replaceColor,source:e.src};return new Promise(e=>{const i=new Blob([r],{type:"image/svg+xml"}),s=URL.createObjectURL(i),n=new Image;n.addEventListener("load",()=>{l.loaded=!0,l.element=n,e(l),URL.revokeObjectURL(s)});n.addEventListener("error",()=>{(async()=>{URL.revokeObjectURL(s);const i={...t,error:!1,loading:!0};await Js(i),l.loaded=!0,l.element=i.element,e(l)})()}),n.src=s})}const sn="TSP-2001",nn="TSP-2002",an="TSP-2003",on="TSP-2004";class rn{#u;#n;constructor(t,e){this.#n=t,this.#u=e}draw(t){const{context:e,radius:i,particle:s,opacity:n}=t,a=s.image,o=a?.element;if(a){if(e.globalAlpha=n,o){const t=a.ratio,s={x:-i,y:-i},n=2*i;e.drawImage(o,s.x,s.y,n,n/t)}e.globalAlpha=1}}getSidesCount(){return 12}async init(t){const e=t.actualOptions;if(!e.preload||!this.#n.loadImage)return;const i=[];for(const s of e.preload)i.push(this.#n.loadImage(t,s));await Promise.all(i)}loadShape(t){const e=this.#u;if(!t.shape||!Ys.includes(t.shape))return;const i=t.shapeData;if(!i)return;const s=this.#n.getImages?.(e),n=s?.find(t=>t.name===i.name||t.source===i.src);n||this.#S(e,i).then(()=>{this.loadShape(t)})}particleInit(t,e){if("image"!==e.shape&&"images"!==e.shape)return;const i=this.#n.getImages?.(t),s=e.shapeData;if(!s)return;const n=e.getFillColor(),a=i?.find(t=>t.name===s.name||t.source===s.src);if(!a)return;const o=s.replaceColor;a.loading?setTimeout(()=>{this.particleInit(t,e)}):(async()=>{let i;i=a.svgData&&n?await en(a,s,n,e,t.hdr,t.peakNits,t.hdrMode):{color:n,data:a,element:a.element,loaded:!0,ratio:s.width&&s.height?s.width/s.height:a.ratio??1,replaceColor:o,source:s.src},i.ratio||(i.ratio=1);const r={image:i,close:s.close??e.shapeClose};e.image=r.image,e.shapeClose=r.close})()}#S=async(t,e)=>{if(!this.#n.loadImage)throw new Error(pt(on));await this.#n.loadImage(t,{name:e.name,replaceColor:e.replaceColor,src:e.src})}}class ln{height;name;replaceColor;src="";width;load(t){V(t)||(ae(this,"height",t.height),ae(this,"name",t.name),ae(this,"replaceColor",t.replaceColor),ae(this,"src",t.src),ae(this,"width",t.width))}}class cn{id="image-preloader";#n;constructor(t){this.#n=t}async getPlugin(t){const{ImagePreloaderInstance:e}=await Promise.resolve().then(function(){return Oa});return new e(this.#n,t)}loadOptions(t,e,i){if(!i?.preload)return;e.preload??=[];const s=e.preload;for(const t of i.preload){const e=s.find(e=>e.name===t.name||e.src===t.src);if(e)e.load(t);else{const e=new ln;e.load(t),s.push(e)}}}needsPlugin(){return!0}}async function dn(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{!function(t){t.getImages??=e=>{t.images??=new Map;let i=t.images.get(e);return i||(i=[],t.images.set(e,i)),i},t.loadImage??=async(e,i)=>{if(!t.getImages)throw new Error(pt(sn));if(!i.name&&!i.src)throw new Error(pt(nn));t.images??=new Map;const s=t.getImages(e);if(!s.some(t=>t.name===i.name||t.source===i.src))try{const n={name:i.name??i.src,source:i.src,type:i.src.substring(i.src.length-3),error:!1,loading:!0,replaceColor:i.replaceColor,ratio:i.width&&i.height?i.width/i.height:void 0};let a;s.push(n),t.images.set(e,s),a=i.replaceColor?tn:Js,await a(n)}catch{throw new Error(pt(an,i.name??i.src))}}}(t),t.pluginManager.addPlugin(new cn(t)),t.pluginManager.addShape(Ys,e=>Promise.resolve(new rn(t,e)))})}class hn extends Se{sync=!1;load(t){V(t)||(super.load(t),ae(this,"sync",t.sync))}}class un extends Se{sync=!1;load(t){V(t)||(super.load(t),ae(this,"sync",t.sync))}}class pn{count=0;delay=new hn;duration=new un;load(t){V(t)||(ae(this,"count",t.count),this.delay.load(t.delay),this.duration.load(t.duration))}}class gn{#u;constructor(t){this.#u=t}init(t){const e=this.#u,i=t.options.life;if(!i)return;const s=i.delay.sync?1:N(),n=i.duration.sync?1:N();t.life={delay:e.retina.reduceFactor?X(i.delay.value)*s/e.retina.reduceFactor*p:0,delayTime:0,duration:e.retina.reduceFactor?X(i.duration.value)*n/e.retina.reduceFactor*p:0,time:0,count:i.count},t.life.duration<=0&&(t.life.duration=-1),t.life.count<=0&&(t.life.count=-1),t.spawning=t.life.delay>0}isEnabled(t){return!t.destroyed}loadOptions(t,...e){ce(t,"life",pn,...e)}update(t,e){this.isEnabled(t)&&t.life&&function(t,e,i){if(!t.life)return;const s=t.life;let n=!1;if(t.spawning){if(s.delayTime+=e.value,!(s.delayTime>=t.life.delay))return;n=!0,t.spawning=!1,s.delayTime=0,s.time=0}if(-1===s.duration)return;if(n?s.time=0:s.time+=e.value,s.time<s.duration)return;if(s.time=0,t.life.count>0&&t.life.count--,0===t.life.count)return void t.destroy();const a=J(0,i.width),o=J(0,i.width);t.position.x=Q(a),t.position.y=Q(o),t.spawning=!0,s.delayTime=0,s.time=0,t.reset();const r=t.options.life;r&&(s.delay=X(r.delay.value)*p,s.duration=X(r.duration.value)*p)}(t,e,this.#u.canvas.size)}}async function fn(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("life",t=>Promise.resolve(new gn(t)))})}class mn{factor=4;value=!0;load(t){V(t)||(ae(this,"factor",t.factor),ae(this,"value",t.value))}}class yn{disable=!0;reduce=new mn;load(t){V(t)||(ae(this,"disable",t.disable),this.reduce.load(t.reduce))}}class vn{id="motion";async getPlugin(t){const{MotionPluginInstance:e}=await Promise.resolve().then(function(){return Da});return new e(t)}loadOptions(t,e,i){if(!this.needsPlugin())return;let s=e.motion;s?.load||(e.motion=s=new yn),s.load(i?.motion)}needsPlugin(){return!0}}async function wn(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new vn)})}const bn=new Map;function Pn(t,e){const{context:i,radius:s}=t,n=function(t){const e=bn.get(t);if(e)return e;const i=v/t,s=!!(t%2),n=(-Math.PI+(s?0:i))*u,a=[];for(let e=0;e<t;e++){const t=n+e*i;a[e]={x:Math.cos(t),y:Math.sin(t)}}return bn.set(t,a),a}(e.count.numerator/e.count.denominator);i.beginPath();for(let t=0;t<n.length;t++){const e=n[t];if(!e)continue;const a=e.x*s,o=e.y*s;t?i.lineTo(a,o):i.moveTo(a,o)}i.closePath()}class xn{draw(t){const{particle:e,radius:i}=t;Pn(t,this.getSidesData(e,i))}getSidesCount(t){const e=t.shapeData;return Math.round(X(e?.sides??5))}}class Mn extends xn{getSidesData(t,e){const{sides:i}=t;return{count:{denominator:1,numerator:i},length:2.66*e/(i/3)}}}class zn extends xn{getSidesCount(){return 3}getSidesData(t,e){return{count:{denominator:1,numerator:3},length:2.66*e/1}}}async function Cn(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["polygon"],()=>Promise.resolve(new Mn))})}async function kn(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["triangle"],()=>Promise.resolve(new zn))})}async function Sn(t){t.checkVersion("4.5.0"),await Promise.all([Cn(t),kn(t)])}var On;!function(t){t.both="both",t.horizontal="horizontal",t.vertical="vertical"}(On||(On={}));class Dn{enable=!1;value=0;load(t){V(t)||(ae(this,"enable",t.enable),oe(this,"value",t.value))}}class In{backColor;darken=new Dn;enable=!1;enlighten=new Dn;mode=On.vertical;speed=25;load(t){V(t)||(void 0!==t.backColor&&(this.backColor=me.create(this.backColor,t.backColor)),this.darken.load(t.darken),ae(this,"enable",t.enable),this.enlighten.load(t.enlighten),ae(this,"mode",t.mode),oe(this,"speed",t.speed))}}class En{#p;constructor(t){this.#p=t}getTransformValues(t){const e=t.roll?.enable&&t.roll,i=e&&e.horizontal,s=e&&e.vertical;return{a:i?Math.cos(e.angle):void 0,d:s?Math.sin(e.angle):void 0}}init(e){!function(e,i){const s=i.options.roll;if(s?.enable)if(i.roll={enable:s.enable,horizontal:s.mode===On.horizontal||s.mode===On.both,vertical:s.mode===On.vertical||s.mode===On.both,angle:N()*v,speed:X(s.speed)/360},s.backColor)i.backColor=ai(e,s.backColor);else if(s.darken.enable&&s.enlighten.enable){const e=N()>=u?t.AlterType.darken:t.AlterType.enlighten;i.roll.alter={type:e,value:X(e===t.AlterType.darken?s.darken.value:s.enlighten.value)}}else s.darken.enable?i.roll.alter={type:t.AlterType.darken,value:X(s.darken.value)}:s.enlighten.enable&&(i.roll.alter={type:t.AlterType.enlighten,value:X(s.enlighten.value)});else i.roll={enable:!1,horizontal:!1,vertical:!1,angle:0,speed:0}}(this.#p,e)}isEnabled(t){const e=t.options.roll;return!t.destroyed&&!t.spawning&&!!e?.enable}loadOptions(t,...e){ce(t,"roll",In,...e)}update(t,e){this.isEnabled(t)&&function(t,e){const i=t.options.roll,s=t.roll;if(!s||!i?.enable)return;const n=s.speed*e.factor,a=v;s.angle+=n,s.angle>a&&(s.angle-=a)}(t,e)}}async function Tn(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("roll",()=>Promise.resolve(new En(t.pluginManager)))})}class Ln{decay=0;enable=!1;speed=0;sync=!1;load(t){V(t)||(ae(this,"enable",t.enable),oe(this,"speed",t.speed),oe(this,"decay",t.decay),ae(this,"sync",t.sync))}}class Rn extends Se{animation=new Ln;direction=t.RotateDirection.clockwise;path=!1;load(t){V(t)||(super.load(t),ae(this,"direction",t.direction),this.animation.load(t.animation),ae(this,"path",t.path))}}class _n{#u;constructor(t){this.#u=t}init(e){const i=e.options.rotate;if(!i)return;e.rotate={enable:i.animation.enable,value:nt(X(i.value)),min:0,max:v},e.pathRotation=i.path;let s=i.direction;if(s===t.RotateDirection.random){s=Math.floor(2*N())>0?t.RotateDirection.counterClockwise:t.RotateDirection.clockwise}switch(s){case t.RotateDirection.counterClockwise:case"counterClockwise":e.rotate.status=t.AnimationStatus.decreasing;break;case t.RotateDirection.clockwise:e.rotate.status=t.AnimationStatus.increasing}const n=i.animation;n.enable&&(e.rotate.decay=1-X(n.decay),e.rotate.velocity=X(n.speed)/360*this.#u.retina.reduceFactor,n.sync||(e.rotate.velocity*=N())),e.rotation=e.rotate.value}isEnabled(t){const e=t.options.rotate;return!!e&&(!t.destroyed&&!t.spawning&&(!!e.value||e.animation.enable||e.path))}loadOptions(t,...e){ce(t,"rotate",Rn,...e)}update(e,i){this.isEnabled(e)&&(e.isRotating=!!e.rotate,e.rotate&&(Ui(e,e.rotate,!1,t.DestroyType.none,i),e.rotation=e.rotate.value))}}async function An(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("rotate",t=>Promise.resolve(new _n(t)))})}class Fn{draw(t){!function(t){const{context:e,radius:i}=t,s=i*Math.SQRT1_2,n=2*s;e.rect(-s,-s,n,n)}(t)}getSidesCount(){return 4}}async function Bn(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["edge","square"],()=>Promise.resolve(new Fn))})}const Vn=0,Un=0;class Hn{draw(t){!function(t){const{context:e,particle:i,radius:s}=t,n=i.sides,a=i.starInset??2;e.moveTo(Vn,Un-s);for(let t=0;t<n;t++)e.rotate(Math.PI/n),e.lineTo(Vn,Un-s*a),e.rotate(Math.PI/n),e.lineTo(Vn,Un-s)}(t)}getSidesCount(t){const e=t.shapeData;return Math.round(X(e?.sides??5))}particleInit(t,e){const i=e.shapeData;e.starInset=X(i?.inset??2)}}async function $n(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["star"],()=>Promise.resolve(new Hn))})}var Nn;!function(t){t.clockwise="clockwise",t.counterClockwise="counter-clockwise",t.random="random"}(Nn||(Nn={}));class jn{decay=0;enable=!1;speed=0;sync=!1;load(t){V(t)||(ae(this,"enable",t.enable),oe(this,"speed",t.speed),oe(this,"decay",t.decay),ae(this,"sync",t.sync))}}class qn extends Se{animation=new jn;direction=Nn.clockwise;enable=!1;load(t){super.load(t),V(t)||(this.animation.load(t.animation),ae(this,"direction",t.direction),ae(this,"enable",t.enable))}}class Wn{#u;constructor(t){this.#u=t}getTransformValues(t){const e=t.tilt?.enable&&t.tilt;return{b:e?Math.cos(e.value)*e.cosDirection:void 0,c:e?Math.sin(e.value)*e.sinDirection:void 0}}init(e){const i=e.options.tilt;if(!i)return;e.tilt={enable:i.enable,value:nt(X(i.value)),sinDirection:N()>=u?1:-1,cosDirection:N()>=u?1:-1,min:0,max:v};let s=i.direction;if(s===Nn.random){s=Math.floor(2*N())>0?Nn.counterClockwise:Nn.clockwise}switch(s){case Nn.counterClockwise:case"counterClockwise":e.tilt.status=t.AnimationStatus.decreasing;break;case Nn.clockwise:e.tilt.status=t.AnimationStatus.increasing}const n=e.options.tilt?.animation;n?.enable&&(e.tilt.decay=1-X(n.decay),e.tilt.velocity=X(n.speed)/360*this.#u.retina.reduceFactor,n.sync||(e.tilt.velocity*=N()))}isEnabled(t){const e=t.options.tilt?.animation;return!t.destroyed&&!t.spawning&&!!e?.enable}loadOptions(t,...e){ce(t,"tilt",qn,...e)}update(e,i){this.isEnabled(e)&&e.tilt&&Ui(e,e.tilt,!1,t.DestroyType.none,i)}}async function Gn(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("tilt",t=>Promise.resolve(new Wn(t)))})}class Kn{angle=50;move=10;load(t){V(t)||(oe(this,"angle",t.angle),oe(this,"move",t.move))}}class Qn{distance=5;enable=!1;speed=new Kn;load(t){if(!V(t)&&(oe(this,"distance",t.distance),ae(this,"enable",t.enable),void 0!==t.speed))if(R(t.speed))this.speed.load({angle:t.speed});else{const e=t.speed;"min"in e?this.speed.load({angle:e}):this.speed.load(t.speed)}}}class Xn{#u;constructor(t){this.#u=t}init(t){const e=t.options.wobble;t.wobble=e?.enable?{angle:N()*v,angleSpeed:X(e.speed.angle)/360,moveSpeed:X(e.speed.move)/10}:{angle:0,angleSpeed:0,moveSpeed:0},t.retina.wobbleDistance=X(e?.distance??0)*this.#u.retina.pixelRatio}isEnabled(t){return!t.destroyed&&!t.spawning&&!!t.options.wobble?.enable}loadOptions(t,...e){ce(t,"wobble",Qn,...e)}update(t,e){this.isEnabled(t)&&function(t,e,i){const{wobble:s}=e.options,{wobble:n}=e;if(!s?.enable||!n)return;const a=t.retina.reduceFactor,o=n.angleSpeed*i.factor*a,r=n.moveSpeed*i.factor*a*(e.retina.wobbleDistance??0)/16.666666666666668,l=v,{position:c}=e;n.angle+=o,n.angle>l&&(n.angle-=l),c.x+=r*Math.cos(n.angle),c.y+=r*Math.abs(Math.sin(n.angle))}(this.#u,t,e)}}async function Yn(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("wobble",t=>Promise.resolve(new Xn(t)))})}class Zn{angle;colors;count;decay;disableForReducedMotion;drift;flat;gravity;position;scalar;shapeOptions;shapes;spread;startVelocity;ticks;zIndex;constructor(){this.angle=90,this.count=50,this.spread=45,this.startVelocity=45,this.decay=.9,this.gravity=1,this.drift=0,this.ticks=200,this.position={x:50,y:50},this.colors=["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],this.shapes=["square","circle"],this.scalar=1,this.zIndex=100,this.disableForReducedMotion=!0,this.flat=!1,this.shapeOptions={}}get origin(){return{x:this.position.x/h,y:this.position.y/h}}set origin(t){this.position.x=t.x*h,this.position.y=t.y*h}get particleCount(){return this.count}set particleCount(t){this.count=t}load(t){if(V(t))return;ae(this,"angle",t.angle);const e=t.count??t.particleCount;void 0!==e&&(this.count=e),ae(this,"spread",t.spread),ae(this,"startVelocity",t.startVelocity),ae(this,"decay",t.decay),ae(this,"flat",t.flat),ae(this,"gravity",t.gravity),ae(this,"drift",t.drift),ae(this,"ticks",t.ticks);const i=t.origin;i&&!t.position&&(t.position={x:void 0===i.x?void 0:i.x*h,y:void 0===i.y?void 0:i.y*h});const s=t.position;s&&(void 0!==s.x&&(this.position.x=s.x),void 0!==s.y&&(this.position.y=s.y)),void 0!==t.colors&&(B(t.colors)?this.colors=[...t.colors]:this.colors=t.colors);const n=t.shapeOptions;if(void 0!==n)for(const t in n){const e=n[t];e&&(this.shapeOptions[t]=Ct(this.shapeOptions[t]??{},e))}void 0!==t.shapes&&(B(t.shapes)?this.shapes=[...t.shapes]:this.shapes=t.shapes),ae(this,"scalar",t.scalar),ae(this,"zIndex",t.zIndex),ae(this,"disableForReducedMotion",t.disableForReducedMotion)}}const Jn=new Map;async function ta(t,e){const i=new Zn;i.load(e.options);const s=Number.isFinite(i.ticks)&&i.ticks>0?i.ticks:void 0,n=void 0===s?0:12e3/(60*s);let a=Jn.get(e.id);a instanceof Promise&&(await a,a=Jn.get(e.id));const o=a;if(o&&!o.destroyed){const t=o;if("addEmitter"in t)return await async function(t,e,i){await(t.addEmitter?.({startCount:e.count,position:e.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1},particles:{paint:{fill:{color:{value:e.colors},enable:!0}},shape:{type:e.shapes,options:e.shapeOptions},life:{count:1},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:i,startValue:"max",destroy:"min",count:1}},size:{value:5*e.scalar},move:{angle:{value:e.spread,offset:0},drift:{min:-e.drift,max:e.drift},gravity:{acceleration:9.81*e.gravity},speed:3*e.startVelocity,decay:1-e.decay,direction:-e.angle},rotate:{value:e.flat?0:{min:0,max:360},direction:"random",animation:{enable:!e.flat,speed:60}},tilt:{direction:"random",enable:!e.flat,value:e.flat?0:{min:0,max:360},animation:{enable:!0,speed:60}},roll:{darken:{enable:!0,value:25},enable:!e.flat,speed:{min:15,max:25}},wobble:{distance:30,enable:!e.flat,speed:{min:-15,max:15}}}}))}(t,i,n),o}const r=(async()=>{const s=function(t,e,i){return{fullScreen:{enable:!e.canvas,zIndex:t.zIndex},fpsLimit:120,particles:{number:{value:0},paint:{fill:{color:{value:t.colors},enable:!0}},shape:{type:t.shapes,options:t.shapeOptions},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:i,startValue:"max",destroy:"min",count:1}},size:{value:5*t.scalar},links:{enable:!1},life:{count:1},move:{angle:{value:t.spread,offset:0},drift:{min:-t.drift,max:t.drift},enable:!0,gravity:{enable:!0,acceleration:9.81*t.gravity},speed:3*t.startVelocity,decay:1-t.decay,direction:-t.angle,random:!0,straight:!1,outModes:{top:"none",default:"destroy"}},rotate:{value:t.flat?0:{min:0,max:360},direction:"random",animation:{enable:!t.flat,speed:60}},tilt:{direction:"random",enable:!t.flat,value:t.flat?0:{min:0,max:360},animation:{enable:!0,speed:60}},roll:{darken:{enable:!0,value:25},enable:!t.flat,speed:{min:15,max:25}},wobble:{distance:30,enable:!t.flat,speed:{min:-15,max:15}}},motion:{disable:t.disableForReducedMotion},emitters:{name:"confetti",startCount:t.count,position:t.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}}}(i,e,n),a=await t.load({id:e.id,element:e.canvas,options:s});return Jn.set(e.id,a),a})();return Jn.set(e.id,r),r}let ea=null;async function ia(t){return ea||(ea=async function(t){t.checkVersion("4.5.0"),await t.pluginManager.register(async t=>{await Promise.all([cs(t),wn(t),Ns(t),Ts(t),Xs(t),dn(t),Sn(t),Bn(t),$n(t),Ks(t),An(t),fn(t),Tn(t),Gn(t),Yn(t)])})}(t),ea)}async function sa(t,e){let i,s;return await ia(xi),L(t)?(s=t,i=e??{}):(s="confetti",i=t),ta(xi,{id:s,options:i})}sa.create=async(t,e={})=>{await ia(xi);const i=t?.getAttribute("id")??"confetti";return t?.setAttribute("id",i),await ta(xi,{id:i,canvas:t??void 0,options:e}),async(s,n)=>{let a,o;return L(s)?(o=s,a=n??e):(o=i,a=s),ta(xi,{id:o,canvas:t??void 0,options:a})}},sa.init=async()=>{await ia(xi)},sa.version="4.5.0",globalThis.confetti=sa;const na=globalThis;na.confetti=sa,na.tsParticles=xi;function aa(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class oa{#O;#D;#I;#E;#T;#u;#L;#R;#_;#A;#F;#B;#p;#V;#U;#H={};#$=[void 0,void 0];#N={};constructor(t,e,i){this.#p=t,this.#u=e,this.#E=i,this.#L=null,this.#O=null,this.#D=new Set,this.#U=[],this.#V=[],this.#I=[],this.#T=[],this.#_=[],this.#A=[],this.#F=[],this.#B={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[]}}get settings(){return this.#R}canvasClear(){this.#u.actualOptions.clear&&this.draw(t=>{t.clearRect(g.x,g.y,this.#E.size.width,this.#E.size.height)})}clear(){const e=new Set;for(const t of this.#I)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.#j(i))if(!e.has(t)&&(e.add(t),t.canvasClear?.()))return t;this.canvasClear()}destroy(){this.stop(),this.#O=null,this.#D.clear(),this.#U=[],this.#V=[],this.#I=[],this.#T=[],this.#_=[],this.#A=[],this.#F=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#B[e]=[])}draw(t){const e=this.#L;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.#q(t);if(a??=s,o??=n,!a&&!o)return;const r=this.#u,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:d,opacity:h,strokeOpacity:u}=t.getOpacity(),p=this.#N,g=this.#H,f=a?gi(a,r.hdr,d*h,r.peakNits,r.hdrMode):void 0,m=o?gi(o,r.hdr,u*h,r.peakNits,r.hdrMode):f;p.a=p.b=p.c=p.d=void 0,g.fill=f,g.stroke=m,this.draw(s=>{for(const i of this.#F)i.drawParticleSetup?.(s,t,e);this.#W(s,t,i,h,g,p),this.#G({container:r,context:s,particle:t,delta:e,colorStyles:g,radius:i*c**l.sizeRate,opacity:h,transform:p}),this.#K(t);for(const i of this.#A)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this.#_)this.#Q(i,s,t,e)})}drawParticles(e){const{particles:i,actualOptions:s}=this.#u,n=this.clear();i.update(e),this.draw(a=>{const o=this.#E.size.width,r=this.#E.size.height;if(this.#O)try{a.drawImage(this.#O,g.x,g.y,o,r)}catch{this.#X("background-element-draw-error","Error drawing background element onto canvas")}const l=s.background;if(l.draw)try{l.draw(a,e)}catch{this.#X("background-draw-error","Error in background.draw callback")}for(const e of this.#j(t.DrawLayer.BackgroundMask))e!==n&&e.canvasPaint?.();for(const i of this.#j(t.DrawLayer.CanvasSetup))i.drawSettingsSetup?.(a,e);for(const i of this.#j(t.DrawLayer.PluginContent))i.draw?.(a,e);i.drawParticles(e);for(const i of this.#j(t.DrawLayer.CanvasCleanup))i.clearDraw?.(a,e),i.drawSettingsCleanup?.(a,e)})}init(){this.initUpdaters(),this.initPlugins(),this.#Y(),this.paint()}initPlugins(){this.#I=[],this.#T=[],this.#_=[],this.#F=[],this.#A=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#B[e]=[]);this.#Z()}initUpdaters(){this.#U=[],this.#V=[];for(const t of this.#u.particleUpdaters)t.afterDraw&&this.#V.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#U.push(t)}paint(){let e=!1;for(const i of this.#j(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.#E.size.width,this.#E.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.#E.size.width,this.#E.size.height),i.globalAlpha=s})}setContext(t){this.#L=t,this.#L&&(this.#L.globalCompositeOperation=l)}setContextSettings(t){this.#R=t}stop(){this.draw(t=>{t.clearRect(g.x,g.y,this.#E.size.width,this.#E.size.height)})}#K(t){for(const e of this.#V)e.afterDraw?.(t)}#W(t,e,i,s,n,a){for(const o of this.#U){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)aa(a,t,e)}o.beforeDraw?.(e)}}#J(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}#tt(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}#G(t){const{container:e,context:i,particle:s,delta:n,colorStyles:a,radius:o,opacity:r,transform:l}=t,{effectDrawers:c,shapeDrawers:d}=e,h=s.getPosition(),u=s.getTransformData(l),p={x:h.x,y:h.y};i.setTransform(u.a,u.b,u.c,u.d,h.x,h.y),a.fill&&(i.fillStyle=a.fill);const g=!!s.fillEnabled,f=s.strokeWidth??0;i.lineWidth=f,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:g,stroke:f>0,transformData:u,position:{...h},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?d.get(s.shape):void 0;this.#tt(y,m),this.#et(v,m),this.#it(v,m),this.#st(v,m),this.#J(y,m),i.resetTransform()}#Q(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}#it(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())}#st(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}#et(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}#j(t){return this.#B[t]}#q(t){let e,i;for(const s of this.#T)if(!e&&s.particleFillColor&&(e=ai(this.#p,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=ai(this.#p,s.particleStrokeColor(t))),e&&i)break;return this.#$[0]=e,this.#$[1]=i,this.#$}#nt(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.#B[t].push(e)}#Z(){for(const t of this.#u.plugins)(t.particleFillColor??t.particleStrokeColor)&&this.#T.push(t),t.drawParticle&&this.#_.push(t),t.drawParticleSetup&&this.#F.push(t),t.drawParticleCleanup&&this.#A.push(t),t.canvasClear&&this.#I.push(t),this.#nt(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}#Y(){const t=this.#u.actualOptions.background;if(this.#O=null,t.element)if("string"==typeof t.element){if("undefined"!=typeof document){const e=document.querySelector(t.element);e&&this.#at(e)?this.#O=e:e?this.#X("background-element-not-supported",`Background element "${t.element}" is not a supported drawable element (canvas, video, or img)`):this.#X("background-element-not-found",`Background element selector "${t.element}" not found`)}}else this.#at(t.element)&&(this.#O=t.element)}#X(t,e){this.#D.has(t)||(this.#D.add(t),n().warning(e))}}const ra=new WeakMap;function la(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 ca{domElement;render;renderCanvas;size;zoom=1;#u;#ot;#rt;#lt;#ct;#p;#dt;#ht;#ut;#pt;constructor(t,e){this.#p=t,this.#u=e,this.render=new oa(t,e,this),this.#ut={height:0,width:0};const i=e.retina.pixelRatio,s=this.#ut;this.size={height:s.height*i,width:s.width*i},this.#ot=!1,this.#ht=[],this.#dt="none"}get#gt(){return this.#u.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.#ft();this.render.destroy(),this.#ht=[]}getZoomCenter(){const t=this.#u.retina.pixelRatio,{width:e,height:i}=this.size;return this.#pt?this.#pt:{x:e*u/t,y:i*u/t}}init(){this.#mt(t=>{t.disconnect()}),this.#lt=wt(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this.#yt()}),this.resize(),this.#vt(),this.#mt(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.#u,i=e.actualOptions.background,s=this.domElement;if(!s)return;const n=s.style,a=si(this.#p,i.color);if(a){const s=e.actualOptions.hdr;n.backgroundColor=pi(a,e.hdr,i.opacity,s.peakNits,A(t.HdrMode,s.mode,t.HdrMode.standard))}else n.backgroundColor="";n.backgroundImage=i.image||"",n.backgroundPosition=i.position||"",n.backgroundRepeat=i.repeat||"",n.backgroundSize=i.size||""}initPlugins(){this.#ht=[];for(const t of this.#u.plugins)t.resize&&this.#ht.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=ra.get(t);if(e)return e;if("function"!=typeof t.transferControlToOffscreen)throw new TypeError(pt(ut.offscreenCanvasUnsupported));try{const e=t.transferControlToOffscreen();return ra.set(t,e),e}catch{throw new TypeError(pt(ut.offscreenCanvasTransferFailed))}})(e):t;const i=this.domElement;i&&(i.ariaHidden="true",this.#ct=Dt(i.style));const s=this.#ut,n=this.renderCanvas;i?(s.height=i.offsetHeight,s.width=i.offsetWidth):(s.height=n.height,s.width=n.width);const a=this.#u.retina.pixelRatio,r=this.size;n.height=r.height=s.height*a,n.width=r.width=s.width*a}resize(){const t=this.domElement;if(!t)return!1;const e=this.#u,i=this.renderCanvas;if(void 0===i)return!1;const s=e.canvas.#ut,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.#u.started&&e.particles.setResizeFactor({width:s.width/r.width,height:s.height/r.height}),!0}setPointerEvents(t){this.domElement&&(this.#dt=t,this.#yt())}setZoom(t,e){this.zoom=t,this.#pt=e}stop(){this.#mt(t=>{t.disconnect()}),this.#lt=void 0,this.#Pt(),this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#u,e=t.updateActualOptions();t.particles.setDensity(),this.#xt(),e&&await t.refresh()}#xt(){for(const t of this.#ht)t.resize?.()}#wt(){const e=this.#u,i=e.actualOptions.hdr.enable&&vt("(color-gamut: p3)")?.matches&&vt("(dynamic-range: high)")?.matches;e.hdrMode=A(t.HdrMode,e.actualOptions.hdr.mode,t.HdrMode.standard),e.peakNits=e.actualOptions.hdr.peakNits;const s=this.renderCanvas;if(!s)return void(e.hdr=i??!1);let n;this.render.setContextSettings({alpha:!0,desynchronized:!0,willReadFrequently:!1,...i?{colorSpace:"display-p3",colorType:"float16"}:{colorSpace:"srgb"}});try{n=s.getContext("2d",this.render.settings)}catch{n=null}if(i&&!n){const t={alpha:!0,desynchronized:!0,willReadFrequently:!1,colorSpace:"srgb"};this.render.setContextSettings(t);try{n=s.getContext("2d",t)}catch{n=null}}if(this.render.setContext(n),n){const t=(t=>{if(!t)return;const e=t;return e.getContextAttributes?.().colorSpace??void 0})(n);void 0!==t&&(e.hdr="display-p3"===t)}}#bt(){this.#Pt();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.#rt=s}#vt(){const t=this.domElement,e=this.#u.actualOptions;if(t){this.#gt?this.#Mt():this.#ft();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")}}}#Pt(){if(this.#rt){for(const{handler:t,mql:e}of this.#rt)e.removeEventListener("change",t);this.#rt=void 0}}#yt(){const t=this.domElement;if(!t)return;this.#mt(t=>{t.disconnect()}),this.#vt(),this.initBackground();const e=this.#dt;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this.#mt(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})}#ft(){const t=this.domElement,e=this.#ct;t&&e&&la(t,e,!0)}#mt(t){this.#lt&&t(this.#lt)}#Mt(){const t=this.domElement;t&&la(t,Tt(this.#u.actualOptions.fullScreen.zIndex),!0)}}class da{#u;#zt;#Ct;#kt;constructor(t){this.#u=t,this.#zt={visibilityChange:()=>{this.#St()},resize:()=>{this.#Ot()}}}addListeners(){this.#Dt(!0)}removeListeners(){this.#Dt(!1)}#St(){const t=this.#u;t.actualOptions.pauseOnBlur&&(yt().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))}#Ot(){this.#kt&&(clearTimeout(this.#kt),this.#kt=void 0);const t=async()=>{await this.#u.canvas.windowResize()};this.#kt=setTimeout(()=>{t()},this.#u.actualOptions.resize.delay*p)}#Dt(t){const e=this.#zt;this.#It(t),Lt(document,d,e.visibilityChange,t,!1)}#It(t){const e=this.#zt,i=this.#u;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void Lt(globalThis,c,e.resize,t);const s=i.canvas.domElement;this.#Ct&&!t?(s&&this.#Ct.unobserve(s),this.#Ct.disconnect(),this.#Ct=void 0):!this.#Ct&&t&&s&&(this.#Ct=new ResizeObserver(t=>{t.some(t=>t.target===s)&&this.#Ot()}),this.#Ct.observe(s))}}function ha(t){if(!bt(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 ua(t,e){const i=t%e;return i<0?i+e:i}function pa(t,e,i,s){const n=je(i,e,e.actualOptions.particles),a=n.reduceDuplicates;t.effect=St(n.effect.type,t.id,a),t.shape=St(n.shape.type,t.id,a);const o=n.effect,r=n.shape;if(s){if(s.effect){const e=s.effect.type;if(e&&e!==t.effect){const i=St(e,t.id,a);i&&(t.effect=i)}o.load(s.effect)}if(s.shape){const e=s.shape.type;if(e&&e!==t.shape){const i=St(e,t.id,a);i&&(t.shape=i)}r.load(s.shape)}}if(t.effect===m){const i=[...e.effectDrawers.keys()];t.effect=i[Math.floor(N()*i.length)]}if(t.shape===m){const i=[...e.shapeDrawers.keys()];t.shape=i[Math.floor(N()*i.length)]}t.effectData=t.effect?function(t,e,i,s){const n=e.options[t];return Ct({close:e.close},St(n,i,s))}(t.effect,o,t.id,a):void 0,t.shapeData=t.shape?function(t,e,i,s){const n=e.options[t];return Ct({close:e.close},St(n,i,s))}(t.shape,r,t.id,a):void 0,n.load(s);const l=t.effectData,c=t.shapeData;return l&&n.load(l.particles),c&&n.load(c.particles),t.effectClose=l?.close??n.effect.close,t.shapeClose=c?.close??n.shape.close,n}class ga{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;#Et={fillOpacity:1,opacity:1,strokeOpacity:1};#Tt=I.origin;#Lt={sin:0,cos:0};#Rt={a:1,b:0,c:0,d:1};#u;#_t=[];#p;constructor(t,e){this.#p=t,this.#u=e}addModifier(t){this.#_t.push(t),this.#_t.sort((t,e)=>t.priority-e.priority)}clearModifiers(){this.#_t.length=0}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.clearModifiers();const i=this.#u,s=this.shape?i.shapeDrawers.get(this.shape):void 0;s?.particleDestroy?.(this);for(const t of i.particleDestroyedPlugins)t.particleDestroyed?.(this,e);for(const t of i.particleUpdaters)t.particleDestroyed?.(this,e);this.#u.dispatchEvent(t.EventType.particleDestroyed,{particle:this})}draw(t){const e=this.#u.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this.#At(this.#Ft(mi(this.fillColor),t=>t.fillColor))}getMass(){return this.getRadius()**2*Math.PI*u}getModifier(t){return this.#_t.find(e=>e.id===t)}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=X(this.opacity?.value??1),s=this.#Ft(void 0,t=>t.opacity)??i;return this.#Et.fillOpacity=this.fillOpacity??1,this.#Et.opacity=s*e,this.#Et.strokeOpacity=this.strokeOpacity??1,this.#Et}getPosition(){return this.#Tt.x=this.position.x+this.offset.x,this.#Tt.y=this.position.y+this.offset.y,this.#Tt.z=this.position.z,this.#Tt}getRadius(){return this.#Ft(this.size.value,t=>t.radius)}getRotateData(){const t=this.getAngle();return this.#Lt.sin=Math.sin(t),this.#Lt.cos=Math.cos(t),this.#Lt}getStrokeColor(){return this.#At(this.#Ft(mi(this.strokeColor),t=>t.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this.#Rt.a=e.cos*(t.a??f.a),this.#Rt.b=i?e.sin*(t.b??1):t.b??f.b,this.#Rt.c=i?-e.sin*(t.c??1):t.c??f.c,this.#Rt.d=e.cos*(t.d??f.d),this.#Rt}init(e,i,s,n){const a=this.#u;!function(e,i,s){e.id=i,e.group=s,e.justWarped=!1,e.effectClose=!0,e.shapeClose=!0,e.pathRotation=!1,e.lastPathTime=0,e.destroyed=!1,e.unbreakable=!1,e.isRotating=!1,e.rotation=0,e.misplaced=!1,e.retina={maxDistance:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},e.size={value:1,max:1,min:1,enable:!1},e.outType=t.ParticleOutType.normal,e.ignoresResizeRatio=!0}(this,e,n),this.options=pa(this,a,this.#p,s),a.retina.initParticle(this),function(t,e){for(const i of t)i.preInit?.(e)}(a.particleUpdaters,this),this.#Bt(i),this.initialVelocity=this.#Vt(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/a.zLayers,this.sides=24,function(t,e){let i,s;t.effect&&(i=e.effectDrawers.get(t.effect)),i?.loadEffect&&i.loadEffect(t),t.shape&&(s=e.shapeDrawers.get(t.shape)),s?.loadShape&&s.loadShape(t);const n=s?.getSidesCount;n&&(t.sides=n(t))}(this,a),this.spawning=!1,function(t,e){for(const i of t)i.init(e)}(a.particleUpdaters,this),function(t,e){const i=e.shape?t.shapeDrawers.get(e.shape):void 0,s=e.effect?t.effectDrawers.get(e.effect):void 0;s?.particleInit?.(t,e),i?.particleInit?.(t,e)}(a,this),function(t,e){for(const i of t.particleCreatedPlugins)i.particleCreated?.(e)}(a,this)}isInsideCanvas(t){return this.#Ut({direction:t}).inside}isInsideCanvasForOutMode(t,e){return this.#Ut({direction:e,outMode:t}).inside}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const e=ua(t,v);return e>=Math.PI*u&&e<3*Math.PI*u}if(this.roll.horizontal){const e=ua(t+Math.PI*u,v);return e>=Math.PI&&e<2*Math.PI}if(this.roll.vertical){const e=ua(t,v);return e>=Math.PI&&e<2*Math.PI}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}removeModifier(t){const e=this.#_t.findIndex(e=>e.id===t);e>=0&&this.#_t.splice(e,1)}reset(){for(const t of this.#u.particleUpdaters)t.reset?.(this)}#Ft(t,e){let i=t;for(const t of this.#_t)if(t.enabled){const s=e(t);void 0!==s&&(i=s)}return i}#Ht(t,e){let i=0,s=t?I.create(t.x,t.y,e):void 0;const n=this.#u,a=n.particlePositionPlugins,o=this.options.move.outModes,r=this.getRadius(),l=n.canvas.size;for(;;){for(const t of a){const i=t.particlePosition?.(s,this);if(i)return I.create(i.x,i.y,e)}const t=dt({size:l,position:s}),c=I.create(t.x,t.y,e);this.#$t(c,r,o.left??o.default),this.#$t(c,r,o.right??o.default),this.#Nt(c,r,o.top??o.default),this.#Nt(c,r,o.bottom??o.default);let d=!0;for(const t of n.particles.checkParticlePositionPlugins)if(d=t.checkParticlePosition?.(this,c,i)??!0,!d)break;if(d)return c;i+=1,s=void 0}}#Vt(){const e=this.options.move,i=ot(this.direction).copy();if(e.direction===t.MoveDirection.inside||e.direction===t.MoveDirection.outside)return i;const s=nt(X(e.angle.value)),n=nt(X(e.angle.offset)),a={left:n-s*u,right:n+s*u};return e.straight||(i.angle+=Q(J(a.left,a.right))),e.random&&"number"==typeof e.speed&&(i.length*=N()),i}#$t(e,i,s){ha({outMode:s,checkModes:[t.OutMode.bounce],coord:e.x,maxCoord:this.#u.canvas.size.width,setCb:t=>e.x+=t,radius:i})}#Nt(e,i,s){ha({outMode:s,checkModes:[t.OutMode.bounce],coord:e.y,maxCoord:this.#u.canvas.size.height,setCb:t=>e.y+=t,radius:i})}#jt(e,i){const s=this.getRadius(),n=this.#u.canvas.size,a=this.position,o=i===t.OutMode.bounce;return e===t.OutModeDirection.bottom?{inside:o?a.y+s<n.height:a.y-s<n.height,reason:"default"}:e===t.OutModeDirection.left?{inside:o?a.x-s>0:a.x+s>0,reason:"default"}:e===t.OutModeDirection.right?{inside:o?a.x+s<n.width:a.x-s<n.width,reason:"default"}:e===t.OutModeDirection.top?{inside:o?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"}}#qt(t,e){return{canvasSize:this.#u.canvas.size,direction:t,outMode:e,particle:this,radius:this.getRadius()}}#Ut(t){const e=this.#jt(t.direction,t.outMode),i=this.#u,s=this.shape?i.shapeDrawers.get(this.shape):void 0,n=this.effect?i.effectDrawers.get(this.effect):void 0,a=s?.isInsideCanvas,o=n?.isInsideCanvas;if(!a&&!o)return e;const r=this.#qt(t.direction,t.outMode),l=a?this.#Wt(a(r),"shape"):void 0,c=o?this.#Wt(o(r),"effect"):void 0;if(l&&c){const t=Math.max(l.margin??0,c.margin??0);return{inside:l.inside&&c.inside,margin:t>0?t:void 0,reason:"combined"}}return l??c??e}#At(t){return t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?Pi(t,this.roll.alter.type,this.roll.alter.value):t:t}#Bt(e){const i=this.#u,s=Math.floor(X(this.options.zIndex.value)),n=this.#Ht(e,G(s,0,i.zLayers));if(!n)throw new Error(pt(ut.particlePositionNotFound));this.position=n,this.initialPosition=this.position.copy();const a=i.canvas.size;switch(this.moveCenter={...Ot(this.options.move.center,a),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=at(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=E.origin}#Wt(t,e){return"boolean"==typeof t?{inside:t,reason:e}:{inside:t.inside,margin:t.margin,reason:t.reason??e}}}class fa{#Gt;#Kt=new Map;#Qt=[];#Xt;#Yt;#Zt=[];#Jt;constructor(t){this.#Gt=t,this.#Xt=0,this.#Jt=0}get cellSize(){return this.#Gt}set cellSize(t){this.#Yt=t}clear(){this.#Kt.clear();const t=this.#Yt;t&&(this.#Gt=t),this.#Yt=void 0}insert(t){const{x:e,y:i}=t.getPosition(),s=this.#te(e,i);this.#Kt.has(s)||this.#Kt.set(s,[]),this.#Kt.get(s)?.push(t)}query(t,e,i=[]){const s=this.#ee(t);if(!s)return i;const n=Math.floor(s.minX/this.#Gt),a=Math.floor(s.maxX/this.#Gt),o=Math.floor(s.minY/this.#Gt),r=Math.floor(s.maxY/this.#Gt);for(let s=n;s<=a;s++)for(let n=o;n<=r;n++)this.#ie(s,n,t,e,i);return i}queryCircle(t,e,i,s=[]){const n=this.#se(t.x,t.y,e),a=this.query(n,i,s);return this.#ne(),a}queryRectangle(t,e,i,s=[]){const n=this.#ae(t.x,t.y,e.width,e.height),a=this.query(n,i,s);return this.#ne(),a}#se(t,e,i){const s=this.#Xt++;let n=this.#Qt[s];return n||(n=new se(t,e,i),this.#Qt[s]=n),n.reset(t,e,i)}#ae(t,e,i,s){const n=this.#Jt++;let a=this.#Zt[n];return a||(a=new ne(t,e,i,s),this.#Zt[n]=a),a.reset(t,e,i,s)}#te(t,e){return`${Math.floor(t/this.#Gt)}_${Math.floor(e/this.#Gt)}`}#ee(t){if(t instanceof se){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 ne){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}#ie(t,e,i,s,n){const a=this.#Kt.get(`${t}_${e}`);if(a)for(const t of a)s&&!s(t)||i.contains(t.getPosition())&&n.push(t)}#ne(){this.#Xt=0,this.#Jt=0}}class ma{checkParticlePositionPlugins;#oe;#u;#re;#le;#ce;#de;#he;#ue;#pe;#p;#ge;#fe;#me;#ye;#ve;#we;constructor(t,e){this.#p=t,this.#u=e,this.#de=0,this.#oe=[],this.#ge=[],this.#ce=0,this.#le=new Map,this.#he=new Map,this.#we=this.#be(this.#u.zLayers),this.#re=new fa(100),this.checkParticlePositionPlugins=[],this.#ue=[],this.#pe=[],this.#me=[],this.#fe=[],this.#ve=[]}get count(){return this.#oe.length}get grid(){return this.#re}addParticle(e,i,s,a){if(!this.#Pe(s,this.count))try{const n=this.#ge.pop()??new ga(this.#p,this.#u);n.init(this.#de,e,i,s);let o=!0;return a&&(o=a(n)),o?(this.#oe.push(n),this.#xe(n),this.#de++,this.#u.dispatchEvent(t.EventType.particleAdded,{particle:n}),n):void this.#ge.push(n)}catch(t){n().warning(`error adding particle: ${t}`)}}clear(){this.#oe=[],this.#he.clear(),this.#Me(this.#u.zLayers)}destroy(){this.#oe=[],this.#ge.length=0,this.#he.clear(),this.#we=[],this.checkParticlePositionPlugins=[],this.#ue=[],this.#pe=[],this.#me=[],this.#fe=[],this.#ve=[]}drawParticles(t){for(let e=this.#we.length-1;e>=0;e--){const i=this.#we[e];if(i)for(const e of i)e.draw(t)}}filter(t){return this.#oe.filter(t)}find(t){return this.#oe.find(t)}get(t){return this.#oe[t]}async init(){const t=this.#u;this.checkParticlePositionPlugins=[],this.#ve=[],this.#pe=[],this.#me=[],this.#ue=[],this.#fe=[],this.#he.clear(),this.#Me(t.zLayers),this.#re=new fa(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(je(this.#p,this.#u,i),t,i)}await this.#Ce()}push(t,e,i,s){for(let n=0;n<t;n++)this.addParticle(e,i,s)}async redraw(){this.clear(),await this.init(),this.#u.canvas.render.drawParticles({value:0,factor:0})}remove(t,e,i){this.removeAt(this.#oe.indexOf(t),void 0,e,i)}removeAt(t,e=1,i,s,n=!0){if(t<0||t>this.count)return;let a=0;for(let o=t;a<e&&o<this.count;o++)this.#ke(o,i,s,n)&&(o--,a++)}removeQuantity(t,e){this.removeAt(0,t,e)}setDensity(){const t=this.#u.actualOptions,e=t.particles.groups;let i=0;for(const t of this.#u.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in e){const s=e[t];if(!s)continue;const n=je(this.#p,this.#u,s);this.#Se(n,i,t)}this.#Se(t.particles,i)}setResizeFactor(t){this.#ye=t}update(t){this.#re.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.#De(t,e),e.size)for(const t of e)this.remove(t,t.group);this.#ye=void 0}#Ie(...t){this.#ge.push(...t)}#Se(e,i,s,n){const a=e.number;if(!a.density.enable)return void this.#ze(e,s,n);const o=this.#Ee(a.density),r=a.value,l=a.limit.value>0?a.limit.value:r,c=Math.min(r,l)*o+i,d=Math.min(this.count,this.filter(t=>t.group===s).length);void 0===s?this.#ce=a.limit.value*o:this.#le.set(s,{limit:a.limit.value*o,mode:A(t.LimitMode,a.limit.mode,t.LimitMode.delete)}),d<c?this.push(Math.abs(c-d),void 0,e,s):d>c&&this.removeQuantity(d-c,s)}#ze(e,i,s){if(void 0===i){this.#ce=e.number.limit.value;const t=this.#u.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:A(t.LimitMode,s?.number?.limit?.mode??e.number.limit.mode,t.LimitMode.delete)}):this.#le.delete(i)}}#Pe(e,i){const s=this.#ce,n=this.#u.actualOptions.particles.number.limit.mode;if(s>0&&n===t.LimitMode.wait&&i>=s)return!0;const a=void 0===e?void 0:this.#le.get(e);if(a&&a.limit>0&&a.mode===t.LimitMode.wait){if(this.filter(t=>t.group===e).length>=a.limit)return!0}if(a&&a.limit>0&&a.mode===t.LimitMode.delete){const t=this.filter(t=>t.group===e).length+1-a.limit;t>0&&this.removeQuantity(t,e)}if(s>0&&n===t.LimitMode.delete){const t=this.count+1-s;t>0&&this.#Te(t)}return!1}#be(t){const e=Math.max(Math.floor(t),1);return Array.from({length:e},()=>[])}#Le(t){const e=this.#we.length-1;return e<=0?0:Math.min(Math.max(Math.floor(t),0),e)}#Ee(t){const e=this.#u;if(!t.enable)return 1;const i=e.canvas.size,s=e.retina.pixelRatio;return i.width&&i.height?i.width*i.height/(t.height*t.width*s**2):1}async#Re(){const t=this.#u;await t.initDrawersAndUpdaters();for(const e of t.effectDrawers.values())await(e.init?.(t));for(const e of t.shapeDrawers.values())await(e.init?.(t))}async#Ce(){await this.#_e(),await this.#Re();let t=!1;const e=this.#u;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#_e(){const t=this.#u;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.#fe.push(e)}#xe(t){const e=this.#Le(t.position.z),i=this.#we[e];i&&(i.push(t),this.#he.set(t.id,e))}#Te(t){this.removeAt(0,t,void 0,void 0,!1)}#ke(e,i,s,n=!0){const a=this.#oe[e];return!!a&&((!n||a.group===i)&&(this.#oe.splice(e,1),this.#Ae(a),a.destroy(s),this.#u.dispatchEvent(t.EventType.particleRemoved,{particle:a}),this.#Ie(a),!0))}#Ae(t){const e=this.#he.get(t.id)??this.#Le(t.position.z),i=this.#we[e];if(!i)return void this.#he.delete(t.id);const s=i.findIndex(e=>e.id===t.id);s>=0&&i.splice(s,1),this.#he.delete(t.id)}#Me(t){const e=Math.max(Math.floor(t),1);if(this.#we.length===e)for(const t of this.#we)t.length=0;else this.#we=this.#be(e)}#Fe(t){const e=this.#Le(t.position.z),i=this.#he.get(t.id);if(void 0===i)return void this.#xe(t);if(i===e)return;const s=this.#we[i];if(s){const e=s.findIndex(e=>e.id===t.id);e>=0&&s.splice(e,1)}const n=this.#we[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.#he.set(t.id,e)}else this.#he.set(t.id,e)}#Oe(t){const e=new Set,i=this.#ye;for(const s of this.#oe){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.#re.insert(s)}return e}#De(t,e){for(const i of this.#oe)if(i.destroyed)e.add(i);else{for(const e of this.#u.particleUpdaters)e.update(i,t);if(!i.spawning)for(const e of this.#fe)e.postParticleUpdate?.(i,t);this.#Fe(i)}}}class ya{pixelRatio;reduceFactor;#u;constructor(t){this.#u=t,this.pixelRatio=1,this.reduceFactor=1}init(){const t=this.#u,e=t.actualOptions;this.pixelRatio=e.detectRetina?devicePixelRatio:1,this.reduceFactor=1;const i=this.pixelRatio,s=t.canvas,n=s.domElement;n&&(s.size.width=n.offsetWidth*i,s.size.height=n.offsetHeight*i)}initParticle(t){const e=t.options,i=this.pixelRatio,s=e.move,n=s.distance,a=t.retina;a.maxSpeed=X(s.gravity.maxSpeed)*i,a.moveDrift=X(s.drift)*i,a.moveSpeed=X(s.speed)*i;const o=a.maxDistance;o.horizontal=void 0===n.horizontal?void 0:n.horizontal*i,o.vertical=void 0===n.vertical?void 0:n.vertical*i}}function va(t){return!t.destroyed}function wa(t,e,...i){const s=new qe(t,e);return he(s,...i),s}var ba=Object.freeze({__proto__:null,Container:class{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;hdrMode;id;pageHidden;particleCreatedPlugins;particleDestroyedPlugins;particlePositionPlugins;particleUpdaters;particles;peakNits;plugins;retina;shapeDrawers;started;zLayers;#Be;#Ve;#Ue={value:0,factor:0};#He;#$e;#Ne;#je;#qe;#We;#Ge;#Ke;#Qe;#Xe;#Ye;#p;#Ze;#Je;constructor(e){const{dispatchCallback:i,pluginManager:s,id:n,onDestroy:a,sourceOptions:o}=e;this.#p=s,this.#He=i,this.#Qe=a,this.id=Symbol(n),this.fpsLimit=120,this.hdr=!1,this.hdrMode=t.HdrMode.standard,this.peakNits=400,this.#Ze=!1,this.#Be=0,this.#Ne=0,this.#Ke=0,this.#qe=!0,this.started=!1,this.destroyed=!1,this.#Ye=!0,this.#Ge=0,this.zLayers=100,this.pageHidden=!1,this.#Je=o,this.#We=o,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new ya(this),this.canvas=new ca(this.#p,this),this.particles=new ma(this.#p,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this.#Xe=wa(this.#p,this),this.actualOptions=wa(this.#p,this),this.#je=new da(this),this.dispatchEvent(t.EventType.containerBuilt)}get animationStatus(){return!this.#Ye&&!this.pageHidden&&va(this)}get options(){return this.#Xe}get sourceOptions(){return this.#Je}addLifeTime(t){this.#Ke+=t}alive(){return!this.#Ne||this.#Ke<=this.#Ne}destroy(e=!0){if(va(this)){this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,t]of this.effectDrawers)t.destroy?.(this);for(const[,t]of this.shapeDrawers)t.destroy?.(this);for(const t of this.plugins)t.destroy?.();this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.plugins.length=0,this.destroyed=!0,this.#Qe(e),this.dispatchEvent(t.EventType.containerDestroyed)}}dispatchEvent(t,e){this.#He(t,{container:this,data:e})}draw(t){if(!va(this))return;let e=t;this.#$e=q(t=>{e&&(this.#Ge=void 0,e=!1),this.#ti(t)})}async export(t,e={}){for(const i of this.plugins){if(!i.export)continue;const s=await i.export(t,e);if(s.supported)return s.blob}n().error(`Export plugin with type ${t} not found`)}async init(){if(!va(this))return;const e=new Map;for(const t of this.#p.plugins){const i=await t.getPlugin(this);i.preInit&&await i.preInit(),e.set(t,i)}await this.initDrawersAndUpdaters(),this.#Xe=wa(this.#p,this,this.#We,this.sourceOptions),this.actualOptions=wa(this.#p,this,this.#Xe),this.#Ce(e),this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:i,duration:s,fpsLimit:n,smooth:a,zLayers:o}=this.actualOptions,r=this.actualOptions.hdr;this.hdrMode=A(t.HdrMode,r.mode,t.HdrMode.standard),this.peakNits=r.peakNits,this.zLayers=o,this.#Ne=X(s)*p,this.#Be=X(i)*p,this.#Ke=0,this.fpsLimit=n>0?n:120,this.#Ze=a;for(const t of this.plugins)await(t.init?.());await this.particles.init(),this.dispatchEvent(t.EventType.containerInit),this.particles.setDensity();for(const t of this.plugins)t.particlesSetup?.();this.dispatchEvent(t.EventType.particlesSetup)}async initDrawersAndUpdaters(){const t=this.#p;this.effectDrawers=await _t(this,t.initializers.effects),this.shapeDrawers=await _t(this,t.initializers.shapes),this.particleUpdaters=await Rt(this,t.initializers.updaters)}pause(){if(va(this)&&(void 0!==this.#$e&&(W(this.#$e),this.#$e=void 0),!this.#Ye)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this.#Ye=!0),this.dispatchEvent(t.EventType.containerPaused)}}play(e){if(!va(this))return;const i=this.#Ye||e;if(!this.#qe||this.actualOptions.autoPlay){if(this.#Ye&&(this.#Ye=!1),i)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(t.EventType.containerPlay),this.draw(i??!1)}else this.#qe=!1}async refresh(){if(va(this))return this.stop(),this.start()}async reset(t){if(va(this))return this.#We=t,this.#Je=t,this.#Xe=wa(this.#p,this,this.#We,this.sourceOptions),this.actualOptions=wa(this.#p,this,this.#Xe),this.refresh()}async start(){va(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise(e=>{const i=async()=>{this.#je.addListeners();for(const t of this.plugins)await(t.start?.());this.dispatchEvent(t.EventType.containerStarted),this.play(),e()};this.#Ve=setTimeout(()=>{i()},this.#Be)}))}stop(){if(va(this)&&this.started){this.#Ve&&(clearTimeout(this.#Ve),this.#Ve=void 0),this.#qe=!0,this.started=!1,this.#je.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop();for(const t of this.plugins)t.stop?.();this.particleCreatedPlugins.length=0,this.particleDestroyedPlugins.length=0,this.particlePositionPlugins.length=0,this.#Je=this.#Xe,this.dispatchEvent(t.EventType.containerStopped)}}updateActualOptions(){let t=!1;for(const e of this.plugins)e.updateActualOptions&&(t=e.updateActualOptions()||t);return t}#Ce(t){this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[e,i]of t)e.needsPlugin(this.actualOptions)&&(this.plugins.push(i),i.particleCreated&&this.particleCreatedPlugins.push(i),i.particleDestroyed&&this.particleDestroyedPlugins.push(i),i.particlePosition&&this.particlePositionPlugins.push(i))}#ti(t){try{if(!this.#Ze&&void 0!==this.#Ge&&t<this.#Ge+p/this.fpsLimit)return void this.draw(!1);if(this.#Ge??=t,function(t,e,i=60,s=!1){t.value=e,t.factor=s?60/i:60*e/p}(this.#Ue,t-this.#Ge,this.fpsLimit,this.#Ze),this.addLifeTime(this.#Ue.value),this.#Ge=t,this.#Ue.value>p)return void this.draw(!1);if(this.canvas.render.drawParticles(this.#Ue),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){n().error("error in animation loop",t)}}}});var Pa=Object.freeze({__proto__:null,BlendPluginInstance:class{layer=t.DrawLayer.CanvasSetup;#u;#ei;constructor(t){this.#u=t}drawParticleCleanup(t,e){e.options.blend?.enable&&(t.globalCompositeOperation=e.originalBlendMode??l,e.originalBlendMode=void 0)}drawParticleSetup(t,e){e.options.blend?.enable&&(e.originalBlendMode=t.globalCompositeOperation,t.globalCompositeOperation=e.options.blend.mode)}drawSettingsCleanup(t){this.#ei&&(t.globalCompositeOperation=this.#ei)}drawSettingsSetup(t){const e=t.globalCompositeOperation,i=this.#u.actualOptions.blend;this.#ei=e,t.globalCompositeOperation=i?.enable?i.mode:e}}});function xa(t,e,i,s,n,a,o){!function(t,e){const i=t.options,s=i.move.path;if(!s.enable)return;const n=t.pathDelay??0;if(t.lastPathTime<=n)return void(t.lastPathTime+=e.value);const a=t.pathGenerator?.generate(t,e);a&&t.velocity.addTo(a);s.clamp&&(t.velocity.x=G(t.velocity.x,-1,1),t.velocity.y=G(t.velocity.y,-1,1));t.lastPathTime-=n}(t,o);const r=t.gravity,l=r?.enable&&r.inverse?-1:1;n&&i&&(t.velocity.x+=n*o.factor/(60*i)),r?.enable&&i&&(t.velocity.y+=l*(r.acceleration*o.factor)/(60*i));const c=t.moveDecay;t.velocity.multTo(c??1);const d=t.velocity.mult(i);r?.enable&&s>0&&(!r.inverse&&d.y>=0&&d.y>=s||r.inverse&&d.y<=0&&d.y<=-s)&&(d.y=l*s,i&&(t.velocity.y=d.y/i));const h=t.options.zIndex,u=(1-t.zIndexFactor)**h.velocityRate;d.multTo(u),d.multTo(a);const{position:p}=t;p.addTo(d),e.vibrate&&(p.x+=Math.sin(p.x*Math.cos(p.y))*a,p.y+=Math.cos(p.y*Math.sin(p.x))*a)}var Ma=Object.freeze({__proto__:null,MovePluginInstance:class{availablePathGenerators;pathGenerators;#u;#p;constructor(t,e){this.#p=t,this.#u=e,this.availablePathGenerators=new Map,this.pathGenerators=new Map}destroy(){this.availablePathGenerators=new Map,this.pathGenerators=new Map}isEnabled(t){return!t.destroyed&&t.options.move.enable}particleCreated(e){const i=e.options.move,s=i.gravity,n=i.path;if(e.moveDecay=1-X(i.decay),e.pathDelay=X(n.delay.value)*p,n.generator){let t=this.pathGenerators.get(n.generator);t||(t=this.availablePathGenerators.get(n.generator),t&&(this.pathGenerators.set(n.generator,t),t.init())),e.pathGenerator=t}e.gravity={enable:s.enable,acceleration:X(s.acceleration),inverse:s.inverse},function(e,i){const s=i.options.move.spin;if(!s.enable)return;const n=s.position??{x:50,y:50},a={x:.01*n.x*e.canvas.size.width,y:.01*n.y*e.canvas.size.height},o=it(i.getPosition(),a),r=X(s.acceleration);i.retina.spinAcceleration=r*e.retina.pixelRatio,i.spin={center:a,direction:i.velocity.x>=0?t.RotateDirection.clockwise:t.RotateDirection.counterClockwise,angle:N()*v,radius:o,acceleration:i.retina.spinAcceleration}}(this.#u,e)}particleDestroyed(t){const e=t.pathGenerator;e?.reset(t)}particleUpdate(e,i){const s=e.options.move;if(!s.enable)return;const n=this.#u,a=function(t){const e=t.getModifier("slow");return e?.enabled?e.speedFactor??1:1}(e),o=n.retina.reduceFactor,r=e.retina.moveSpeed,l=e.retina.moveDrift,c=e.size.max,d=r*(s.size?e.getRadius()/c:1)*a*(i.factor||1)*u,h=e.retina.maxSpeed;s.spin.enable?function(e,i,s,n){if(!i.spin)return;const a=i.spin.direction===t.RotateDirection.clockwise,o={x:a?Math.cos:Math.sin,y:a?Math.sin:Math.cos};i.position.x=i.spin.center.x+i.spin.radius*o.x(i.spin.angle)*n,i.position.y=i.spin.center.y+i.spin.radius*o.y(i.spin.angle)*n,i.spin.radius+=i.spin.acceleration*n;const r=Math.max(e.canvas.size.width,e.canvas.size.height),l=r*u;i.spin.radius>l?(i.spin.radius=l,i.spin.acceleration*=-1):i.spin.radius<0&&(i.spin.radius=0,i.spin.acceleration*=-1),i.spin.angle+=.01*s*(1-i.spin.radius/r)}(n,e,d,o):xa(e,s,d,h,l,o,i),function(t){const e=t.initialPosition,{dx:i,dy:s}=tt(e,t.position),n=Math.abs(i),a=Math.abs(s),{maxDistance:o}=t.retina,r=o.horizontal,l=o.vertical;if(!r&&!l)return;if((r&&n>=r||l&&a>=l)&&!t.misplaced)t.misplaced=!!r&&n>r||!!l&&a>l,r&&(t.velocity.x=t.velocity.y*u-t.velocity.x),l&&(t.velocity.y=t.velocity.x*u-t.velocity.y);else if((!r||n<r)&&(!l||a<l)&&t.misplaced)t.misplaced=!1;else if(t.misplaced){const i=t.position,s=t.velocity;r&&(i.x<e.x&&s.x<0||i.x>e.x&&s.x>0)&&(s.x*=-N()),l&&(i.y<e.y&&s.y<0||i.y>e.y&&s.y>0)&&(s.y*=-N())}}(e)}preInit(){return this.#ii()}redrawInit(){return this.#ii()}update(){for(const t of this.pathGenerators.values())t.update()}async#ii(){const t=this.#p;if(t.initializers.pathGenerators){this.availablePathGenerators=await _t(this.#u,t.initializers.pathGenerators),this.pathGenerators=new Map;for(const t of this.pathGenerators.values())t.init()}}}});var za=Object.freeze({__proto__:null,EmittersPluginInstance:class{#u;#C;constructor(t,e){this.#C=t,this.#u=e,this.#C.initContainer(e)}draw(t,e){for(const e of this.#C.getArray(this.#u))e.draw(t)}async init(){const t=this.#u.actualOptions.emitters;if(B(t))for(const e of t)await this.#C.addEmitter(this.#u,e);else await this.#C.addEmitter(this.#u,t)}pause(){for(const t of this.#C.getArray(this.#u))t.pause()}play(){for(const t of this.#C.getArray(this.#u))t.play()}resize(){for(const t of this.#C.getArray(this.#u))t.resize()}stop(){this.#C.clear(this.#u)}update(t){this.#C.getArray(this.#u).forEach(e=>{e.update(t)})}}});const Ca=new Map;var ka=Object.freeze({__proto__:null,ShapeManager:class{addShapeGenerator(t,e){this.getShapeGenerator(t)||Ca.set(t,e)}getShapeGenerator(t){return Ca.get(t)}getSupportedShapeGenerators(){return Ca.keys()}}});var Sa=Object.freeze({__proto__:null,EmittersInstancesManager:class{#si;#p;constructor(t){this.#si=new Map,this.#p=t}async addEmitter(t,e,i){return this.addEmitters(t,[{options:e,position:i}]).then(t=>t[0])}async addEmitters(t,e){const{EmitterInstance:i}=await Promise.resolve().then(function(){return Ta}),s=[];for(const{options:n,position:a}of e){const e=new Vs;e.load(n);const o=new i(this.#p,t,e=>{this.removeEmitter(t,e)},e,a);await o.init(),this.getArray(t).push(o),s.push(o)}return s}clear(t){this.initContainer(t),this.#si.set(t,[])}getArray(t){this.initContainer(t);let e=this.#si.get(t);return e||(e=[],this.#si.set(t,e)),e}initContainer(t){this.#si.has(t)||(this.#si.set(t,[]),t.getEmitter=e=>{const i=this.getArray(t);return void 0===e||R(e)?i[e??0]:i.find(t=>t.name===e)},t.addEmitter=async(e,i)=>this.addEmitter(t,e,i),t.addEmitters=async e=>this.addEmitters(t,e),t.removeEmitter=e=>{const i=t.getEmitter?.(e);i&&this.removeEmitter(t,i)},t.playEmitter=e=>{const i=t.getEmitter?.(e);i&&i.externalPlay()},t.pauseEmitter=e=>{const i=t.getEmitter?.(e);i&&i.externalPause()})}removeEmitter(t,e){const i=this.getArray(t).indexOf(e);i>=0&&this.getArray(t).splice(i,1)}}});var Oa=Object.freeze({__proto__:null,ImagePreloaderInstance:class{#u;#n;constructor(t,e){this.#n=t,this.#u=e}destroy(){this.#n.images?.delete(this.#u)}}});var Da=Object.freeze({__proto__:null,MotionPluginInstance:class{#u;constructor(t){this.#u=t}async init(){const t=this.#u,e=t.actualOptions.motion;if(!e||!e.disable&&!e.reduce.value)return void(t.retina.reduceFactor=1);const i=vt("(prefers-reduced-motion: reduce)");if(!i)return void(t.retina.reduceFactor=1);this.#ni(i);i.addEventListener("change",()=>{(async()=>{this.#ni(i);try{await t.refresh()}catch{}})()}),await Promise.resolve()}#ni(t){const e=this.#u,i=e.actualOptions.motion;i&&(t.matches?i.disable?e.retina.reduceFactor=0:e.retina.reduceFactor=i.reduce.value?1/i.reduce.factor:1:e.retina.reduceFactor=1)}}});function Ia(t,e,i,s){(t.paint??=new _e).fill={color:ye.create(void 0,{value:e}),enable:s,opacity:i}}function Ea(t,e,i,s){(t.paint??=new _e).stroke={color:ye.create(void 0,{value:e}),opacity:i,width:s}}var Ta=Object.freeze({__proto__:null,EmitterInstance:class{fill;name;options;position;size;spawnFillColor;spawnFillEnabled;spawnFillOpacity;spawnStrokeColor;spawnStrokeOpacity;spawnStrokeWidth;#u;#ai;#oi;#ri;#Ne;#li;#ci;#di;#hi;#ui;#lt;#pi;#Ye;#p;#gi=!1;#fi;#Ct;#mi;#yi;#vi;#wi;constructor(e,i,s,n,a){this.#p=e,this.#u=i,this.#fi=s,this.#ai=0,this.#oi=0,this.#ri=0,this.#hi=a,n instanceof Vs?this.options=n:(this.options=new Vs,this.options.load(n)),this.#vi=i.retina.reduceFactor?X(this.options.life.delay??0)*p/i.retina.reduceFactor:1/0,this.position=this.#hi??this.#Ht(),this.name=this.options.name,this.fill=this.options.fill,this.#ci=!this.options.life.wait,this.#wi=!1;const o=Ct({},this.options.particles);if(o.move??={},o.move.direction??=this.options.direction,this.options.spawn.fill?.color&&(this.spawnFillColor=ai(this.#p,this.options.spawn.fill.color)),this.options.spawn.stroke?.color&&(this.spawnStrokeColor=ai(this.#p,this.options.spawn.stroke.color)),this.#Ye=!this.options.autoPlay,this.#pi=o,this.#yi=this.#bi(),this.size=this.#yi.mode===t.PixelMode.percent?{width:this.#yi.width/h*this.#u.canvas.size.width,height:this.#yi.height/h*this.#u.canvas.size.height}:{width:this.#yi.width,height:this.#yi.height},this.#ui=this.options.life.count??-1,this.#di=this.#ui<=0,this.options.domId){const t=yt().getElementById(this.options.domId);t&&(this.#lt=new MutationObserver(()=>{this.resize()}),this.#Ct=new ResizeObserver(()=>{this.resize()}),this.#lt.observe(t,{attributes:!0,attributeFilter:["style","width","height"]}),this.#Ct.observe(t))}const r=this.options.shape,l=this.#p.emitterShapeManager?.getShapeGenerator(r.type);l&&(this.#mi=l.generate(this.#u,this.position,this.size,this.fill,r.options)),this.#u.dispatchEvent("emitterCreated",{emitter:this}),this.play()}draw(t){if(!this.options.draw||!this.#mi)return;const e=this.#u,i=this.options.spawn.fill?.enable??!0;t.save(),t.beginPath(),i&&(t.fillStyle=this.spawnFillColor?gi(this.spawnFillColor,e.hdr,this.spawnFillOpacity??1,e.peakNits,e.hdrMode):pi({r:0,g:0,b:0},e.hdr,1,e.peakNits,e.hdrMode)),this.spawnStrokeColor&&(t.strokeStyle=gi(this.spawnStrokeColor,e.hdr,this.spawnStrokeOpacity??1,e.peakNits,e.hdrMode),t.lineWidth=this.spawnStrokeWidth??1),this.#mi.draw?.(t),i&&t.fill(),this.spawnStrokeColor&&t.stroke(),t.restore()}externalPause(){this.#Ye=!0,this.pause()}externalPlay(){this.#Ye=!1,this.play()}async init(){await(this.#mi?.init())}pause(){this.#Ye||(this.#li=void 0)}play(){if(this.#Ye)return;if(!(this.#ui>0||this.#di)&&this.options.life.count||!(this.#ci||this.#ri>=(this.#vi??0)))return;const t=this.#u;if(void 0===this.#li){const e=X(this.options.rate.delay);this.#li=t.retina.reduceFactor?e*p/t.retina.reduceFactor:1/0}(this.#ui>0||this.#di)&&this.#Pi()}resize(){const e=this.#u;if(!this.#gi){const t=this.#hi;this.position=t&&xt(t,e.canvas.size,E.origin)?t:this.#Ht()}this.#yi=this.#bi(),this.size=this.#yi.mode===t.PixelMode.percent?{width:this.#yi.width/h*e.canvas.size.width,height:this.#yi.height/h*e.canvas.size.height}:{width:this.#yi.width,height:this.#yi.height},this.#mi?.resize(this.position,this.size)}setPosition(t){this.#gi=!0,this.position={...t},this.#mi?.resize(this.position,this.size)}update(t){if(this.#Ye)return;const e=this.#u;this.#ci&&(this.#ci=!1,this.#ri=this.#vi??0,this.#oi=this.#li??0),this.#wi||(this.#wi=!0,this.#xi(this.options.startCount)),void 0!==this.#Ne&&(this.#ai+=t.value,this.#ai>=this.#Ne&&(this.pause(),void 0!==this.#vi&&(this.#vi=void 0),this.#di||this.#ui--,this.#ui>0||this.#di?(this.position=this.#Ht(),this.#mi?.resize(this.position,this.size),this.#vi=e.retina.reduceFactor?X(this.options.life.delay??0)*p/e.retina.reduceFactor:1/0):this.#Mi(),this.#ai-=this.#Ne,this.#Ne=void 0)),void 0!==this.#vi&&(this.#ri+=t.value,this.#ri>=this.#vi&&(this.#u.dispatchEvent("emitterPlay"),this.play(),this.#ri-=this.#vi,this.#vi=void 0)),void 0!==this.#li&&(this.#oi+=t.value,this.#oi>=this.#li&&(this.#zi(),this.#oi-=this.#li))}#Ht(){const t=this.#u;if(this.options.domId){const e=yt().getElementById(this.options.domId);if(e){const i=e.getBoundingClientRect(),s=t.retina.pixelRatio;return{x:(i.x+i.width*u)*s,y:(i.y+i.height*u)*s}}}return ct({size:t.canvas.size,position:this.options.position})}#bi(){const e=this.#u;if(this.options.domId){const i=yt().getElementById(this.options.domId);if(i){const s=i.getBoundingClientRect();return{width:s.width*e.retina.pixelRatio,height:s.height*e.retina.pixelRatio,mode:t.PixelMode.precise}}}return this.options.size??(()=>{const e=new Fs;return e.load({height:0,mode:t.PixelMode.percent,width:0}),e})()}#Mi(){this.#lt?.disconnect(),this.#lt=void 0,this.#Ct?.disconnect(),this.#Ct=void 0,this.#fi(this),this.#u.dispatchEvent("emitterDestroyed",{emitter:this})}#zi(){if(this.#Ye)return;const t=X(this.options.rate.quantity);this.#xi(t)}#xi(t){const e=St(this.#pi)??{},i=this.options.spawn.fill?.color?.animation,s=this.options.spawn.fill?.enable??!!this.options.spawn.fill?.color,n=void 0===this.options.spawn.fill?.opacity?1:X(this.options.spawn.fill.opacity),a=this.options.spawn.stroke?.color?.animation,o=void 0===this.options.spawn.stroke?.opacity?1:X(this.options.spawn.stroke.opacity),r=void 0===this.options.spawn.stroke?.width?1:X(this.options.spawn.stroke.width),l=this.#u.retina.reduceFactor,c=!!i,d=!!a,h=!!this.#mi,u=c||d,p=u||h,g=u?{h:M,s:z,l:C}:null,f=this.options.shape;for(let c=0;c<t*l;c++){const t=p?Ct({},e):e;this.spawnFillOpacity=n,this.spawnFillEnabled=s,this.spawnStrokeOpacity=o,this.spawnStrokeWidth=r,this.spawnFillColor&&(i&&g&&(this.spawnFillColor.h=this.#Ci(i.h,this.spawnFillColor.h,g.h,3.6),this.spawnFillColor.s=this.#Ci(i.s,this.spawnFillColor.s,g.s),this.spawnFillColor.l=this.#Ci(i.l,this.spawnFillColor.l,g.l)),Ia(t,this.spawnFillColor,this.spawnFillOpacity,this.spawnFillEnabled)),this.spawnStrokeColor&&(a&&g&&(this.spawnStrokeColor.h=this.#Ci(a.h,this.spawnStrokeColor.h,g.h,3.6),this.spawnStrokeColor.s=this.#Ci(a.s,this.spawnStrokeColor.s,g.s),this.spawnStrokeColor.l=this.#Ci(a.l,this.spawnStrokeColor.l,g.l)),Ea(t,this.spawnStrokeColor,this.spawnStrokeOpacity,this.spawnStrokeWidth));let l=this.position;if(this.#mi){const e=this.#mi.randomPosition();if(e){l=e.position;const i=f.replace;i.color&&e.color&&Ia(t,e.color,i.opacity?e.opacity??1:1,!0)}else l=null}l&&this.#u.particles.addParticle(l,t)}}#Pi(){if(this.#Ye)return;const t=void 0!==this.options.life.duration?X(this.options.life.duration):void 0;(this.#ui>0||this.#di)&&void 0!==t&&t>0&&(this.#Ne=t*p)}#Ci(t,e,i,s=1){const n=this.#u;if(!t.enable)return e;const a=Q(t.offset),o=X(this.options.rate.delay),r=n.retina.reduceFactor?o*p/n.retina.reduceFactor:1/0;return(e+X(t.speed)*n.fpsLimit/r+a*s)%i}}});t.AnimatableColor=ye,t.AnimationOptions=ue,t.AnimationValueWithRandom=Oe,t.Background=ve,t.BaseRange=ie,t.Circle=se,t.ColorAnimation=ge,t.ErrorCodes=ut,t.Fill=Me,t.FullScreen=we,t.HDROptions=be,t.HslAnimation=fe,t.Move=Le,t.MoveAngle=ze,t.MoveCenter=Ce,t.MoveGravity=ke,t.MovePath=Ie,t.OptionLoader=de,t.Options=qe,t.OptionsColor=me,t.OutModes=Ee,t.Paint=_e,t.ParticlesBounce=Fe,t.ParticlesBounceFactor=Ae,t.ParticlesDensity=Be,t.ParticlesNumber=Ue,t.ParticlesNumberLimit=Ve,t.ParticlesOptions=Ne,t.RangedAnimationOptions=pe,t.RangedAnimationValueWithRandom=De,t.Rectangle=ne,t.ResizeEvent=Pe,t.Shape=He,t.Spin=Te,t.Stroke=Re,t.ValueWithRandom=Se,t.Vector=E,t.Vector3d=I,t.ZIndex=$e,t.addErrorMessages=function(t){},t.alterHsl=Pi,t.animate=q,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/h,y:t.position.y*t.size.height/h}:void 0},t.calcPositionOrRandomFromSize=lt,t.calcPositionOrRandomFromSizeRanged=ct,t.calculateBounds=zt,t.cancelAnimation=W,t.canvasFirstIndex=0,t.canvasTag=P,t.checkDistance=st,t.circleBounce=function(t,e){const{x:i,y:s}=t.velocity.sub(e.velocity),[n,a]=[t.position,e.position],{dx:o,dy:r}=tt(a,n);if(i*o+s*r<0)return;const l=-Math.atan2(r,o),c=t.mass,d=e.mass,h=t.velocity.rotate(l),u=e.velocity.rotate(l),p=rt(h,u,c,d),g=rt(u,h,c,d),f=p.rotate(-l),m=g.rotate(-l);t.velocity.x=f.x*t.factor.x,t.velocity.y=f.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:E.create(X(t.options.bounce.horizontal.value),X(t.options.bounce.vertical.value))}},t.clamp=G,t.cloneStyle=Dt,t.collisionVelocity=rt,t.colorMix=fi,t.colorToRgb=ni,t.confetti=sa,t.countOffset=1,t.decayOffset=1,t.deepExtend=Ct,t.defaultAlpha=1,t.defaultAngle=0,t.defaultCompositeValue=l,t.defaultDensityFactor=1,t.defaultFps=60,t.defaultFpsLimit=120,t.defaultLoops=0,t.defaultOpacity=1,t.defaultRatio=1,t.defaultReduceFactor=1,t.defaultRemoveQuantity=1,t.defaultRetryCount=0,t.defaultRgbMin=0,t.defaultTime=0,t.defaultTransform=f,t.defaultTransformValue=1,t.defaultVelocity=0,t.defaultZoom=1,t.degToRad=nt,t.deleteCount=1,t.double=2,t.doublePI=v,t.empty=0,t.executeOnSingleOrMultiple=kt,t.fullPercent=r,t.generatedAttribute=o,t.generatedFalse=b,t.generatedTrue=w,t.getCanvasFromContainer=Ft,t.getDataFromUrl=At,t.getDistance=it,t.getDistanceSq=et,t.getDistances=tt,t.getDomContainer=Bt,t.getErrorMessage=pt,t.getFullScreenStyle=Tt,t.getHslAnimationFromHsl=yi,t.getHslFromAnimation=mi,t.getItemMapFromInitializer=_t,t.getItemsFromInitializer=Rt,t.getLinkColor=function(t,e,i,s){if(i===m)return ui();if(i!==y)return i;{const i=t.getFillColor()??t.getStrokeColor(),n=e?.getFillColor()??e?.getStrokeColor();if(i&&n&&e)return fi(i,n,t.getRadius(),e.getRadius(),s);{const t=i??n;if(t)return ci(t)}}},t.getLinkRandomColor=function(t,e,i,s){const n=L(e)?e:e.value;return n===m?s?si(t,{value:n}):i?m:y:n===y?y:si(t,{value:n})},t.getLogger=n,t.getParticleBaseVelocity=ot,t.getParticleDirectionAngle=at,t.getPosition=Ot,t.getRandom=N,t.getRandomFn=function(){return H},t.getRandomInRange=j,t.getRandomRgbColor=ui,t.getRangeMax=Z,t.getRangeMin=Y,t.getRangeValue=X,t.getStyleFromHsl=gi,t.getStyleFromRgb=pi,t.hMax=M,t.hMin=0,t.hPhase=60,t.half=u,t.hslToRgb=ci,t.hslToRgbFloat=di,t.hslaToRgba=hi,t.identity=1,t.inverseFactorNumerator=1,t.isArray=B,t.isBoolean=T,t.isEnumValue=_,t.isFunction=function(t){return"function"==typeof t},t.isInArray=bt,t.isNull=V,t.isNumber=R,t.isObject=F,t.isPointInside=xt,t.isString=L,t.itemFromArray=Pt,t.itemFromSingleOrMultiple=St,t.lFactor=1,t.lMax=C,t.lMin=0,t.lengthOffset=1,t.loadExtendProperty=function(t,e,i){if(void 0!==i){const s=e;if("__proto__"===s||"constructor"===s||"prototype"===s)return;const n=t,a=Object.hasOwn(n,s)?n[s]:{};n[s]=Ct(a,i)}},t.loadLazyProperty=le,t.loadMinIndex=0,t.loadNestedProperty=re,t.loadOptionProperty=ce,t.loadOptions=he,t.loadParticlesOptions=je,t.loadProperty=ae,t.loadRandomFactor=1e4,t.loadRangeProperty=oe,t.manageListener=Lt,t.maxNits=O,t.midColorValue=y,t.millisecondsToSeconds=p,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=ht,t.percentDenominator=h,t.phaseNumerator=1,t.quarter=k,t.randomColorValue=m,t.randomInRangeValue=Q,t.rangeColorToHsl=ai,t.rangeColorToRgb=si,t.removeDeleteCount=1,t.removeMinIndex=0,t.resizeEvent=c,t.rgbMax=x,t.rgbToHsl=oi,t.sMax=z,t.sMin=0,t.sNormalizedOffset=1,t.safeDocument=yt,t.safeMatchMedia=vt,t.safeMutationObserver=wt,t.setAnimationFunctions=function(t,e){$.nextFrame=t,$.cancel=e},t.setLogger=function(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))},t.setRandom=function(t=Math.random){H=t},t.setRangeValue=J,t.sextuple=6,t.spatialHashGridCellSize=100,t.squareExp=2,t.stringToAlpha=function(t,e){return ii(t,e)?.a},t.stringToRgb=ri,t.threeQuarter=S,t.toEnumValue=A,t.triple=3,t.tryCountIncrement=1,t.tsParticles=xi,t.updateColor=bi,t.updateColorValue=wi,t.visibilityChangeEvent=d,t.zIndexFactorOffset=1}(t.__tsParticlesInternals.bundles.confetti=t.__tsParticlesInternals.bundles.confetti||{})}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:self),Object.assign(globalThis.window||globalThis,{confetti:(globalThis.__tsParticlesInternals.bundles.confetti||{}).confetti});