UNPKG

132 kBJavaScriptView Raw
1/*! For license information please see tsparticles.fireworks.bundle.min.js.LICENSE.txt */
2!function(t,i){if("object"==typeof exports&&"object"==typeof module)module.exports=i();else if("function"==typeof define&&define.amd)define([],i);else{var e=i();for(var s in e)("object"==typeof exports?exports:t)[s]=e[s]}}(this,(()=>(()=>{"use strict";var t={d:(i,e)=>{for(var s in e)t.o(e,s)&&!t.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:e[s]})},o:(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},i={};t.r(i),t.d(i,{AnimatableColor:()=>yi,AnimationOptions:()=>Ai,Background:()=>Kt,BackgroundMask:()=>ii,BackgroundMaskCover:()=>ti,Circle:()=>re,ClickEvent:()=>si,Collisions:()=>Mi,CollisionsAbsorb:()=>gi,CollisionsOverlap:()=>wi,ColorAnimation:()=>mi,DivEvent:()=>oi,Events:()=>li,ExternalInteractorBase:()=>xe,FullScreen:()=>ei,HoverEvent:()=>ai,HslAnimation:()=>fi,HslColorManager:()=>we,Interactivity:()=>hi,ManualParticle:()=>di,Modes:()=>ci,Move:()=>Ti,MoveAngle:()=>Ci,MoveAttract:()=>Pi,MoveCenter:()=>ki,MoveGravity:()=>Si,MovePath:()=>Oi,MoveTrail:()=>Ei,Opacity:()=>Fi,OpacityAnimation:()=>Li,Options:()=>ie,OptionsColor:()=>Qt,OutModes:()=>Ri,Parallax:()=>ni,ParticlesBounce:()=>zi,ParticlesBounceFactor:()=>_i,ParticlesDensity:()=>Vi,ParticlesInteractorBase:()=>_e,ParticlesNumber:()=>Bi,ParticlesOptions:()=>Qi,Point:()=>ne,Range:()=>ae,Rectangle:()=>le,ResizeEvent:()=>ri,Responsive:()=>ui,RgbColorManager:()=>be,Shadow:()=>Ui,Shape:()=>$i,Size:()=>Yi,SizeAnimation:()=>Xi,Spin:()=>Di,Stroke:()=>Ji,Theme:()=>vi,ThemeDefault:()=>pi,ValueWithRandom:()=>xi,Vector:()=>o,Vector3d:()=>s,ZIndex:()=>Zi,addColorManager:()=>st,addEasing:()=>r,alterHsl:()=>Tt,animate:()=>T,areBoundsInside:()=>H,arrayRandomIndex:()=>V,calcExactPositionOrRandomFromSize:()=>k,calcExactPositionOrRandomFromSizeRanged:()=>S,calcPositionFromSize:()=>M,calcPositionOrRandomFromSize:()=>C,calcPositionOrRandomFromSizeRanged:()=>P,calculateBounds:()=>q,cancelAnimation:()=>A,circleBounce:()=>Y,circleBounceDataFromParticle:()=>X,clamp:()=>d,clear:()=>St,collisionVelocity:()=>z,colorMix:()=>gt,colorToHsl:()=>lt,colorToRgb:()=>rt,deepExtend:()=>W,divMode:()=>$,divModeExecute:()=>G,drawLine:()=>Mt,drawParticle:()=>Ot,drawParticlePlugin:()=>Dt,drawPlugin:()=>Rt,drawShape:()=>It,drawShapeAfterEffect:()=>Et,drawTriangle:()=>Ct,executeOnSingleOrMultiple:()=>Z,findItemFromSingleOrMultiple:()=>K,fireworks:()=>Is,generatedAttribute:()=>At,getDistance:()=>b,getDistances:()=>w,getEasing:()=>l,getHslAnimationFromHsl:()=>_t,getHslFromAnimation:()=>xt,getLinkColor:()=>wt,getLinkRandomColor:()=>bt,getParticleBaseVelocity:()=>_,getParticleDirectionAngle:()=>x,getRandom:()=>h,getRandomRgbColor:()=>mt,getRangeMax:()=>f,getRangeMin:()=>m,getRangeValue:()=>v,getStyleFromHsl:()=>yt,getStyleFromRgb:()=>ft,getValue:()=>g,hasMatchMedia:()=>R,hslToRgb:()=>pt,hslaToRgba:()=>vt,isDivModeEnabled:()=>N,isInArray:()=>L,isPointInside:()=>U,isSsr:()=>E,itemFromArray:()=>B,itemFromSingleOrMultiple:()=>Q,loadFont:()=>F,loadOptions:()=>Ki,loadParticlesOptions:()=>te,mix:()=>u,mouseDownEvent:()=>Ft,mouseLeaveEvent:()=>qt,mouseMoveEvent:()=>Bt,mouseOutEvent:()=>Wt,mouseUpEvent:()=>Vt,paintBase:()=>Pt,paintImage:()=>kt,parseAlpha:()=>O,randomInRange:()=>p,rangeColorToHsl:()=>ct,rangeColorToRgb:()=>at,rectBounce:()=>J,resizeEvent:()=>Gt,rgbToHsl:()=>ht,safeMatchMedia:()=>D,setRandom:()=>c,setRangeValue:()=>y,singleDivModeExecute:()=>j,stringToAlpha:()=>dt,stringToRgb:()=>ut,touchCancelEvent:()=>Nt,touchEndEvent:()=>Lt,touchMoveEvent:()=>Ht,touchStartEvent:()=>Ut,tsParticles:()=>Ce,visibilityChangeEvent:()=>jt});class e{constructor(){this._listeners=new Map}addEventListener(t,i){var e;this.removeEventListener(t,i),this._listeners.get(t)||this._listeners.set(t,[]),null===(e=this._listeners.get(t))||void 0===e||e.push(i)}dispatchEvent(t,i){var e;null===(e=this._listeners.get(t))||void 0===e||e.forEach((t=>t(i)))}hasEventListener(t){return!!this._listeners.get(t)}removeAllEventListeners(t){t?this._listeners.delete(t):this._listeners=new Map}removeEventListener(t,i){const e=this._listeners.get(t);if(!e)return;const s=e.length,o=e.indexOf(i);o<0||(1===s?this._listeners.delete(t):e.splice(o,1))}}class s{constructor(t,i,e){if("number"!=typeof t&&t){this.x=t.x,this.y=t.y;const i=t;this.z=i.z?i.z:0}else{if(void 0===t||void 0===i)throw new Error("tsParticles - Vector3d not initialized correctly");this.x=t,this.y=i,this.z=null!=e?e:0}}static get origin(){return s.create(0,0,0)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this.updateFromAngle(t,this.length)}get length(){return Math.sqrt(this.getLengthSq())}set length(t){this.updateFromAngle(this.angle,t)}static clone(t){return s.create(t.x,t.y,t.z)}static create(t,i,e){return new s(t,i,e)}add(t){return s.create(this.x+t.x,this.y+t.y,this.z+t.z)}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=t.z}copy(){return s.clone(this)}distanceTo(t){return this.sub(t).length}distanceToSq(t){return this.sub(t).getLengthSq()}div(t){return s.create(this.x/t,this.y/t,this.z/t)}divTo(t){this.x/=t,this.y/=t,this.z/=t}getLengthSq(){return this.x**2+this.y**2}mult(t){return s.create(this.x*t,this.y*t,this.z*t)}multTo(t){this.x*=t,this.y*=t,this.z*=t}rotate(t){return s.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),0)}setTo(t){this.x=t.x,this.y=t.y;const i=t;this.z=i.z?i.z:0}sub(t){return s.create(this.x-t.x,this.y-t.y,this.z-t.z)}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=t.z}updateFromAngle(t,i){this.x=Math.cos(t)*i,this.y=Math.sin(t)*i}}class o extends s{constructor(t,i){super(t,i,0)}static get origin(){return o.create(0,0)}static clone(t){return o.create(t.x,t.y)}static create(t,i){return new o(t,i)}}let n=Math.random;const a=new Map;function r(t,i){a.get(t)||a.set(t,i)}function l(t){return a.get(t)||(t=>t)}function c(t=Math.random){n=t}function h(){return d(n(),0,1-1e-16)}function d(t,i,e){return Math.min(Math.max(t,i),e)}function u(t,i,e,s){return Math.floor((t*e+i*s)/(e+s))}function p(t){const i=f(t);let e=m(t);return i===e&&(e=0),h()*(i-e)+e}function v(t){return"number"==typeof t?t:p(t)}function m(t){return"number"==typeof t?t:t.min}function f(t){return"number"==typeof t?t:t.max}function y(t,i){if(t===i||void 0===i&&"number"==typeof t)return t;const e=m(t),s=f(t);return void 0!==i?{min:Math.min(e,i),max:Math.max(s,i)}:y(e,s)}function g(t){const i=t.random,{enable:e,minimumValue:s}="boolean"==typeof i?{enable:i,minimumValue:0}:i;return v(e?y(t.value,s):t.value)}function w(t,i){const e=t.x-i.x,s=t.y-i.y;return{dx:e,dy:s,distance:Math.sqrt(e**2+s**2)}}function b(t,i){return w(t,i).distance}function x(t,i,e){if("number"==typeof t)return t*Math.PI/180;switch(t){case"top":return-Math.PI/2;case"top-right":return-Math.PI/4;case"right":return 0;case"bottom-right":return Math.PI/4;case"bottom":return Math.PI/2;case"bottom-left":return 3*Math.PI/4;case"left":return Math.PI;case"top-left":return-3*Math.PI/4;case"inside":return Math.atan2(e.y-i.y,e.x-i.x);case"outside":return Math.atan2(i.y-e.y,i.x-e.x);default:return h()*Math.PI*2}}function _(t){const i=o.origin;return i.length=1,i.angle=t,i}function z(t,i,e,s){return o.create(t.x*(e-s)/(e+s)+2*i.x*s/(e+s),t.y)}function M(t){return t.position&&void 0!==t.position.x&&void 0!==t.position.y?{x:t.position.x*t.size.width/100,y:t.position.y*t.size.height/100}:void 0}function C(t){var i,e,s,o;return{x:(null!==(e=null===(i=t.position)||void 0===i?void 0:i.x)&&void 0!==e?e:100*h())*t.size.width/100,y:(null!==(o=null===(s=t.position)||void 0===s?void 0:s.y)&&void 0!==o?o:100*h())*t.size.height/100}}function P(t){var i,e;const s={x:void 0!==(null===(i=t.position)||void 0===i?void 0:i.x)?v(t.position.x):void 0,y:void 0!==(null===(e=t.position)||void 0===e?void 0:e.y)?v(t.position.y):void 0};return C({size:t.size,position:s})}function k(t){var i,e,s,o;return{x:null!==(e=null===(i=t.position)||void 0===i?void 0:i.x)&&void 0!==e?e:h()*t.size.width,y:null!==(o=null===(s=t.position)||void 0===s?void 0:s.y)&&void 0!==o?o:h()*t.size.height}}function S(t){var i,e;const s={x:void 0!==(null===(i=t.position)||void 0===i?void 0:i.x)?v(t.position.x):void 0,y:void 0!==(null===(e=t.position)||void 0===e?void 0:e.y)?v(t.position.y):void 0};return k({size:t.size,position:s})}function O(t){return t?t.endsWith("%")?parseFloat(t)/100:parseFloat(t):1}function I(t,i,e,s,o,n){const a={bounced:!1};return i.min<s.min||i.min>s.max||i.max<s.min||i.max>s.max||(t.max>=e.min&&t.max<=(e.max+e.min)/2&&o>0||t.min<=e.max&&t.min>(e.max+e.min)/2&&o<0)&&(a.velocity=o*-n,a.bounced=!0),a}function E(){return"undefined"==typeof window||!window||void 0===window.document||!window.document}function R(){return!E()&&"undefined"!=typeof matchMedia}function D(t){if(R())return matchMedia(t)}function T(){return E()?t=>setTimeout(t):t=>(requestAnimationFrame||setTimeout)(t)}function A(){return E()?t=>clearTimeout(t):t=>(cancelAnimationFrame||clearTimeout)(t)}function L(t,i){return t===i||i instanceof Array&&i.indexOf(t)>-1}async function F(t,i){try{await document.fonts.load(`${null!=i?i:"400"} 36px '${null!=t?t:"Verdana"}'`)}catch(t){}}function V(t){return Math.floor(h()*t.length)}function B(t,i,e=!0){return t[void 0!==i&&e?i%t.length:V(t)]}function U(t,i,e,s,o){return H(q(t,null!=s?s:0),i,e,o)}function H(t,i,e,s){let o=!0;return s&&"bottom"!==s||(o=t.top<i.height+e.x),!o||s&&"left"!==s||(o=t.right>e.x),!o||s&&"right"!==s||(o=t.left<i.width+e.y),!o||s&&"top"!==s||(o=t.bottom>e.y),o}function q(t,i){return{bottom:t.y+i,left:t.x-i,right:t.x+i,top:t.y-i}}function W(t,...i){for(const e of i){if(null==e)continue;if("object"!=typeof e){t=e;continue}const i=Array.isArray(e);!i||"object"==typeof t&&t&&Array.isArray(t)?i||"object"==typeof t&&t&&!Array.isArray(t)||(t={}):t=[];for(const i in e){if("__proto__"===i)continue;const s=e[i],o="object"==typeof s,n=t;n[i]=o&&Array.isArray(s)?s.map((t=>W(n[i],t))):W(n[i],s)}}return t}function N(t,i){return!!K(i,(i=>i.enable&&L(t,i.mode)))}function G(t,i,e){Z(i,(i=>{const s=i.mode;i.enable&&L(t,s)&&j(i,e)}))}function j(t,i){Z(t.selectors,(e=>{i(e,t)}))}function $(t,i){if(i&&t)return K(t,(t=>function(t,i){const e=Z(i,(i=>t.matches(i)));return e instanceof Array?e.some((t=>t)):e}(i,t.selectors)))}function X(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:o.create(g(t.options.bounce.horizontal),g(t.options.bounce.vertical))}}function Y(t,i){const{x:e,y:s}=t.velocity.sub(i.velocity),[o,n]=[t.position,i.position],{dx:a,dy:r}=w(n,o);if(e*a+s*r<0)return;const l=-Math.atan2(r,a),c=t.mass,h=i.mass,d=t.velocity.rotate(l),u=i.velocity.rotate(l),p=z(d,u,c,h),v=z(u,d,c,h),m=p.rotate(-l),f=v.rotate(-l);t.velocity.x=m.x*t.factor.x,t.velocity.y=m.y*t.factor.y,i.velocity.x=f.x*i.factor.x,i.velocity.y=f.y*i.factor.y}function J(t,i){const e=q(t.getPosition(),t.getRadius()),s=I({min:e.left,max:e.right},{min:e.top,max:e.bottom},{min:i.left,max:i.right},{min:i.top,max:i.bottom},t.velocity.x,g(t.options.bounce.horizontal));s.bounced&&(void 0!==s.velocity&&(t.velocity.x=s.velocity),void 0!==s.position&&(t.position.x=s.position));const o=I({min:e.top,max:e.bottom},{min:e.left,max:e.right},{min:i.top,max:i.bottom},{min:i.left,max:i.right},t.velocity.y,g(t.options.bounce.vertical));o.bounced&&(void 0!==o.velocity&&(t.velocity.y=o.velocity),void 0!==o.position&&(t.position.y=o.position))}function Z(t,i){return t instanceof Array?t.map(((t,e)=>i(t,e))):i(t,0)}function Q(t,i,e){return t instanceof Array?B(t,i,e):t}function K(t,i){return t instanceof Array?t.find(((t,e)=>i(t,e))):i(t,0)?t:void 0}const tt="random",it="mid",et=new Map;function st(t){et.set(t.key,t)}function ot(t,i,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?t+6*(i-t)*e:e<.5?i:e<2/3?t+(i-t)*(2/3-e)*6:t}function nt(t){for(const[,i]of et)if(t.startsWith(i.stringPrefix))return i.parseString(t);const i=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,((t,i,e,s,o)=>i+i+e+e+s+s+(void 0!==o?o+o:""))),e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(i);return e?{a:void 0!==e[4]?parseInt(e[4],16)/255:1,b:parseInt(e[3],16),g:parseInt(e[2],16),r:parseInt(e[1],16)}:void 0}function at(t,i,e=!0){if(!t)return;const s="string"==typeof t?{value:t}:t;if("string"==typeof s.value)return rt(s.value,i,e);if(s.value instanceof Array)return at({value:B(s.value,i,e)});for(const[,t]of et){const i=t.handleRangeColor(s);if(i)return i}}function rt(t,i,e=!0){if(!t)return;const s="string"==typeof t?{value:t}:t;if("string"==typeof s.value)return s.value===tt?mt():ut(s.value);if(s.value instanceof Array)return rt({value:B(s.value,i,e)});for(const[,t]of et){const i=t.handleColor(s);if(i)return i}}function lt(t,i,e=!0){const s=rt(t,i,e);return s?ht(s):void 0}function ct(t,i,e=!0){const s=at(t,i,e);return s?ht(s):void 0}function ht(t){const i=t.r/255,e=t.g/255,s=t.b/255,o=Math.max(i,e,s),n=Math.min(i,e,s),a={h:0,l:(o+n)/2,s:0};return o!==n&&(a.s=a.l<.5?(o-n)/(o+n):(o-n)/(2-o-n),a.h=i===o?(e-s)/(o-n):a.h=e===o?2+(s-i)/(o-n):4+(i-e)/(o-n)),a.l*=100,a.s*=100,a.h*=60,a.h<0&&(a.h+=360),a.h>=360&&(a.h-=360),a}function dt(t){var i;return null===(i=nt(t))||void 0===i?void 0:i.a}function ut(t){return nt(t)}function pt(t){const i={b:0,g:0,r:0},e={h:t.h/360,l:t.l/100,s:t.s/100};if(e.s){const t=e.l<.5?e.l*(1+e.s):e.l+e.s-e.l*e.s,s=2*e.l-t;i.r=ot(s,t,e.h+1/3),i.g=ot(s,t,e.h),i.b=ot(s,t,e.h-1/3)}else i.b=e.l,i.g=e.l,i.r=e.l;return i.r=Math.floor(255*i.r),i.g=Math.floor(255*i.g),i.b=Math.floor(255*i.b),i}function vt(t){const i=pt(t);return{a:t.a,b:i.b,g:i.g,r:i.r}}function mt(t){const i=null!=t?t:0;return{b:Math.floor(p(y(i,256))),g:Math.floor(p(y(i,256))),r:Math.floor(p(y(i,256)))}}function ft(t,i){return`rgba(${t.r}, ${t.g}, ${t.b}, ${null!=i?i:1})`}function yt(t,i){return`hsla(${t.h}, ${t.s}%, ${t.l}%, ${null!=i?i:1})`}function gt(t,i,e,s){let o=t,n=i;return void 0===o.r&&(o=pt(t)),void 0===n.r&&(n=pt(i)),{b:u(o.b,n.b,e,s),g:u(o.g,n.g,e,s),r:u(o.r,n.r,e,s)}}function wt(t,i,e){var s,o;if(e===tt)return mt();if(e!==it)return e;{const e=null!==(s=t.getFillColor())&&void 0!==s?s:t.getStrokeColor(),n=null!==(o=null==i?void 0:i.getFillColor())&&void 0!==o?o:null==i?void 0:i.getStrokeColor();if(e&&n&&i)return gt(e,n,t.getRadius(),i.getRadius());{const t=null!=e?e:n;if(t)return pt(t)}}}function bt(t,i,e){const s="string"==typeof t?t:t.value;return s===tt?e?at({value:s}):i?tt:it:s===it?it:at({value:s})}function xt(t){return void 0!==t?{h:t.h.value,s:t.s.value,l:t.l.value}:void 0}function _t(t,i,e){const s={h:{enable:!1,value:t.h},s:{enable:!1,value:t.s},l:{enable:!1,value:t.l}};return i&&(zt(s.h,i.h,e),zt(s.s,i.s,e),zt(s.l,i.l,e)),s}function zt(t,i,e){t.enable=i.enable,t.enable?(t.velocity=v(i.speed)/100*e,t.decay=1-v(i.decay),t.status="increasing",t.loops=0,t.maxLoops=v(i.count),i.sync||(t.velocity*=h(),t.value*=h()),t.initialValue=t.value):t.velocity=0}function Mt(t,i,e){t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(e.x,e.y),t.closePath()}function Ct(t,i,e,s){t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(e.x,e.y),t.lineTo(s.x,s.y),t.closePath()}function Pt(t,i,e){t.fillStyle=null!=e?e:"rgba(0,0,0,0)",t.fillRect(0,0,i.width,i.height)}function kt(t,i,e,s){e&&(t.globalAlpha=s,t.drawImage(e,0,0,i.width,i.height),t.globalAlpha=1)}function St(t,i){t.clearRect(0,0,i.width,i.height)}function Ot(t){var i,e,s,o,n;const{container:a,context:r,particle:l,delta:c,colorStyles:h,backgroundMask:d,composite:u,radius:p,opacity:v,shadow:m,transform:f}=t,y=l.getPosition(),g=l.rotation+(l.pathRotation?l.velocity.angle:0),w=Math.sin(g),b=Math.cos(g),x={a:b*(null!==(i=f.a)&&void 0!==i?i:1),b:w*(null!==(e=f.b)&&void 0!==e?e:1),c:-w*(null!==(s=f.c)&&void 0!==s?s:1),d:b*(null!==(o=f.d)&&void 0!==o?o:1)};r.setTransform(x.a,x.b,x.c,x.d,y.x,y.y),r.beginPath(),d&&(r.globalCompositeOperation=u);const _=l.shadowColor;m.enable&&_&&(r.shadowBlur=m.blur,r.shadowColor=ft(_),r.shadowOffsetX=m.offset.x,r.shadowOffsetY=m.offset.y),h.fill&&(r.fillStyle=h.fill);const z=null!==(n=l.strokeWidth)&&void 0!==n?n:0;r.lineWidth=z,h.stroke&&(r.strokeStyle=h.stroke),It(a,r,l,p,v,c),z>0&&r.stroke(),l.close&&r.closePath(),l.fill&&r.fill(),Et(a,r,l,p,v,c),r.globalCompositeOperation="source-over",r.setTransform(1,0,0,1,0,0)}function It(t,i,e,s,o,n){if(!e.shape)return;const a=t.drawers.get(e.shape);a&&a.draw(i,e,s,o,n,t.retina.pixelRatio)}function Et(t,i,e,s,o,n){if(!e.shape)return;const a=t.drawers.get(e.shape);(null==a?void 0:a.afterEffect)&&a.afterEffect(i,e,s,o,n,t.retina.pixelRatio)}function Rt(t,i,e){i.draw&&i.draw(t,e)}function Dt(t,i,e,s){i.drawParticle&&i.drawParticle(t,e,s)}function Tt(t,i,e){return{h:t.h,s:t.s,l:t.l+("darken"===i?-1:1)*e}}const At="generated",Lt="touchend",Ft="pointerdown",Vt="pointerup",Bt="pointermove",Ut="touchstart",Ht="touchmove",qt="pointerleave",Wt="pointerout",Nt="touchcancel",Gt="resize",jt="visibilitychange";function $t(t,i,e){var s;const o=i[e];void 0!==o&&(t[e]=(null!==(s=t[e])&&void 0!==s?s:1)*o)}class Xt{constructor(t){this.container=t,this.size={height:0,width:0},this._context=null,this._generated=!1,this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[],this._mutationObserver=E()||"undefined"==typeof MutationObserver?void 0:new MutationObserver((t=>{for(const i of t)"attributes"===i.type&&"style"===i.attributeName&&this._repairStyle()}))}get _fullScreen(){return this.container.actualOptions.fullScreen.enable}clear(){const t=this.container.actualOptions,i=t.particles.move.trail,e=this._trailFill;t.backgroundMask.enable?this.paint():i.enable&&i.length>0&&e?e.color?this._paintBase(ft(e.color,e.opacity)):e.image&&this._paintImage(e.image,e.opacity):this.draw((t=>{St(t,this.size)}))}destroy(){var t,i;null===(t=this._mutationObserver)||void 0===t||t.disconnect(),this._generated?null===(i=this.element)||void 0===i||i.remove():this._resetOriginalStyle(),this.stop(),this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[]}draw(t){if(this._context)return t(this._context)}drawParticle(t,i){var e;if(t.spawning||t.destroyed)return;const s=t.getRadius();if(s<=0)return;const o=t.getFillColor(),n=null!==(e=t.getStrokeColor())&&void 0!==e?e:o;let[a,r]=this._getPluginParticleColors(t);a||(a=o),r||(r=n),(a||r)&&this.draw((e=>{var o,n,l,c;const h=this.container.actualOptions,d=t.options.zIndex,u=(1-t.zIndexFactor)**d.opacityRate,p=null!==(l=null!==(o=t.bubble.opacity)&&void 0!==o?o:null===(n=t.opacity)||void 0===n?void 0:n.value)&&void 0!==l?l:1,v=p*u,m=(null!==(c=t.strokeOpacity)&&void 0!==c?c:p)*u,f={},y={fill:a?yt(a,v):void 0};y.stroke=r?yt(r,m):y.fill,this._applyPreDrawUpdaters(e,t,s,v,y,f),Ot({container:this.container,context:e,particle:t,delta:i,colorStyles:y,backgroundMask:h.backgroundMask.enable,composite:h.backgroundMask.composite,radius:s*(1-t.zIndexFactor)**d.sizeRate,opacity:v,shadow:t.options.shadow,transform:f}),this._applyPostDrawUpdaters(t)}))}drawParticlePlugin(t,i,e){this.draw((s=>{Dt(s,t,i,e)}))}drawPlugin(t,i){this.draw((e=>{Rt(e,t,i)}))}async init(){var t;this.resize(),this._initStyle(),this._initCover();try{await this._initTrail()}catch(t){console.error(t)}this.initBackground(),this.element&&(null===(t=this._mutationObserver)||void 0===t||t.observe(this.element,{attributes:!0})),this.initUpdaters(),this.initPlugins(),this.paint()}initBackground(){const t=this.container.actualOptions.background,i=this.element,e=null==i?void 0:i.style;if(e){if(t.color){const i=at(t.color);e.backgroundColor=i?ft(i,t.opacity):""}else e.backgroundColor="";e.backgroundImage=t.image||"",e.backgroundPosition=t.position||"",e.backgroundRepeat=t.repeat||"",e.backgroundSize=t.size||""}}initPlugins(){this._resizePlugins=[];for(const[,t]of this.container.plugins)t.resize&&this._resizePlugins.push(t),(t.particleFillColor||t.particleStrokeColor)&&this._colorPlugins.push(t)}initUpdaters(){this._preDrawUpdaters=[],this._postDrawUpdaters=[];for(const t of this.container.particles.updaters)t.afterDraw&&this._postDrawUpdaters.push(t),(t.getColorStyles||t.getTransformValues||t.beforeDraw)&&this._preDrawUpdaters.push(t)}loadCanvas(t){var i,e;this._generated&&(null===(i=this.element)||void 0===i||i.remove()),this._generated=t.dataset&&At in t.dataset?"true"===t.dataset[At]:this._generated,this.element=t,this.element.ariaHidden="true",this._originalStyle=W({},this.element.style),this.size.height=t.offsetHeight,this.size.width=t.offsetWidth,this._context=this.element.getContext("2d"),null===(e=this._mutationObserver)||void 0===e||e.observe(this.element,{attributes:!0}),this.container.retina.init(),this.initBackground()}paint(){const t=this.container.actualOptions;this.draw((i=>{t.backgroundMask.enable&&t.backgroundMask.cover?(St(i,this.size),this._paintBase(this._coverColorStyle)):this._paintBase()}))}resize(){if(!this.element)return;const t=this.container,i=t.retina.pixelRatio,e=t.canvas.size,s=this.element.offsetWidth*i,o=this.element.offsetHeight*i;if(o===e.height&&s===e.width&&o===this.element.height&&s===this.element.width)return;const n=Object.assign({},e);this.element.width=e.width=this.element.offsetWidth*i,this.element.height=e.height=this.element.offsetHeight*i,this.container.started&&(this.resizeFactor={width:e.width/n.width,height:e.height/n.height})}stop(){this.draw((t=>{St(t,this.size)}))}async windowResize(){if(!this.element)return;this.resize();const t=this.container,i=t.updateActualOptions();t.particles.setDensity(),this._applyResizePlugins(),i&&await t.refresh()}_applyPostDrawUpdaters(t){var i;for(const e of this._postDrawUpdaters)null===(i=e.afterDraw)||void 0===i||i.call(e,t)}_applyPreDrawUpdaters(t,i,e,s,o,n){var a;for(const r of this._preDrawUpdaters){if(r.getColorStyles){const{fill:n,stroke:a}=r.getColorStyles(i,t,e,s);n&&(o.fill=n),a&&(o.stroke=a)}if(r.getTransformValues){const t=r.getTransformValues(i);for(const i in t)$t(n,t,i)}null===(a=r.beforeDraw)||void 0===a||a.call(r,i)}}_applyResizePlugins(){for(const t of this._resizePlugins)t.resize&&t.resize()}_getPluginParticleColors(t){let i,e;for(const s of this._colorPlugins)if(!i&&s.particleFillColor&&(i=ct(s.particleFillColor(t))),!e&&s.particleStrokeColor&&(e=ct(s.particleStrokeColor(t))),i&&e)break;return[i,e]}_initCover(){const t=this.container.actualOptions.backgroundMask.cover,i=at(t.color);if(i){const e={r:i.r,g:i.g,b:i.b,a:t.opacity};this._coverColorStyle=ft(e,e.a)}}_initStyle(){const t=this.element,i=this.container.actualOptions;if(t){this._fullScreen?(this._originalStyle=W({},t.style),this._setFullScreenStyle()):this._resetOriginalStyle();for(const e in i.style){if(!e||!i.style)continue;const s=i.style[e];s&&t.style.setProperty(e,s,"important")}}}async _initTrail(){const t=this.container.actualOptions,i=t.particles.move.trail,e=i.fill;if(i.enable)if(e.color){const i=at(e.color);if(!i)return;const s=t.particles.move.trail;this._trailFill={color:Object.assign({},i),opacity:1/s.length}}else await new Promise(((t,s)=>{if(!e.image)return;const o=document.createElement("img");o.addEventListener("load",(()=>{this._trailFill={image:o,opacity:1/i.length},t()})),o.addEventListener("error",(t=>{s(t.error)})),o.src=e.image}))}_paintBase(t){this.draw((i=>{Pt(i,this.size,t)}))}_paintImage(t,i){this.draw((e=>{kt(e,this.size,t,i)}))}_repairStyle(){var t,i;const e=this.element;e&&(null===(t=this._mutationObserver)||void 0===t||t.disconnect(),this._initStyle(),this.initBackground(),null===(i=this._mutationObserver)||void 0===i||i.observe(e,{attributes:!0}))}_resetOriginalStyle(){const t=this.element,i=this._originalStyle;t&&i&&(t.style.position=i.position,t.style.zIndex=i.zIndex,t.style.top=i.top,t.style.left=i.left,t.style.width=i.width,t.style.height=i.height)}_setFullScreenStyle(){const t=this.element;if(!t)return;const i="important";t.style.setProperty("position","fixed",i),t.style.setProperty("z-index",this.container.actualOptions.fullScreen.zIndex.toString(10),i),t.style.setProperty("top","0",i),t.style.setProperty("left","0",i),t.style.setProperty("width","100%",i),t.style.setProperty("height","100%",i)}}function Yt(t,i,e,s,o){if(s){let s={passive:!0};"boolean"==typeof o?s.capture=o:void 0!==o&&(s=o),t.addEventListener(i,e,s)}else{const s=o;t.removeEventListener(i,e,s)}}class Jt{constructor(t){this.container=t,this.canPush=!0,this.handlers={mouseMove:t=>this.mouseTouchMove(t),touchStart:t=>this.mouseTouchMove(t),touchMove:t=>this.mouseTouchMove(t),touchEnd:()=>this.mouseTouchFinish(),mouseLeave:()=>this.mouseTouchFinish(),touchCancel:()=>this.mouseTouchFinish(),touchEndClick:t=>this.mouseTouchClick(t),mouseUp:t=>this.mouseTouchClick(t),mouseDown:()=>this.mouseDown(),visibilityChange:()=>this.handleVisibilityChange(),themeChange:t=>this.handleThemeChange(t),oldThemeChange:t=>this.handleThemeChange(t),resize:()=>this.handleWindowResize()}}addListeners(){this.manageListeners(!0)}removeListeners(){this.manageListeners(!1)}doMouseTouchClick(t){const i=this.container,e=i.actualOptions;if(this.canPush){const t=i.interactivity.mouse,s=t.position;if(!s)return;t.clickPosition=Object.assign({},s),t.clickTime=(new Date).getTime();Z(e.interactivity.events.onClick.mode,(t=>this.handleClickMode(t)))}"touchend"===t.type&&setTimeout((()=>this.mouseTouchFinish()),500)}handleClickMode(t){this.container.handleClickMode(t)}handleThemeChange(t){const i=t,e=this.container,s=e.options,o=s.defaultThemes,n=i.matches?o.dark:o.light,a=s.themes.find((t=>t.name===n));a&&a.default.auto&&e.loadTheme(n)}handleVisibilityChange(){const t=this.container,i=t.actualOptions;this.mouseTouchFinish(),i.pauseOnBlur&&((null===document||void 0===document?void 0:document.hidden)?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.getAnimationStatus()?t.play(!0):t.draw(!0)))}handleWindowResize(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),delete this.resizeTimeout),this.resizeTimeout=setTimeout((async()=>{var t;return null===(t=this.container.canvas)||void 0===t?void 0:t.windowResize()}),1e3*this.container.actualOptions.interactivity.events.resize.delay)}manageListeners(t){var i;const e=this.handlers,s=this.container,o=s.actualOptions,n=o.interactivity.detectsOn;let a=qt;if("window"===n)s.interactivity.element=window,a=Wt;else if("parent"===n&&s.canvas.element){const t=s.canvas.element;s.interactivity.element=null!==(i=t.parentElement)&&void 0!==i?i:t.parentNode}else s.interactivity.element=s.canvas.element;const r=D("(prefers-color-scheme: dark)");r&&(void 0!==r.addEventListener?Yt(r,"change",e.themeChange,t):void 0!==r.addListener&&(t?r.addListener(e.oldThemeChange):r.removeListener(e.oldThemeChange)));const l=s.interactivity.element;if(!l)return;const c=l;(o.interactivity.events.onHover.enable||o.interactivity.events.onClick.enable)&&(Yt(l,Bt,e.mouseMove,t),Yt(l,Ut,e.touchStart,t),Yt(l,Ht,e.touchMove,t),o.interactivity.events.onClick.enable?(Yt(l,Lt,e.touchEndClick,t),Yt(l,Vt,e.mouseUp,t),Yt(l,Ft,e.mouseDown,t)):Yt(l,Lt,e.touchEnd,t),Yt(l,a,e.mouseLeave,t),Yt(l,Nt,e.touchCancel,t)),s.canvas.element&&(s.canvas.element.style.pointerEvents=c===s.canvas.element?"initial":"none"),o.interactivity.events.resize&&("undefined"!=typeof ResizeObserver?this.resizeObserver&&!t?(s.canvas.element&&this.resizeObserver.unobserve(s.canvas.element),this.resizeObserver.disconnect(),delete this.resizeObserver):!this.resizeObserver&&t&&s.canvas.element&&(this.resizeObserver=new ResizeObserver((t=>{t.find((t=>t.target===s.canvas.element))&&this.handleWindowResize()})),this.resizeObserver.observe(s.canvas.element)):Yt(window,Gt,e.resize,t)),document&&Yt(document,jt,e.visibilityChange,t,!1)}mouseDown(){const t=this.container.interactivity;if(t){const i=t.mouse;i.clicking=!0,i.downPosition=i.position}}mouseTouchClick(t){const i=this.container,e=i.actualOptions,s=i.interactivity.mouse;s.inside=!0;let o=!1;const n=s.position;if(n&&e.interactivity.events.onClick.enable){for(const[,t]of i.plugins)if(t.clickPositionValid&&(o=t.clickPositionValid(n),o))break;o||this.doMouseTouchClick(t),s.clicking=!1}}mouseTouchFinish(){const t=this.container.interactivity;if(!t)return;const i=t.mouse;delete i.position,delete i.clickPosition,delete i.downPosition,t.status=qt,i.inside=!1,i.clicking=!1}mouseTouchMove(t){var i,e,s,o,n,a,r;const l=this.container,c=l.actualOptions;if(!(null===(i=l.interactivity)||void 0===i?void 0:i.element))return;let h;l.interactivity.mouse.inside=!0;const d=l.canvas.element;if(t.type.startsWith("pointer")){this.canPush=!0;const i=t;if(l.interactivity.element===window){if(d){const t=d.getBoundingClientRect();h={x:i.clientX-t.left,y:i.clientY-t.top}}}else if("parent"===c.interactivity.detectsOn){const t=i.target,o=i.currentTarget,n=l.canvas.element;if(t&&o&&n){const e=t.getBoundingClientRect(),s=o.getBoundingClientRect(),a=n.getBoundingClientRect();h={x:i.offsetX+2*e.left-(s.left+a.left),y:i.offsetY+2*e.top-(s.top+a.top)}}else h={x:null!==(e=i.offsetX)&&void 0!==e?e:i.clientX,y:null!==(s=i.offsetY)&&void 0!==s?s:i.clientY}}else i.target===l.canvas.element&&(h={x:null!==(o=i.offsetX)&&void 0!==o?o:i.clientX,y:null!==(n=i.offsetY)&&void 0!==n?n:i.clientY})}else{this.canPush="touchmove"!==t.type;const i=t,e=i.touches[i.touches.length-1],s=null==d?void 0:d.getBoundingClientRect();h={x:e.clientX-(null!==(a=null==s?void 0:s.left)&&void 0!==a?a:0),y:e.clientY-(null!==(r=null==s?void 0:s.top)&&void 0!==r?r:0)}}const u=l.retina.pixelRatio;h&&(h.x*=u,h.y*=u),l.interactivity.mouse.position=h,l.interactivity.status=Bt}}class Zt{constructor(t){this.container=t}async nextFrame(t){var i;try{const e=this.container;if(!e.smooth&&void 0!==e.lastFrameTime&&t<e.lastFrameTime+1e3/e.fpsLimit)return void e.draw(!1);null!==(i=e.lastFrameTime)&&void 0!==i||(e.lastFrameTime=t);const s=function(t,i=60,e=!1){return{value:t,factor:e?60/i:60*t/1e3}}(t-e.lastFrameTime,e.fpsLimit,e.smooth);if(e.lifeTime+=s.value,e.lastFrameTime=t,s.value>1e3)return void e.draw(!1);if(await e.particles.draw(s),e.duration>0&&e.lifeTime>e.duration)return void e.destroy();e.getAnimationStatus()&&e.draw(!1)}catch(t){console.error("tsParticles error in animation loop",t)}}}class Qt{constructor(){this.value=""}static create(t,i){const e=new Qt;return e.load(t),void 0!==i&&("string"==typeof i||i instanceof Array?e.load({value:i}):e.load(i)),e}load(t){void 0!==(null==t?void 0:t.value)&&(this.value=t.value)}}class Kt{constructor(){this.color=new Qt,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(t){t&&(void 0!==t.color&&(this.color=Qt.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image),void 0!==t.position&&(this.position=t.position),void 0!==t.repeat&&(this.repeat=t.repeat),void 0!==t.size&&(this.size=t.size),void 0!==t.opacity&&(this.opacity=t.opacity))}}class ti{constructor(){this.color=new Qt,this.color.value="#fff",this.opacity=1}load(t){t&&(void 0!==t.color&&(this.color=Qt.create(this.color,t.color)),void 0!==t.opacity&&(this.opacity=t.opacity))}}class ii{constructor(){this.composite="destination-out",this.cover=new ti,this.enable=!1}load(t){if(t){if(void 0!==t.composite&&(this.composite=t.composite),void 0!==t.cover){const i=t.cover,e="string"==typeof t.cover?{color:t.cover}:t.cover;this.cover.load(void 0!==i.color?i:{color:e})}void 0!==t.enable&&(this.enable=t.enable)}}}class ei{constructor(){this.enable=!0,this.zIndex=0}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.zIndex&&(this.zIndex=t.zIndex))}}class si{constructor(){this.enable=!1,this.mode=[]}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.mode&&(this.mode=t.mode))}}class oi{constructor(){this.selectors=[],this.enable=!1,this.mode=[],this.type="circle"}get el(){return this.elementId}set el(t){this.elementId=t}get elementId(){return this.ids}set elementId(t){this.ids=t}get ids(){return Z(this.selectors,(t=>t.replace("#","")))}set ids(t){this.selectors=Z(t,(t=>`#${t}`))}load(t){var i,e;if(!t)return;const s=null!==(e=null!==(i=t.ids)&&void 0!==i?i:t.elementId)&&void 0!==e?e:t.el;void 0!==s&&(this.ids=s),void 0!==t.selectors&&(this.selectors=t.selectors),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.type&&(this.type=t.type)}}class ni{constructor(){this.enable=!1,this.force=2,this.smooth=10}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.force&&(this.force=t.force),void 0!==t.smooth&&(this.smooth=t.smooth))}}class ai{constructor(){this.enable=!1,this.mode=[],this.parallax=new ni}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.mode&&(this.mode=t.mode),this.parallax.load(t.parallax))}}class ri{constructor(){this.delay=.5,this.enable=!0}load(t){void 0!==t&&(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.enable&&(this.enable=t.enable))}}class li{constructor(){this.onClick=new si,this.onDiv=new oi,this.onHover=new ai,this.resize=new ri}get onclick(){return this.onClick}set onclick(t){this.onClick=t}get ondiv(){return this.onDiv}set ondiv(t){this.onDiv=t}get onhover(){return this.onHover}set onhover(t){this.onHover=t}load(t){var i,e,s;if(!t)return;this.onClick.load(null!==(i=t.onClick)&&void 0!==i?i:t.onclick);const o=null!==(e=t.onDiv)&&void 0!==e?e:t.ondiv;void 0!==o&&(this.onDiv=Z(o,(t=>{const i=new oi;return i.load(t),i}))),this.onHover.load(null!==(s=t.onHover)&&void 0!==s?s:t.onhover),"boolean"==typeof t.resize?this.resize.enable=t.resize:this.resize.load(t.resize)}}class ci{constructor(t,i){this._engine=t,this._container=i}load(t){if(t&&this._container){const i=this._engine.plugins.interactors.get(this._container);if(i)for(const e of i)e.loadModeOptions&&e.loadModeOptions(this,t)}}}class hi{constructor(t,i){this.detectsOn="window",this.events=new li,this.modes=new ci(t,i)}get detect_on(){return this.detectsOn}set detect_on(t){this.detectsOn=t}load(t){var i;if(!t)return;const e=null!==(i=t.detectsOn)&&void 0!==i?i:t.detect_on;void 0!==e&&(this.detectsOn=e),this.events.load(t.events),this.modes.load(t.modes)}}class di{load(t){var i,e;t&&(void 0!==t.position&&(this.position={x:null!==(i=t.position.x)&&void 0!==i?i:50,y:null!==(e=t.position.y)&&void 0!==e?e:50}),void 0!==t.options&&(this.options=W({},t.options)))}}class ui{constructor(){this.maxWidth=1/0,this.options={},this.mode="canvas"}load(t){t&&(void 0!==t.maxWidth&&(this.maxWidth=t.maxWidth),void 0!==t.mode&&("screen"===t.mode?this.mode="screen":this.mode="canvas"),void 0!==t.options&&(this.options=W({},t.options)))}}class pi{constructor(){this.auto=!1,this.mode="any",this.value=!1}load(t){t&&(void 0!==t.auto&&(this.auto=t.auto),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class vi{constructor(){this.name="",this.default=new pi}load(t){t&&(void 0!==t.name&&(this.name=t.name),this.default.load(t.default),void 0!==t.options&&(this.options=W({},t.options)))}}class mi{constructor(){this.count=0,this.enable=!1,this.offset=0,this.speed=1,this.decay=0,this.sync=!0}load(t){t&&(void 0!==t.count&&(this.count=y(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.offset&&(this.offset=y(t.offset)),void 0!==t.speed&&(this.speed=y(t.speed)),void 0!==t.decay&&(this.decay=y(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class fi{constructor(){this.h=new mi,this.s=new mi,this.l=new mi}load(t){t&&(this.h.load(t.h),this.s.load(t.s),this.l.load(t.l))}}class yi extends Qt{constructor(){super(),this.animation=new fi}static create(t,i){const e=new yi;return e.load(t),void 0!==i&&("string"==typeof i||i instanceof Array?e.load({value:i}):e.load(i)),e}load(t){if(super.load(t),!t)return;const i=t.animation;void 0!==i&&(void 0!==i.enable?this.animation.h.load(i):this.animation.load(t.animation))}}class gi{constructor(){this.speed=2}load(t){t&&void 0!==t.speed&&(this.speed=t.speed)}}class wi{constructor(){this.enable=!0,this.retries=0}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.retries&&(this.retries=t.retries))}}class bi{constructor(){this.enable=!1,this.minimumValue=0}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.minimumValue&&(this.minimumValue=t.minimumValue))}}class xi{constructor(){this.random=new bi,this.value=0}load(t){t&&("boolean"==typeof t.random?this.random.enable=t.random:this.random.load(t.random),void 0!==t.value&&(this.value=y(t.value,this.random.enable?this.random.minimumValue:void 0)))}}class _i extends xi{constructor(){super(),this.random.minimumValue=.1,this.value=1}}class zi{constructor(){this.horizontal=new _i,this.vertical=new _i}load(t){t&&(this.horizontal.load(t.horizontal),this.vertical.load(t.vertical))}}class Mi{constructor(){this.absorb=new gi,this.bounce=new zi,this.enable=!1,this.mode="bounce",this.overlap=new wi}load(t){t&&(this.absorb.load(t.absorb),this.bounce.load(t.bounce),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.mode&&(this.mode=t.mode),this.overlap.load(t.overlap))}}class Ci{constructor(){this.offset=0,this.value=90}load(t){t&&(void 0!==t.offset&&(this.offset=y(t.offset)),void 0!==t.value&&(this.value=y(t.value)))}}class Pi{constructor(){this.distance=200,this.enable=!1,this.rotate={x:3e3,y:3e3}}get rotateX(){return this.rotate.x}set rotateX(t){this.rotate.x=t}get rotateY(){return this.rotate.y}set rotateY(t){this.rotate.y=t}load(t){var i,e,s,o;if(!t)return;void 0!==t.distance&&(this.distance=y(t.distance)),void 0!==t.enable&&(this.enable=t.enable);const n=null!==(e=null===(i=t.rotate)||void 0===i?void 0:i.x)&&void 0!==e?e:t.rotateX;void 0!==n&&(this.rotate.x=n);const a=null!==(o=null===(s=t.rotate)||void 0===s?void 0:s.y)&&void 0!==o?o:t.rotateY;void 0!==a&&(this.rotate.y=a)}}class ki{constructor(){this.x=50,this.y=50,this.mode="percent",this.radius=0}load(t){t&&(void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.radius&&(this.radius=t.radius))}}class Si{constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(t){t&&(void 0!==t.acceleration&&(this.acceleration=y(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.inverse&&(this.inverse=t.inverse),void 0!==t.maxSpeed&&(this.maxSpeed=y(t.maxSpeed)))}}class Oi{constructor(){this.clamp=!0,this.delay=new xi,this.enable=!1,this.options={}}load(t){t&&(void 0!==t.clamp&&(this.clamp=t.clamp),this.delay.load(t.delay),void 0!==t.enable&&(this.enable=t.enable),this.generator=t.generator,t.options&&(this.options=W(this.options,t.options)))}}class Ii{load(t){t&&(void 0!==t.color&&(this.color=Qt.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image))}}class Ei{constructor(){this.enable=!1,this.length=10,this.fill=new Ii}get fillColor(){return this.fill.color}set fillColor(t){this.fill.load({color:t})}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0===t.fill&&void 0===t.fillColor||this.fill.load(t.fill||{color:t.fillColor}),void 0!==t.length&&(this.length=t.length))}}class Ri{constructor(){this.default="out"}load(t){var i,e,s,o;t&&(void 0!==t.default&&(this.default=t.default),this.bottom=null!==(i=t.bottom)&&void 0!==i?i:t.default,this.left=null!==(e=t.left)&&void 0!==e?e:t.default,this.right=null!==(s=t.right)&&void 0!==s?s:t.default,this.top=null!==(o=t.top)&&void 0!==o?o:t.default)}}class Di{constructor(){this.acceleration=0,this.enable=!1}load(t){t&&(void 0!==t.acceleration&&(this.acceleration=y(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),this.position=t.position?W({},t.position):void 0)}}class Ti{constructor(){this.angle=new Ci,this.attract=new Pi,this.center=new ki,this.decay=0,this.distance={},this.direction="none",this.drift=0,this.enable=!1,this.gravity=new Si,this.path=new Oi,this.outModes=new Ri,this.random=!1,this.size=!1,this.speed=2,this.spin=new Di,this.straight=!1,this.trail=new Ei,this.vibrate=!1,this.warp=!1}get bounce(){return this.collisions}set bounce(t){this.collisions=t}get collisions(){return!1}set collisions(t){}get noise(){return this.path}set noise(t){this.path=t}get outMode(){return this.outModes.default}set outMode(t){this.outModes.default=t}get out_mode(){return this.outMode}set out_mode(t){this.outMode=t}load(t){var i,e,s;if(!t)return;this.angle.load("number"==typeof t.angle?{value:t.angle}:t.angle),this.attract.load(t.attract),this.center.load(t.center),void 0!==t.decay&&(this.decay=y(t.decay)),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.distance&&(this.distance="number"==typeof t.distance?{horizontal:t.distance,vertical:t.distance}:Object.assign({},t.distance)),void 0!==t.drift&&(this.drift=y(t.drift)),void 0!==t.enable&&(this.enable=t.enable),this.gravity.load(t.gravity);const o=null!==(e=null!==(i=t.outModes)&&void 0!==i?i:t.outMode)&&void 0!==e?e:t.out_mode;void 0!==o&&("object"==typeof o?this.outModes.load(o):this.outModes.load({default:o})),this.path.load(null!==(s=t.path)&&void 0!==s?s:t.noise),void 0!==t.random&&(this.random=t.random),void 0!==t.size&&(this.size=t.size),void 0!==t.speed&&(this.speed=y(t.speed)),this.spin.load(t.spin),void 0!==t.straight&&(this.straight=t.straight),this.trail.load(t.trail),void 0!==t.vibrate&&(this.vibrate=t.vibrate),void 0!==t.warp&&(this.warp=t.warp)}}class Ai{constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.sync=!1}load(t){t&&(void 0!==t.count&&(this.count=y(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=y(t.speed)),void 0!==t.decay&&(this.decay=y(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class Li extends Ai{constructor(){super(),this.destroy="none",this.enable=!1,this.speed=2,this.startValue="random",this.sync=!1}get opacity_min(){return this.minimumValue}set opacity_min(t){this.minimumValue=t}load(t){var i;t&&(super.load(t),void 0!==t.destroy&&(this.destroy=t.destroy),void 0!==t.enable&&(this.enable=t.enable),this.minimumValue=null!==(i=t.minimumValue)&&void 0!==i?i:t.opacity_min,void 0!==t.speed&&(this.speed=t.speed),void 0!==t.startValue&&(this.startValue=t.startValue),void 0!==t.sync&&(this.sync=t.sync))}}class Fi extends xi{constructor(){super(),this.animation=new Li,this.random.minimumValue=.1,this.value=1}get anim(){return this.animation}set anim(t){this.animation=t}load(t){var i;if(!t)return;super.load(t);const e=null!==(i=t.animation)&&void 0!==i?i:t.anim;void 0!==e&&(this.animation.load(e),this.value=y(this.value,this.animation.enable?this.animation.minimumValue:void 0))}}class Vi{constructor(){this.enable=!1,this.width=1920,this.height=1080}get area(){return this.width}set area(t){this.width=t}get factor(){return this.height}set factor(t){this.height=t}get value_area(){return this.area}set value_area(t){this.area=t}load(t){var i,e,s;if(!t)return;void 0!==t.enable&&(this.enable=t.enable);const o=null!==(e=null!==(i=t.width)&&void 0!==i?i:t.area)&&void 0!==e?e:t.value_area;void 0!==o&&(this.width=o);const n=null!==(s=t.height)&&void 0!==s?s:t.factor;void 0!==n&&(this.height=n)}}class Bi{constructor(){this.density=new Vi,this.limit=0,this.value=0}get max(){return this.limit}set max(t){this.limit=t}load(t){var i;if(!t)return;this.density.load(t.density);const e=null!==(i=t.limit)&&void 0!==i?i:t.max;void 0!==e&&(this.limit=e),void 0!==t.value&&(this.value=t.value)}}class Ui{constructor(){this.blur=0,this.color=new Qt,this.enable=!1,this.offset={x:0,y:0},this.color.value="#000"}load(t){t&&(void 0!==t.blur&&(this.blur=t.blur),this.color=Qt.create(this.color,t.color),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.offset&&(void 0!==t.offset.x&&(this.offset.x=t.offset.x),void 0!==t.offset.y&&(this.offset.y=t.offset.y)))}}const Hi="character",qi="char",Wi="image",Ni="images",Gi="polygon",ji="star";class $i{constructor(){this.options={},this.type="circle"}get character(){var t;return null!==(t=this.options[Hi])&&void 0!==t?t:this.options[qi]}set character(t){this.options[qi]=this.options[Hi]=t}get custom(){return this.options}set custom(t){this.options=t}get image(){var t;return null!==(t=this.options[Wi])&&void 0!==t?t:this.options[Ni]}set image(t){this.options[Ni]=this.options[Wi]=t}get images(){return this.image}set images(t){this.image=t}get polygon(){var t;return null!==(t=this.options[Gi])&&void 0!==t?t:this.options[ji]}set polygon(t){this.options[ji]=this.options[Gi]=t}get stroke(){return[]}set stroke(t){}load(t){var i,e,s;if(!t)return;const o=null!==(i=t.options)&&void 0!==i?i:t.custom;if(void 0!==o)for(const t in o){const i=o[t];i&&(this.options[t]=W(null!==(e=this.options[t])&&void 0!==e?e:{},i))}this.loadShape(t.character,Hi,qi,!0),this.loadShape(t.polygon,Gi,ji,!1),this.loadShape(null!==(s=t.image)&&void 0!==s?s:t.images,Wi,Ni,!0),void 0!==t.type&&(this.type=t.type)}loadShape(t,i,e,s){var o,n;if(!t)return;const a=t instanceof Array,r=a?[]:{},l=a!==this.options[i]instanceof Array,c=a!==this.options[e]instanceof Array;l&&(this.options[i]=r),c&&s&&(this.options[e]=r),this.options[i]=W(null!==(o=this.options[i])&&void 0!==o?o:r,t),this.options[e]&&!s||(this.options[e]=W(null!==(n=this.options[e])&&void 0!==n?n:r,t))}}class Xi extends Ai{constructor(){super(),this.destroy="none",this.enable=!1,this.speed=5,this.startValue="random",this.sync=!1}get size_min(){return this.minimumValue}set size_min(t){this.minimumValue=t}load(t){var i;super.load(t),t&&(void 0!==t.destroy&&(this.destroy=t.destroy),void 0!==t.enable&&(this.enable=t.enable),this.minimumValue=null!==(i=t.minimumValue)&&void 0!==i?i:t.size_min,void 0!==t.speed&&(this.speed=t.speed),void 0!==t.startValue&&(this.startValue=t.startValue),void 0!==t.sync&&(this.sync=t.sync))}}class Yi extends xi{constructor(){super(),this.animation=new Xi,this.random.minimumValue=1,this.value=3}get anim(){return this.animation}set anim(t){this.animation=t}load(t){var i;if(super.load(t),!t)return;const e=null!==(i=t.animation)&&void 0!==i?i:t.anim;void 0!==e&&(this.animation.load(e),this.value=y(this.value,this.animation.enable?this.animation.minimumValue:void 0))}}class Ji{constructor(){this.width=0}load(t){t&&(void 0!==t.color&&(this.color=yi.create(this.color,t.color)),void 0!==t.width&&(this.width=y(t.width)),void 0!==t.opacity&&(this.opacity=y(t.opacity)))}}class Zi extends xi{constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(t){super.load(t),t&&(void 0!==t.opacityRate&&(this.opacityRate=t.opacityRate),void 0!==t.sizeRate&&(this.sizeRate=t.sizeRate),void 0!==t.velocityRate&&(this.velocityRate=t.velocityRate))}}class Qi{constructor(t,i){this._engine=t,this._container=i,this.bounce=new zi,this.collisions=new Mi,this.color=new yi,this.color.value="#fff",this.groups={},this.move=new Ti,this.number=new Bi,this.opacity=new Fi,this.reduceDuplicates=!1,this.shadow=new Ui,this.shape=new $i,this.size=new Yi,this.stroke=new Ji,this.zIndex=new Zi}load(t){var i,e,s,o,n,a;if(!t)return;if(this.bounce.load(t.bounce),this.color.load(yi.create(this.color,t.color)),void 0!==t.groups)for(const e in t.groups){const s=t.groups[e];void 0!==s&&(this.groups[e]=W(null!==(i=this.groups[e])&&void 0!==i?i:{},s))}this.move.load(t.move),this.number.load(t.number),this.opacity.load(t.opacity),void 0!==t.reduceDuplicates&&(this.reduceDuplicates=t.reduceDuplicates),this.shape.load(t.shape),this.size.load(t.size),this.shadow.load(t.shadow),this.zIndex.load(t.zIndex);const r=null!==(s=null===(e=t.move)||void 0===e?void 0:e.collisions)&&void 0!==s?s:null===(o=t.move)||void 0===o?void 0:o.bounce;void 0!==r&&(this.collisions.enable=r),this.collisions.load(t.collisions),void 0!==t.interactivity&&(this.interactivity=W({},t.interactivity));const l=null!==(n=t.stroke)&&void 0!==n?n:null===(a=t.shape)||void 0===a?void 0:a.stroke;if(l&&(this.stroke=Z(l,(t=>{const i=new Ji;return i.load(t),i}))),this._container){const i=this._engine.plugins.updaters.get(this._container);if(i)for(const e of i)e.loadOptions&&e.loadOptions(this,t);const e=this._engine.plugins.interactors.get(this._container);if(e)for(const i of e)i.loadParticlesOptions&&i.loadParticlesOptions(this,t)}}}function Ki(t,...i){for(const e of i)t.load(e)}function te(t,i,...e){const s=new Qi(t,i);return Ki(s,...e),s}class ie{constructor(t,i){this._engine=t,this._container=i,this.autoPlay=!0,this.background=new Kt,this.backgroundMask=new ii,this.defaultThemes={},this.delay=0,this.fullScreen=new ei,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.interactivity=new hi(t,i),this.manualParticles=[],this.particles=te(this._engine,this._container),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.responsive=[],this.smooth=!1,this.style={},this.themes=[],this.zLayers=100}get backgroundMode(){return this.fullScreen}set backgroundMode(t){this.fullScreen.load(t)}get fps_limit(){return this.fpsLimit}set fps_limit(t){this.fpsLimit=t}get retina_detect(){return this.detectRetina}set retina_detect(t){this.detectRetina=t}load(t){var i,e,s,o,n;if(!t)return;void 0!==t.preset&&Z(t.preset,(t=>this._importPreset(t))),void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.delay&&(this.delay=y(t.delay));const a=null!==(i=t.detectRetina)&&void 0!==i?i:t.retina_detect;void 0!==a&&(this.detectRetina=a),void 0!==t.duration&&(this.duration=y(t.duration));const r=null!==(e=t.fpsLimit)&&void 0!==e?e:t.fps_limit;void 0!==r&&(this.fpsLimit=r),void 0!==t.pauseOnBlur&&(this.pauseOnBlur=t.pauseOnBlur),void 0!==t.pauseOnOutsideViewport&&(this.pauseOnOutsideViewport=t.pauseOnOutsideViewport),void 0!==t.zLayers&&(this.zLayers=t.zLayers),this.background.load(t.background);const l=null!==(s=t.fullScreen)&&void 0!==s?s:t.backgroundMode;"boolean"==typeof l?this.fullScreen.enable=l:this.fullScreen.load(l),this.backgroundMask.load(t.backgroundMask),this.interactivity.load(t.interactivity),void 0!==t.manualParticles&&(this.manualParticles=t.manualParticles.map((t=>{const i=new di;return i.load(t),i}))),this.particles.load(t.particles),this.style=W(this.style,t.style),this._engine.plugins.loadOptions(this,t),void 0!==t.smooth&&(this.smooth=t.smooth);const c=this._engine.plugins.interactors.get(this._container);if(c)for(const i of c)i.loadOptions&&i.loadOptions(this,t);if(void 0!==t.responsive)for(const i of t.responsive){const t=new ui;t.load(i),this.responsive.push(t)}if(this.responsive.sort(((t,i)=>t.maxWidth-i.maxWidth)),void 0!==t.themes)for(const i of t.themes){const t=this.themes.find((t=>t.name===i.name));if(t)t.load(i);else{const t=new vi;t.load(i),this.themes.push(t)}}this.defaultThemes.dark=null===(o=this._findDefaultTheme("dark"))||void 0===o?void 0:o.name,this.defaultThemes.light=null===(n=this._findDefaultTheme("light"))||void 0===n?void 0:n.name}setResponsive(t,i,e){this.load(e);const s=this.responsive.find((e=>"screen"===e.mode&&screen?e.maxWidth>screen.availWidth:e.maxWidth*i>t));return this.load(null==s?void 0:s.options),null==s?void 0:s.maxWidth}setTheme(t){if(t){const i=this.themes.find((i=>i.name===t));i&&this.load(i.options)}else{const t=D("(prefers-color-scheme: dark)"),i=t&&t.matches,e=this._findDefaultTheme(i?"dark":"light");e&&this.load(e.options)}}_findDefaultTheme(t){var i;return null!==(i=this.themes.find((i=>i.default.value&&i.default.mode===t)))&&void 0!==i?i:this.themes.find((t=>t.default.value&&"any"===t.default.mode))}_importPreset(t){this.load(this._engine.plugins.getPreset(t))}}class ee{constructor(t,i){this.container=i,this._engine=t,this._interactors=this._engine.plugins.getInteractors(this.container,!0),this._externalInteractors=[],this._particleInteractors=[]}async externalInteract(t){for(const i of this._externalInteractors)i.isEnabled()&&await i.interact(t)}handleClickMode(t){for(const i of this._externalInteractors)i.handleClickMode&&i.handleClickMode(t)}init(){this._externalInteractors=[],this._particleInteractors=[];for(const t of this._interactors){switch(t.type){case"external":this._externalInteractors.push(t);break;case"particles":this._particleInteractors.push(t)}t.init()}}async particlesInteract(t,i){for(const e of this._externalInteractors)e.clear(t,i);for(const e of this._particleInteractors)e.isEnabled(t)&&await e.interact(t,i)}async reset(t){for(const i of this._externalInteractors)i.isEnabled()&&await i.reset(t);for(const i of this._particleInteractors)i.isEnabled(t)&&await i.reset(t)}}const se=t=>{L(t.outMode,t.checkModes)&&(t.coord>t.maxCoord-2*t.radius?t.setCb(-t.radius):t.coord<2*t.radius&&t.setCb(t.radius))};class oe{constructor(t,i,e,s,o,n){this.container=e,this._engine=t,this.init(i,s,o,n)}destroy(t){var i;if(!this.unbreakable&&!this.destroyed){this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;for(const[,i]of this.container.plugins)i.particleDestroyed&&i.particleDestroyed(this,t);for(const i of this.container.particles.updaters)i.particleDestroyed&&i.particleDestroyed(this,t);null===(i=this.pathGenerator)||void 0===i||i.reset(this)}}draw(t){const i=this.container;for(const[,e]of i.plugins)i.canvas.drawParticlePlugin(e,this,t);i.canvas.drawParticle(this,t)}getFillColor(){var t;return this._getRollColor(null!==(t=this.bubble.color)&&void 0!==t?t:xt(this.color))}getMass(){return this.getRadius()**2*Math.PI/2}getPosition(){return{x:this.position.x+this.offset.x,y:this.position.y+this.offset.y,z:this.position.z}}getRadius(){var t;return null!==(t=this.bubble.radius)&&void 0!==t?t:this.size.value}getStrokeColor(){var t;return this._getRollColor(null!==(t=this.bubble.color)&&void 0!==t?t:xt(this.strokeColor))}init(t,i,e,s){var n,a,r,l,c,u,y,w,b;const _=this.container,z=this._engine;this.id=t,this.group=s,this.fill=!0,this.pathRotation=!1,this.close=!0,this.lastPathTime=0,this.destroyed=!1,this.unbreakable=!1,this.rotation=0,this.misplaced=!1,this.retina={maxDistance:{}},this.outType="normal",this.ignoresResizeRatio=!0;const M=_.retina.pixelRatio,C=_.actualOptions,P=te(this._engine,_,C.particles),k=P.shape.type,{reduceDuplicates:S}=P;this.shape=Q(k,this.id,S);const O=P.shape;if(e&&e.shape&&e.shape.type){const t=Q(e.shape.type,this.id,S);t&&(this.shape=t,O.load(e.shape))}this.shapeData=this._loadShapeData(O,S),P.load(e),P.load(null===(n=this.shapeData)||void 0===n?void 0:n.particles),this.interactivity=new hi(z,_),this.interactivity.load(_.actualOptions.interactivity),this.interactivity.load(P.interactivity),this.fill=null!==(r=null===(a=this.shapeData)||void 0===a?void 0:a.fill)&&void 0!==r?r:this.fill,this.close=null!==(c=null===(l=this.shapeData)||void 0===l?void 0:l.close)&&void 0!==c?c:this.close,this.options=P;const I=this.options.move.path;this.pathDelay=1e3*g(I.delay),I.generator&&(this.pathGenerator=this._engine.plugins.getPathGenerator(I.generator),this.pathGenerator&&_.addPath(I.generator,this.pathGenerator)&&this.pathGenerator.init(_));const E=v(this.options.zIndex.value);_.retina.initParticle(this);const R=this.options.size,D=R.value,T=R.animation;if(this.size={enable:R.animation.enable,value:v(R.value)*_.retina.pixelRatio,max:f(D)*M,min:m(D)*M,loops:0,maxLoops:v(R.animation.count)},T.enable)switch(this.size.status="increasing",this.size.decay=1-v(T.decay),T.startValue){case"min":this.size.value=this.size.min,this.size.status="increasing";break;case"random":this.size.value=p(this.size),this.size.status=h()>=.5?"increasing":"decreasing";break;default:this.size.value=this.size.max,this.size.status="decreasing"}this.size.initialValue=this.size.value,this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this.position=this._calcPosition(_,i,d(E,0,_.zLayers)),this.initialPosition=this.position.copy();const A=_.canvas.size,L=Object.assign({},this.options.move.center),F="percent"===L.mode;switch(this.moveCenter={x:L.x*(F?A.width/100:1),y:L.y*(F?A.height/100:1),radius:null!==(u=this.options.move.center.radius)&&void 0!==u?u:0,mode:null!==(y=this.options.move.center.mode)&&void 0!==y?y:"percent"},this.direction=x(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case"inside":this.outType="inside";break;case"outside":this.outType="outside"}this.initialVelocity=this._calculateVelocity(),this.velocity=this.initialVelocity.copy(),this.moveDecay=1-v(this.options.move.decay),this.offset=o.origin;const V=_.particles;V.needsSort=V.needsSort||V.lastZIndex<this.position.z,V.lastZIndex=this.position.z,this.zIndexFactor=this.position.z/_.zLayers,this.sides=24;let B=_.drawers.get(this.shape);B||(B=this._engine.plugins.getShapeDrawer(this.shape),B&&_.drawers.set(this.shape,B)),(null==B?void 0:B.loadShape)&&(null==B||B.loadShape(this));const U=null==B?void 0:B.getSidesCount;U&&(this.sides=U(this)),this.spawning=!1,this.shadowColor=at(this.options.shadow.color);for(const t of _.particles.updaters)t.init(this);for(const t of _.particles.movers)null===(w=t.init)||void 0===w||w.call(t,this);(null==B?void 0:B.particleInit)&&B.particleInit(_,this);for(const[,t]of _.plugins)null===(b=t.particleCreated)||void 0===b||b.call(t,this)}isInsideCanvas(){const t=this.getRadius(),i=this.container.canvas.size;return this.position.x>=-t&&this.position.y>=-t&&this.position.y<=i.height+t&&this.position.x<=i.width+t}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){var t;for(const i of this.container.particles.updaters)null===(t=i.reset)||void 0===t||t.call(i,this)}_calcPosition(t,i,e,o=0){var n,a,r,l;for(const[,o]of t.plugins){const t=void 0!==o.particlePosition?o.particlePosition(i,this):void 0;if(void 0!==t)return s.create(t.x,t.y,e)}const c=k({size:t.canvas.size,position:i}),h=s.create(c.x,c.y,e),d=this.getRadius(),u=this.options.move.outModes,p=i=>{se({outMode:i,checkModes:["bounce","bounce-horizontal"],coord:h.x,maxCoord:t.canvas.size.width,setCb:t=>h.x+=t,radius:d})},v=i=>{se({outMode:i,checkModes:["bounce","bounce-vertical"],coord:h.y,maxCoord:t.canvas.size.height,setCb:t=>h.y+=t,radius:d})};return p(null!==(n=u.left)&&void 0!==n?n:u.default),p(null!==(a=u.right)&&void 0!==a?a:u.default),v(null!==(r=u.top)&&void 0!==r?r:u.default),v(null!==(l=u.bottom)&&void 0!==l?l:u.default),this._checkOverlap(h,o)?this._calcPosition(t,void 0,e,o+1):h}_calculateVelocity(){const t=_(this.direction).copy(),i=this.options.move;if("inside"===i.direction||"outside"===i.direction)return t;const e=Math.PI/180*v(i.angle.value),s=Math.PI/180*v(i.angle.offset),o={left:s-e/2,right:s+e/2};return i.straight||(t.angle+=p(y(o.left,o.right))),i.random&&"number"==typeof i.speed&&(t.length*=h()),t}_checkOverlap(t,i=0){const e=this.options.collisions,s=this.getRadius();if(!e.enable)return!1;const o=e.overlap;if(o.enable)return!1;const n=o.retries;if(n>=0&&i>n)throw new Error("Particle is overlapping and can't be placed");let a=!1;for(const i of this.container.particles.array)if(b(t,i.position)<s+i.getRadius()){a=!0;break}return a}_getRollColor(t){var i;if(!t||!this.roll||!this.backColor&&!this.roll.alter)return t;const e=this.roll.horizontal&&this.roll.vertical?2:1,s=this.roll.horizontal?Math.PI/2:0;return Math.floor(((null!==(i=this.roll.angle)&&void 0!==i?i:0)+s)/(Math.PI/e))%2?this.backColor?this.backColor:this.roll.alter?Tt(t,this.roll.alter.type,this.roll.alter.value):t:t}_loadShapeData(t,i){const e=t.options[this.shape];if(e)return W({},Q(e,this.id,i))}}class ne{constructor(t,i){this.position=t,this.particle=i}}class ae{constructor(t,i){this.position={x:t,y:i}}}class re extends ae{constructor(t,i,e){super(t,i),this.radius=e}contains(t){return b(t,this.position)<=this.radius}intersects(t){const i=t,e=t,s=this.position,o=t.position,n=Math.abs(o.x-s.x),a=Math.abs(o.y-s.y),r=this.radius;if(void 0!==e.radius){return r+e.radius>Math.sqrt(n**2+a**2)}if(void 0!==i.size){const t=i.size.width,e=i.size.height;return Math.pow(n-t,2)+Math.pow(a-e,2)<=r**2||n<=r+t&&a<=r+e||n<=t||a<=e}return!1}}class le extends ae{constructor(t,i,e,s){super(t,i),this.size={height:s,width:e}}contains(t){const i=this.size.width,e=this.size.height,s=this.position;return t.x>=s.x&&t.x<=s.x+i&&t.y>=s.y&&t.y<=s.y+e}intersects(t){t instanceof re&&t.intersects(this);const i=this.size.width,e=this.size.height,s=this.position,o=t.position,n=t instanceof le?t.size:{width:0,height:0},a=n.width,r=n.height;return o.x<s.x+i&&o.x+a>s.x&&o.y<s.y+e&&o.y+r>s.y}}class ce{constructor(t,i){this.rectangle=t,this.capacity=i,this._points=[],this._divided=!1}insert(t){var i,e,s,o,n;return!!this.rectangle.contains(t.position)&&(this._points.length<this.capacity?(this._points.push(t),!0):(this._divided||this.subdivide(),null!==(n=(null===(i=this._NE)||void 0===i?void 0:i.insert(t))||(null===(e=this._NW)||void 0===e?void 0:e.insert(t))||(null===(s=this._SE)||void 0===s?void 0:s.insert(t))||(null===(o=this._SW)||void 0===o?void 0:o.insert(t)))&&void 0!==n&&n))}query(t,i,e){var s,o,n,a;const r=null!=e?e:[];if(!t.intersects(this.rectangle))return[];for(const e of this._points)!t.contains(e.position)&&b(t.position,e.position)>e.particle.getRadius()&&(!i||i(e.particle))||r.push(e.particle);return this._divided&&(null===(s=this._NE)||void 0===s||s.query(t,i,r),null===(o=this._NW)||void 0===o||o.query(t,i,r),null===(n=this._SE)||void 0===n||n.query(t,i,r),null===(a=this._SW)||void 0===a||a.query(t,i,r)),r}queryCircle(t,i,e){return this.query(new re(t.x,t.y,i),e)}queryRectangle(t,i,e){return this.query(new le(t.x,t.y,i.width,i.height),e)}subdivide(){const t=this.rectangle.position.x,i=this.rectangle.position.y,e=this.rectangle.size.width,s=this.rectangle.size.height,o=this.capacity;this._NE=new ce(new le(t,i,e/2,s/2),o),this._NW=new ce(new le(t+e/2,i,e/2,s/2),o),this._SE=new ce(new le(t,i+s/2,e/2,s/2),o),this._SW=new ce(new le(t+e/2,i+s/2,e/2,s/2),o),this._divided=!0}}class he{constructor(t,i){this.container=i,this._engine=t,this.nextId=0,this.array=[],this.zArray=[],this.pool=[],this.limit=0,this.needsSort=!1,this.lastZIndex=0,this.interactionManager=new ee(this._engine,i);const e=this.container.canvas.size;this.quadTree=new ce(new le(-e.width/4,-e.height/4,3*e.width/2,3*e.height/2),4),this.movers=this._engine.plugins.getMovers(i,!0),this.updaters=this._engine.plugins.getUpdaters(i,!0)}get count(){return this.array.length}addManualParticles(){const t=this.container,i=t.actualOptions;for(const e of i.manualParticles)this.addParticle(M({size:t.canvas.size,position:e.position}),e.options)}addParticle(t,i,e,s){const o=this.container.actualOptions.particles.number.limit;if(o>0){const t=this.count+1-o;t>0&&this.removeQuantity(t)}return this._pushParticle(t,i,e,s)}clear(){this.array=[],this.zArray=[]}destroy(){this.array=[],this.zArray=[],this.movers=[],this.updaters=[]}async draw(t){const i=this.container,e=this.container.canvas.size;this.quadTree=new ce(new le(-e.width/4,-e.height/4,3*e.width/2,3*e.height/2),4),i.canvas.clear(),await this.update(t),this.needsSort&&(this.zArray.sort(((t,i)=>i.position.z-t.position.z||t.id-i.id)),this.lastZIndex=this.zArray[this.zArray.length-1].position.z,this.needsSort=!1);for(const[,e]of i.plugins)i.canvas.drawPlugin(e,t);for(const i of this.zArray)i.draw(t)}handleClickMode(t){this.interactionManager.handleClickMode(t)}init(){var t;const i=this.container,e=i.actualOptions;this.lastZIndex=0,this.needsSort=!1;let s=!1;this.updaters=this._engine.plugins.getUpdaters(i,!0),this.interactionManager.init();for(const[,t]of i.plugins)if(void 0!==t.particlesInitialization&&(s=t.particlesInitialization()),s)break;this.interactionManager.init();for(const[,t]of i.pathGenerators)t.init(i);if(this.addManualParticles(),!s){for(const i in e.particles.groups){const s=e.particles.groups[i];for(let o=this.count,n=0;n<(null===(t=s.number)||void 0===t?void 0:t.value)&&o<e.particles.number.value;o++,n++)this.addParticle(void 0,s,i)}for(let t=this.count;t<e.particles.number.value;t++)this.addParticle()}}push(t,i,e,s){this.pushing=!0;for(let o=0;o<t;o++)this.addParticle(null==i?void 0:i.position,e,s);this.pushing=!1}async redraw(){this.clear(),this.init(),await this.draw({value:0,factor:0})}remove(t,i,e){this.removeAt(this.array.indexOf(t),void 0,i,e)}removeAt(t,i=1,e,s){if(t<0||t>this.count)return;let o=0;for(let n=t;o<i&&n<this.count;n++){const t=this.array[n];if(!t||t.group!==e)continue;t.destroy(s),this.array.splice(n--,1);const i=this.zArray.indexOf(t);this.zArray.splice(i,1),this.pool.push(t),o++,this._engine.dispatchEvent("particleRemoved",{container:this.container,data:{particle:t}})}}removeQuantity(t,i){this.removeAt(0,t,i)}setDensity(){const t=this.container.actualOptions;for(const i in t.particles.groups)this._applyDensity(t.particles.groups[i],0,i);this._applyDensity(t.particles,t.manualParticles.length)}async update(t){var i,e;const s=this.container,o=[];for(const[,t]of s.pathGenerators)t.update();for(const[,e]of s.plugins)null===(i=e.update)||void 0===i||i.call(e,t);for(const i of this.array){const n=s.canvas.resizeFactor;n&&!i.ignoresResizeRatio&&(i.position.x*=n.width,i.position.y*=n.height,i.initialPosition.x*=n.width,i.initialPosition.y*=n.height),i.ignoresResizeRatio=!1,await this.interactionManager.reset(i);for(const[,s]of this.container.plugins){if(i.destroyed)break;null===(e=s.particleUpdate)||void 0===e||e.call(s,i,t)}for(const e of this.movers)e.isEnabled(i)&&e.move(i,t);i.destroyed?o.push(i):this.quadTree.insert(new ne(i.getPosition(),i))}for(const t of o)this.remove(t);await this.interactionManager.externalInteract(t);for(const i of this.array){for(const e of this.updaters)e.update(i,t);i.destroyed||i.spawning||await this.interactionManager.particlesInteract(i,t)}delete s.canvas.resizeFactor}_applyDensity(t,i,e){var s;if(!(null===(s=t.number.density)||void 0===s?void 0:s.enable))return;const o=t.number,n=this._initDensityFactor(o.density),a=o.value,r=o.limit>0?o.limit:a,l=Math.min(a,r)*n+i,c=Math.min(this.count,this.array.filter((t=>t.group===e)).length);this.limit=o.limit*n,c<l?this.push(Math.abs(l-c),void 0,t,e):c>l&&this.removeQuantity(c-l,e)}_initDensityFactor(t){const i=this.container;if(!i.canvas.element||!t.enable)return 1;const e=i.canvas.element,s=i.retina.pixelRatio;return e.width*e.height/(t.factor*s**2*t.area)}_pushParticle(t,i,e,s){try{let o=this.pool.pop();o?o.init(this.nextId,t,i,e):o=new oe(this._engine,this.nextId,this.container,t,i,e);let n=!0;if(s&&(n=s(o)),!n)return;return this.array.push(o),this.zArray.push(o),this.nextId++,this._engine.dispatchEvent("particleAdded",{container:this.container,data:{particle:o}}),o}catch(t){return void console.warn(`error adding particle: ${t}`)}}}class de{constructor(t){this.container=t}init(){const t=this.container,i=t.actualOptions;this.pixelRatio=!i.detectRetina||E()?1:window.devicePixelRatio,this.reduceFactor=1;const e=this.pixelRatio;if(t.canvas.element){const i=t.canvas.element;t.canvas.size.width=i.offsetWidth*e,t.canvas.size.height=i.offsetHeight*e}const s=i.particles;this.attractDistance=v(s.move.attract.distance)*e,this.sizeAnimationSpeed=v(s.size.animation.speed)*e,this.maxSpeed=v(s.move.gravity.maxSpeed)*e}initParticle(t){const i=t.options,e=this.pixelRatio,s=i.move.distance,o=t.retina;o.attractDistance=v(i.move.attract.distance)*e,o.moveDrift=v(i.move.drift)*e,o.moveSpeed=v(i.move.speed)*e,o.sizeAnimationSpeed=v(i.size.animation.speed)*e;const n=o.maxDistance;n.horizontal=void 0!==s.horizontal?s.horizontal*e:void 0,n.vertical=void 0!==s.vertical?s.vertical*e:void 0,o.maxSpeed=v(i.move.gravity.maxSpeed)*e}}function ue(t){return t&&!t.destroyed}function pe(t,i,...e){const s=new ie(t,i);return Ki(s,...e),s}const ve={generate:t=>{const i=t.velocity.copy();return i.angle+=i.length*Math.PI/180,i},init:()=>{},update:()=>{},reset:()=>{}};class me{constructor(t,i,e){this.id=i,this._engine=t,this.fpsLimit=120,this.smooth=!1,this._delay=0,this.duration=0,this.lifeTime=0,this._firstStart=!0,this.started=!1,this.destroyed=!1,this._paused=!0,this.lastFrameTime=0,this.zLayers=100,this.pageHidden=!1,this._sourceOptions=e,this._initialSourceOptions=e,this.retina=new de(this),this.canvas=new Xt(this),this.particles=new he(this._engine,this),this.frameManager=new Zt(this),this.pathGenerators=new Map,this.interactivity={mouse:{clicking:!1,inside:!1}},this.plugins=new Map,this.drawers=new Map,this._options=pe(this._engine,this),this.actualOptions=pe(this._engine,this),this._eventListeners=new Jt(this),"undefined"!=typeof IntersectionObserver&&IntersectionObserver&&(this._intersectionObserver=new IntersectionObserver((t=>this._intersectionManager(t)))),this._engine.dispatchEvent("containerBuilt",{container:this})}get options(){return this._options}get sourceOptions(){return this._sourceOptions}addClickHandler(t){if(!ue(this))return;const i=this.interactivity.element;if(!i)return;const e=(i,e,s)=>{if(!ue(this))return;const o=this.retina.pixelRatio,n={x:e.x*o,y:e.y*o},a=this.particles.quadTree.queryCircle(n,s*o);t(i,a)};let s=!1,o=!1;i.addEventListener("click",(t=>{if(!ue(this))return;const i=t,s={x:i.offsetX||i.clientX,y:i.offsetY||i.clientY};e(t,s,1)})),i.addEventListener("touchstart",(()=>{ue(this)&&(s=!0,o=!1)})),i.addEventListener("touchmove",(()=>{ue(this)&&(o=!0)})),i.addEventListener("touchend",(t=>{if(ue(this)){if(s&&!o){const i=t;let s=i.touches[i.touches.length-1];if(!s&&(s=i.changedTouches[i.changedTouches.length-1],!s))return;const o=this.canvas.element,n=o?o.getBoundingClientRect():void 0,a={x:s.clientX-(n?n.left:0),y:s.clientY-(n?n.top:0)};e(t,a,Math.max(s.radiusX,s.radiusY))}s=!1,o=!1}})),i.addEventListener("touchcancel",(()=>{ue(this)&&(s=!1,o=!1)}))}addPath(t,i,e=!1){return!(!ue(this)||!e&&this.pathGenerators.has(t))&&(this.pathGenerators.set(t,null!=i?i:ve),!0)}destroy(){if(!ue(this))return;this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,t]of this.drawers)t.destroy&&t.destroy(this);for(const t of this.drawers.keys())this.drawers.delete(t);this._engine.plugins.destroy(this),this.destroyed=!0;const t=this._engine.dom(),i=t.findIndex((t=>t===this));i>=0&&t.splice(i,1),this._engine.dispatchEvent("containerDestroyed",{container:this})}draw(t){if(!ue(this))return;let i=t;this._drawAnimationFrame=T()((async t=>{i&&(this.lastFrameTime=void 0,i=!1),await this.frameManager.nextFrame(t)}))}exportConfiguration(){return JSON.stringify(this.actualOptions,((t,i)=>{if("_engine"!==t&&"_container"!==t)return i}),2)}exportImage(t,i,e){const s=this.canvas.element;s&&s.toBlob(t,null!=i?i:"image/png",e)}exportImg(t){this.exportImage(t)}getAnimationStatus(){return!this._paused&&!this.pageHidden&&ue(this)}handleClickMode(t){if(ue(this)){this.particles.handleClickMode(t);for(const[,i]of this.plugins)i.handleClickMode&&i.handleClickMode(t)}}async init(){if(!ue(this))return;const t=this._engine.plugins.getSupportedShapes();for(const i of t){const t=this._engine.plugins.getShapeDrawer(i);t&&this.drawers.set(i,t)}this._options=pe(this._engine,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=pe(this._engine,this,this._options);const i=this._engine.plugins.getAvailablePlugins(this);for(const[t,e]of i)this.plugins.set(t,e);this.retina.init(),await this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize(),this.zLayers=this.actualOptions.zLayers,this.duration=1e3*v(this.actualOptions.duration),this._delay=1e3*v(this.actualOptions.delay),this.lifeTime=0,this.fpsLimit=this.actualOptions.fpsLimit>0?this.actualOptions.fpsLimit:120,this.smooth=this.actualOptions.smooth;for(const[,t]of this.drawers)t.init&&await t.init(this);for(const[,t]of this.plugins)t.init&&await t.init();this._engine.dispatchEvent("containerInit",{container:this}),this.particles.init(),this.particles.setDensity();for(const[,t]of this.plugins)t.particlesSetup&&t.particlesSetup();this._engine.dispatchEvent("particlesSetup",{container:this})}async loadTheme(t){ue(this)&&(this._currentTheme=t,await this.refresh())}pause(){if(ue(this)&&(void 0!==this._drawAnimationFrame&&(A()(this._drawAnimationFrame),delete this._drawAnimationFrame),!this._paused)){for(const[,t]of this.plugins)t.pause&&t.pause();this.pageHidden||(this._paused=!0),this._engine.dispatchEvent("containerPaused",{container:this})}}play(t){if(!ue(this))return;const i=this._paused||t;if(!this._firstStart||this.actualOptions.autoPlay){if(this._paused&&(this._paused=!1),i)for(const[,t]of this.plugins)t.play&&t.play();this._engine.dispatchEvent("containerPlay",{container:this}),this.draw(i||!1)}else this._firstStart=!1}async refresh(){if(ue(this))return this.stop(),this.start()}async reset(){if(ue(this))return this._options=pe(this._engine,this),this.refresh()}setNoise(t,i,e){ue(this)&&this.setPath(t,i,e)}setPath(t,i,e){if(!t||!ue(this))return;const s=Object.assign({},ve);if("function"==typeof t)s.generate=t,i&&(s.init=i),e&&(s.update=e);else{const i=s;s.generate=t.generate||i.generate,s.init=t.init||i.init,s.update=t.update||i.update}this.addPath("default",s,!0)}async start(){ue(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise((t=>{this._delayTimeout=setTimeout((async()=>{this._eventListeners.addListeners(),this.interactivity.element instanceof HTMLElement&&this._intersectionObserver&&this._intersectionObserver.observe(this.interactivity.element);for(const[,t]of this.plugins)t.start&&await t.start();this._engine.dispatchEvent("containerStarted",{container:this}),this.play(),t()}),this._delay)})))}stop(){if(ue(this)&&this.started){this._delayTimeout&&(clearTimeout(this._delayTimeout),delete this._delayTimeout),this._firstStart=!0,this.started=!1,this._eventListeners.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop(),this.interactivity.element instanceof HTMLElement&&this._intersectionObserver&&this._intersectionObserver.unobserve(this.interactivity.element);for(const[,t]of this.plugins)t.stop&&t.stop();for(const t of this.plugins.keys())this.plugins.delete(t);this._sourceOptions=this._options,this._engine.dispatchEvent("containerStopped",{container:this})}}updateActualOptions(){this.actualOptions.responsive=[];const t=this.actualOptions.setResponsive(this.canvas.size.width,this.retina.pixelRatio,this._options);return this.actualOptions.setTheme(this._currentTheme),this.responsiveMaxWidth!==t&&(this.responsiveMaxWidth=t,!0)}_intersectionManager(t){if(ue(this)&&this.actualOptions.pauseOnOutsideViewport)for(const i of t)i.target===this.interactivity.element&&(i.isIntersecting?this.play:this.pause)()}}class fe{constructor(t){this._engine=t}load(t,i,e){const s={index:e,remote:!1};return"string"==typeof t?s.tagId=t:s.options=t,"number"==typeof i?s.index=i:s.options=null!=i?i:s.options,this.loadOptions(s)}async loadJSON(t,i,e){let s,o;return"number"==typeof i||void 0===i?s=t:(o=t,s=i),this.loadRemoteOptions({tagId:o,url:s,index:e,remote:!0})}async loadOptions(t){var i,e,s;const o=null!==(i=t.tagId)&&void 0!==i?i:`tsparticles${Math.floor(1e4*h())}`,{index:n,url:a,remote:r}=t,l=r?await async function(t,i){const e=Q(t,i);if(!e)return;const s=await fetch(e);if(s.ok)return s.json();console.error(`tsParticles - Error ${s.status} while retrieving config file`)}(a,n):t.options;let c=null!==(e=t.element)&&void 0!==e?e:document.getElementById(o);c||(c=document.createElement("div"),c.id=o,null===(s=document.querySelector("body"))||void 0===s||s.append(c));const d=Q(l,n),u=this._engine.dom(),p=u.findIndex((t=>t.id===o));if(p>=0){const t=this._engine.domItem(p);t&&!t.destroyed&&(t.destroy(),u.splice(p,1))}let v;if("canvas"===c.tagName.toLowerCase())v=c,v.dataset[At]="false";else{const t=c.getElementsByTagName("canvas");t.length?(v=t[0],v.dataset[At]="false"):(v=document.createElement("canvas"),v.dataset[At]="true",c.appendChild(v))}v.style.width||(v.style.width="100%"),v.style.height||(v.style.height="100%");const m=new me(this._engine,o,d);return p>=0?u.splice(p,0,m):u.push(m),m.canvas.loadCanvas(v),await m.start(),m}async loadRemoteOptions(t){return this.loadOptions(t)}async set(t,i,e,s){const o={index:s,remote:!1};return"string"==typeof t?o.tagId=t:o.element=t,i instanceof HTMLElement?o.element=i:o.options=i,"number"==typeof e?o.index=e:o.options=null!=e?e:o.options,this.loadOptions(o)}async setJSON(t,i,e,s){let o,n,a,r;return t instanceof HTMLElement?(r=t,o=i,a=e):(n=t,r=i,o=e,a=s),this.loadRemoteOptions({tagId:n,url:o,index:a,element:r,remote:!0})}}function ye(t,i,e,s=!1){let o=i.get(t);return o&&!s||(o=[...e.values()].map((i=>i(t))),i.set(t,o)),o}class ge{constructor(t){this._engine=t,this.plugins=[],this._initializers={interactors:new Map,movers:new Map,updaters:new Map},this.interactors=new Map,this.movers=new Map,this.updaters=new Map,this.presets=new Map,this.drawers=new Map,this.pathGenerators=new Map}addInteractor(t,i){this._initializers.interactors.set(t,i)}addParticleMover(t,i){this._initializers.movers.set(t,i)}addParticleUpdater(t,i){this._initializers.updaters.set(t,i)}addPathGenerator(t,i){this.getPathGenerator(t)||this.pathGenerators.set(t,i)}addPlugin(t){this.getPlugin(t.id)||this.plugins.push(t)}addPreset(t,i,e=!1){!e&&this.getPreset(t)||this.presets.set(t,i)}addShapeDrawer(t,i){Z(t,(t=>{this.getShapeDrawer(t)||this.drawers.set(t,i)}))}destroy(t){this.updaters.delete(t),this.movers.delete(t),this.interactors.delete(t)}getAvailablePlugins(t){const i=new Map;for(const e of this.plugins)e.needsPlugin(t.actualOptions)&&i.set(e.id,e.getPlugin(t));return i}getInteractors(t,i=!1){return ye(t,this.interactors,this._initializers.interactors,i)}getMovers(t,i=!1){return ye(t,this.movers,this._initializers.movers,i)}getPathGenerator(t){return this.pathGenerators.get(t)}getPlugin(t){return this.plugins.find((i=>i.id===t))}getPreset(t){return this.presets.get(t)}getShapeDrawer(t){return this.drawers.get(t)}getSupportedShapes(){return this.drawers.keys()}getUpdaters(t,i=!1){return ye(t,this.updaters,this._initializers.updaters,i)}loadOptions(t,i){for(const e of this.plugins)e.loadOptions(t,i)}loadParticlesOptions(t,i,...e){const s=this.updaters.get(t);if(s)for(const t of s)t.loadOptions&&t.loadOptions(i,...e)}}class we{constructor(){this.key="hsl",this.stringPrefix="hsl"}handleColor(t){var i;const e=null!==(i=t.value.hsl)&&void 0!==i?i:t.value;if(void 0!==e.h&&void 0!==e.s&&void 0!==e.l)return pt(e)}handleRangeColor(t){var i;const e=null!==(i=t.value.hsl)&&void 0!==i?i:t.value;if(void 0!==e.h&&void 0!==e.l)return pt({h:v(e.h),l:v(e.l),s:v(e.s)})}parseString(t){if(!t.startsWith("hsl"))return;const i=/hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.%]+)\s*)?\)/i.exec(t);return i?vt({a:i.length>4?O(i[5]):1,h:parseInt(i[1],10),l:parseInt(i[3],10),s:parseInt(i[2],10)}):void 0}}class be{constructor(){this.key="rgb",this.stringPrefix="rgb"}handleColor(t){var i;const e=null!==(i=t.value.rgb)&&void 0!==i?i:t.value;if(void 0!==e.r)return e}handleRangeColor(t){var i;const e=null!==(i=t.value.rgb)&&void 0!==i?i:t.value;if(void 0!==e.r)return{r:v(e.r),g:v(e.g),b:v(e.b)}}parseString(t){if(!t.startsWith(this.stringPrefix))return;const i=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([\d.%]+)\s*)?\)/i.exec(t);return i?{a:i.length>4?O(i[5]):1,b:parseInt(i[3],10),g:parseInt(i[2],10),r:parseInt(i[1],10)}:void 0}}class xe{constructor(t){this.container=t,this.type="external"}}class _e{constructor(t){this.container=t,this.type="particles"}}const ze=new be,Me=new we;st(ze),st(Me);const Ce=new class{constructor(){this._domArray=[],this._eventDispatcher=new e,this._initialized=!1,this._loader=new fe(this),this.plugins=new ge(this)}get version(){return"2.9.3"}addEventListener(t,i){this._eventDispatcher.addEventListener(t,i)}async addInteractor(t,i){this.plugins.addInteractor(t,i),await this.refresh()}async addMover(t,i){this.plugins.addParticleMover(t,i),await this.refresh()}async addParticleUpdater(t,i){this.plugins.addParticleUpdater(t,i),await this.refresh()}async addPathGenerator(t,i){this.plugins.addPathGenerator(t,i),await this.refresh()}async addPlugin(t){this.plugins.addPlugin(t),await this.refresh()}async addPreset(t,i,e=!1){this.plugins.addPreset(t,i,e),await this.refresh()}async addShape(t,i,e,s,o){let n;n="function"==typeof i?{afterEffect:s,destroy:o,draw:i,init:e}:i,this.plugins.addShapeDrawer(t,n),await this.refresh()}dispatchEvent(t,i){this._eventDispatcher.dispatchEvent(t,i)}dom(){return this._domArray}domItem(t){const i=this.dom(),e=i[t];if(e&&!e.destroyed)return e;i.splice(t,1)}init(){this._initialized||(this._initialized=!0)}async load(t,i){return this._loader.load(t,i)}async loadFromArray(t,i,e){return this._loader.load(t,i,e)}async loadJSON(t,i,e){return this._loader.loadJSON(t,i,e)}async refresh(){for(const t of this.dom())await t.refresh()}removeEventListener(t,i){this._eventDispatcher.removeEventListener(t,i)}async set(t,i,e){return this._loader.set(t,i,e)}async setJSON(t,i,e,s){return this._loader.setJSON(t,i,e,s)}setOnClickHandler(t){const i=this.dom();if(!i.length)throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");for(const e of i)e.addClickHandler(t)}};Ce.init();class Pe{constructor(){this.brightness={min:-30,max:30},this.colors=["#ff595e","#ffca3a","#8ac926","#1982c4","#6a4c93"],this.gravity=5,this.minHeight={min:10,max:30},this.rate=20,this.saturation={min:-30,max:30},this.sounds=!0,this.speed={min:5,max:15},this.splitCount={min:75,max:150}}load(t){t&&(void 0!==t.colors&&(t.colors instanceof Array?this.colors=[...t.colors]:this.colors=t.colors),void 0!==t.brightness&&(this.brightness=y(t.brightness)),void 0!==t.gravity&&(this.gravity=y(t.gravity)),void 0!==t.minHeight&&(this.minHeight=y(t.minHeight)),void 0!==t.rate&&(this.rate=y(t.rate)),void 0!==t.saturation&&(this.saturation=y(t.saturation)),void 0!==t.sounds&&(this.sounds=t.sounds),void 0!==t.speed&&(this.speed=y(t.speed)),void 0!==t.splitCount&&(this.splitCount=y(t.splitCount)))}}class ke{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=y(t.speed)),void 0!==t.decay&&(this.decay=y(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class Se extends xi{constructor(){super(),this.animation=new ke,this.direction="clockwise",this.path=!1,this.value=0}load(t){t&&(super.load(t),void 0!==t.direction&&(this.direction=t.direction),this.animation.load(t.animation),void 0!==t.path&&(this.path=t.path))}}class Oe{constructor(t){this.container=t}init(t){const i=t.options.rotate;if(!i)return;t.rotate={enable:i.animation.enable,value:v(i.value)*Math.PI/180},t.pathRotation=i.path;let e=i.direction;if("random"===e){e=Math.floor(2*h())>0?"counter-clockwise":"clockwise"}switch(e){case"counter-clockwise":case"counterClockwise":t.rotate.status="decreasing";break;case"clockwise":t.rotate.status="increasing"}const s=i.animation;s.enable&&(t.rotate.decay=1-v(s.decay),t.rotate.velocity=v(s.speed)/360*this.container.retina.reduceFactor,s.sync||(t.rotate.velocity*=h())),t.rotation=t.rotate.value}isEnabled(t){const i=t.options.rotate;return!!i&&(!t.destroyed&&!t.spawning&&i.animation.enable&&!i.path)}loadOptions(t,...i){t.rotate||(t.rotate=new Se);for(const e of i)t.rotate.load(null==e?void 0:e.rotate)}update(t,i){var e,s;this.isEnabled(t)&&(!function(t,i){var e,s;const o=t.rotate,n=t.options.rotate;if(!o||!n)return;const a=n.animation,r=(null!==(e=o.velocity)&&void 0!==e?e:0)*i.factor,l=2*Math.PI,c=null!==(s=o.decay)&&void 0!==s?s:1;a.enable&&("increasing"===o.status?(o.value+=r,o.value>l&&(o.value-=l)):(o.value-=r,o.value<0&&(o.value+=l)),o.velocity&&1!==c&&(o.velocity*=c))}(t,i),t.rotation=null!==(s=null===(e=t.rotate)||void 0===e?void 0:e.value)&&void 0!==s?s:0)}}class Ie{init(t){var i;const e=t.container,s=t.options,o=s.move.gravity,n=s.move.spin;if(t.gravity={enable:o.enable,acceleration:v(o.acceleration),inverse:o.inverse},n.enable){const s=null!==(i=n.position)&&void 0!==i?i:{x:50,y:50},o={x:s.x/100*e.canvas.size.width,y:s.y/100*e.canvas.size.height},a=b(t.getPosition(),o),r=v(n.acceleration);t.retina.spinAcceleration=r*e.retina.pixelRatio,t.spin={center:o,direction:t.velocity.x>=0?"clockwise":"counter-clockwise",angle:t.velocity.angle,radius:a,acceleration:t.retina.spinAcceleration}}}isEnabled(t){return!t.destroyed&&t.options.move.enable}move(t,i){var e,s,o,n,a;const r=t.options,l=r.move;if(!l.enable)return;const c=t.container,u=function(t){return t.slow.inRange?t.slow.factor:1}(t),p=(null!==(e=(n=t.retina).moveSpeed)&&void 0!==e?e:n.moveSpeed=v(l.speed)*c.retina.pixelRatio)*c.retina.reduceFactor,m=null!==(s=(a=t.retina).moveDrift)&&void 0!==s?s:a.moveDrift=v(t.options.move.drift)*c.retina.pixelRatio,y=f(r.size.value)*c.retina.pixelRatio,g=p*((l.size?t.getRadius()/y:1)*u*(i.factor||1))/2;if(l.spin.enable)!function(t,i){const e=t.container;if(!t.spin)return;const s={x:"clockwise"===t.spin.direction?Math.cos:Math.sin,y:"clockwise"===t.spin.direction?Math.sin:Math.cos};t.position.x=t.spin.center.x+t.spin.radius*s.x(t.spin.angle),t.position.y=t.spin.center.y+t.spin.radius*s.y(t.spin.angle),t.spin.radius+=t.spin.acceleration;const o=Math.max(e.canvas.size.width,e.canvas.size.height);t.spin.radius>o/2?(t.spin.radius=o/2,t.spin.acceleration*=-1):t.spin.radius<0&&(t.spin.radius=0,t.spin.acceleration*=-1),t.spin.angle+=i/100*(1-t.spin.radius/o)}(t,g);else{!function(t,i){var e;const s=t.options.move.path;if(!s.enable)return;if(t.lastPathTime<=t.pathDelay)return void(t.lastPathTime+=i.value);const o=null===(e=t.pathGenerator)||void 0===e?void 0:e.generate(t);o&&t.velocity.addTo(o),s.clamp&&(t.velocity.x=d(t.velocity.x,-1,1),t.velocity.y=d(t.velocity.y,-1,1)),t.lastPathTime-=t.pathDelay}(t,i);const e=t.gravity,s=(null==e?void 0:e.enable)&&e.inverse?-1:1;(null==e?void 0:e.enable)&&g&&(t.velocity.y+=s*(e.acceleration*i.factor)/(60*g)),m&&g&&(t.velocity.x+=m*i.factor/(60*g));const n=t.moveDecay;1!=n&&t.velocity.multTo(n);const a=t.velocity.mult(g),r=null!==(o=t.retina.maxSpeed)&&void 0!==o?o:c.retina.maxSpeed;(null==e?void 0:e.enable)&&r>0&&(!e.inverse&&a.y>=0&&a.y>=r||e.inverse&&a.y<=0&&a.y<=-r)&&(a.y=s*r,g&&(t.velocity.y=a.y/g));const h=t.options.zIndex,u=(1-t.zIndexFactor)**h.velocityRate;1!=u&&a.multTo(u),t.position.addTo(a),l.vibrate&&(t.position.x+=Math.sin(t.position.x*Math.cos(t.position.y)),t.position.y+=Math.cos(t.position.y*Math.sin(t.position.x)))}!function(t){const i=t.initialPosition,{dx:e,dy:s}=w(i,t.position),o=Math.abs(e),n=Math.abs(s),a=t.retina.maxDistance.horizontal,r=t.retina.maxDistance.vertical;if(a||r)if((a&&o>=a||r&&n>=r)&&!t.misplaced)t.misplaced=!!a&&o>a||!!r&&n>r,a&&(t.velocity.x=t.velocity.y/2-t.velocity.x),r&&(t.velocity.y=t.velocity.x/2-t.velocity.y);else if((!a||o<a)&&(!r||n<r)&&t.misplaced)t.misplaced=!1;else if(t.misplaced){const e=t.position,s=t.velocity;a&&(e.x<i.x&&s.x<0||e.x>i.x&&s.x>0)&&(s.x*=-h()),r&&(e.y<i.y&&s.y<0||e.y>i.y&&s.y>0)&&(s.y*=-h())}}(t)}}class Ee{draw(t,i,e){i.circleRange||(i.circleRange={min:0,max:2*Math.PI});const s=i.circleRange;t.arc(0,0,e,s.min,s.max,!1)}getSidesCount(){return 12}particleInit(t,i){var e;const s=i.shapeData,o=null!==(e=null==s?void 0:s.angle)&&void 0!==e?e:{max:360,min:0};i.circleRange="object"!=typeof o?{min:0,max:o*Math.PI/180}:{min:o.min*Math.PI/180,max:o.max*Math.PI/180}}}function Re(t,i,e,s,o){var n,a;const r=i;if(!r||!e.enable||void 0!==r.loops&&void 0!==r.maxLoops&&r.maxLoops>0&&r.loops>=r.maxLoops)return;const l=p(e.offset),c=(null!==(n=i.velocity)&&void 0!==n?n:0)*t.factor+3.6*l,h=null!==(a=i.decay)&&void 0!==a?a:1;o&&"increasing"!==r.status?(r.value-=c,r.value<0&&(r.loops||(r.loops=0),r.loops++,r.status="increasing",r.value+=r.value)):(r.value+=c,r.value>s&&(r.loops||(r.loops=0),r.loops++,o&&(r.status="decreasing",r.value-=r.value%s))),r.velocity&&1!==h&&(r.velocity*=h),r.value>s&&(r.value%=s)}class De{constructor(t){this.container=t}init(t){const i=ct(t.options.color,t.id,t.options.reduceDuplicates);i&&(t.color=_t(i,t.options.color.animation,this.container.retina.reduceFactor))}isEnabled(t){var i,e,s;const o=t.options.color.animation;return!t.destroyed&&!t.spawning&&(void 0!==(null===(i=t.color)||void 0===i?void 0:i.h.value)&&o.h.enable||void 0!==(null===(e=t.color)||void 0===e?void 0:e.s.value)&&o.s.enable||void 0!==(null===(s=t.color)||void 0===s?void 0:s.l.value)&&o.l.enable)}update(t,i){!function(t,i){var e,s,o;const n=t.options.color.animation,a=null===(e=t.color)||void 0===e?void 0:e.h,r=null===(s=t.color)||void 0===s?void 0:s.s,l=null===(o=t.color)||void 0===o?void 0:o.l;a&&Re(i,a,n.h,360,!1),r&&Re(i,r,n.s,100,!0),l&&Re(i,l,n.l,100,!0)}(t,i)}}class Te{load(t){t&&(void 0!==t.bottom&&(this.bottom=y(t.bottom)),void 0!==t.left&&(this.left=y(t.left)),void 0!==t.right&&(this.right=y(t.right)),void 0!==t.top&&(this.top=y(t.top)))}}class Ae extends xi{constructor(){super(),this.value=3}}class Le extends xi{constructor(){super(),this.value={min:4,max:9}}}class Fe{constructor(){this.count=1,this.factor=new Ae,this.rate=new Le,this.sizeOffset=!0}load(t){var i;t&&(void 0!==t.color&&(this.color=Qt.create(this.color,t.color)),void 0!==t.count&&(this.count=t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=Z(t.particles,(t=>W({},t))),void 0!==t.sizeOffset&&(this.sizeOffset=t.sizeOffset),t.colorOffset&&(this.colorOffset=null!==(i=this.colorOffset)&&void 0!==i?i:{},void 0!==t.colorOffset.h&&(this.colorOffset.h=t.colorOffset.h),void 0!==t.colorOffset.s&&(this.colorOffset.s=t.colorOffset.s),void 0!==t.colorOffset.l&&(this.colorOffset.l=t.colorOffset.l)))}}class Ve{constructor(){this.bounds=new Te,this.mode="none",this.split=new Fe}load(t){t&&(t.mode&&(this.mode=t.mode),t.bounds&&this.bounds.load(t.bounds),this.split.load(t.split))}}class Be{constructor(t,i){this.engine=t,this.container=i}init(t){const i=this.container,e=t.options.destroy;if(!e)return;t.splitCount=0;const s=e.bounds;t.destroyBounds||(t.destroyBounds={}),s.bottom&&(t.destroyBounds.bottom=v(s.bottom)*i.canvas.size.height/100),s.left&&(t.destroyBounds.left=v(s.left)*i.canvas.size.width/100),s.right&&(t.destroyBounds.right=v(s.right)*i.canvas.size.width/100),s.top&&(t.destroyBounds.top=v(s.top)*i.canvas.size.height/100)}isEnabled(t){return!t.destroyed}loadOptions(t,...i){t.destroy||(t.destroy=new Ve);for(const e of i)t.destroy.load(null==e?void 0:e.destroy)}particleDestroyed(t,i){if(i)return;const e=t.options.destroy;e&&"split"===e.mode&&this.split(t)}update(t){if(!this.isEnabled(t))return;const i=t.getPosition(),e=t.destroyBounds;e&&(void 0!==e.bottom&&i.y>=e.bottom||void 0!==e.left&&i.x<=e.left||void 0!==e.right&&i.x>=e.right||void 0!==e.top&&i.y<=e.top)&&t.destroy()}addSplitParticle(t,i){var e,s,o;const n=t.options.destroy;if(!n)return;const a=n.split,r=te(this.engine,this.container,t.options),l=g(a.factor),c=t.getFillColor();a.color?r.color.load(a.color):a.colorOffset&&c?r.color.load({value:{hsl:{h:c.h+v(null!==(e=a.colorOffset.h)&&void 0!==e?e:0),s:c.s+v(null!==(s=a.colorOffset.s)&&void 0!==s?s:0),l:c.l+v(null!==(o=a.colorOffset.l)&&void 0!==o?o:0)}}}):r.color.load({value:{hsl:t.getFillColor()}}),r.move.load({center:{x:t.position.x,y:t.position.y,mode:"precise"}}),"number"==typeof r.size.value?r.size.value/=l:(r.size.value.min/=l,r.size.value.max/=l),r.load(i);const h=a.sizeOffset?y(-t.size.value,t.size.value):0,d={x:t.position.x+p(h),y:t.position.y+p(h)};return this.container.particles.addParticle(d,r,t.group,(i=>{var e;return!(i.size.value<.5)&&(i.velocity.length=p(y(t.velocity.length,i.velocity.length)),i.splitCount=(null!==(e=t.splitCount)&&void 0!==e?e:0)+1,i.unbreakable=!0,setTimeout((()=>{i.unbreakable=!1}),500),!0)}))}split(t){const i=t.options.destroy;if(!i)return;const e=i.split;if(e.count>=0&&(void 0===t.splitCount||t.splitCount++>e.count))return;const s=g(e.rate),o=Q(e.particles);for(let i=0;i<s;i++)this.addSplitParticle(t,o)}}class Ue{randomPosition(t,i,e){const[s,o]=[i.width/2,i.height/2],n=((t,i)=>{const e=h()/4,s=Math.atan(i/t*Math.tan(2*Math.PI*e)),o=h();return o<.25?s:o<.5?Math.PI-s:o<.75?Math.PI+s:-s})(s,o),a=(d=n,(l=s)*(c=o)/Math.sqrt((c*Math.cos(d))**2+(l*Math.sin(d))**2)),r=e?a*Math.sqrt(h()):a;var l,c,d;return{x:t.x+r*Math.cos(n),y:t.y+r*Math.sin(n)}}}class He{constructor(){this.wait=!1}load(t){t&&(void 0!==t.count&&(this.count=t.count),void 0!==t.delay&&(this.delay=t.delay),void 0!==t.duration&&(this.duration=t.duration),void 0!==t.wait&&(this.wait=t.wait))}}class qe{constructor(){this.quantity=1,this.delay=.1}load(t){void 0!==t&&(void 0!==t.quantity&&(this.quantity=y(t.quantity)),void 0!==t.delay&&(this.delay=y(t.delay)))}}class We{constructor(){this.mode="percent",this.height=0,this.width=0}load(t){void 0!==t&&(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.height&&(this.height=t.height),void 0!==t.width&&(this.width=t.width))}}class Ne{constructor(){this.autoPlay=!0,this.fill=!0,this.life=new He,this.rate=new qe,this.shape="square",this.startCount=0}load(t){t&&(void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.size&&(this.size||(this.size=new We),this.size.load(t.size)),void 0!==t.direction&&(this.direction=t.direction),this.domId=t.domId,void 0!==t.fill&&(this.fill=t.fill),this.life.load(t.life),this.name=t.name,this.particles=Z(t.particles,(t=>W({},t))),this.rate.load(t.rate),void 0!==t.shape&&(this.shape=t.shape),void 0!==t.position&&(this.position={},void 0!==t.position.x&&(this.position.x=y(t.position.x)),void 0!==t.position.y&&(this.position.y=y(t.position.y))),void 0!==t.spawnColor&&(void 0===this.spawnColor&&(this.spawnColor=new yi),this.spawnColor.load(t.spawnColor)),void 0!==t.startCount&&(this.startCount=t.startCount))}}class Ge{constructor(t,i,e,s,o){var n,a,r,l,c,h,d,u;this.emitters=i,this.container=e,this._engine=t,this._currentDuration=0,this._currentEmitDelay=0,this._currentSpawnDelay=0,this._initialPosition=o,s instanceof Ne?this.options=s:(this.options=new Ne,this.options.load(s)),this._spawnDelay=1e3*(null!==(n=this.options.life.delay)&&void 0!==n?n:0)/this.container.retina.reduceFactor,this.position=null!==(a=this._initialPosition)&&void 0!==a?a:this.calcPosition(),this.name=this.options.name,this._shape=null===(r=this._engine.emitterShapeManager)||void 0===r?void 0:r.getShape(this.options.shape),this.fill=this.options.fill,this._firstSpawn=!this.options.life.wait,this._startParticlesAdded=!1;let p=W({},this.options.particles);null!=p||(p={}),null!==(l=p.move)&&void 0!==l||(p.move={}),null!==(c=(u=p.move).direction)&&void 0!==c||(u.direction=this.options.direction),this.options.spawnColor&&(this.spawnColor=ct(this.options.spawnColor)),this._paused=!this.options.autoPlay,this._particlesOptions=p,this.size=null!==(h=this.options.size)&&void 0!==h?h:(()=>{const t=new We;return t.load({height:0,mode:"percent",width:0}),t})(),this._lifeCount=null!==(d=this.options.life.count)&&void 0!==d?d:-1,this._immortal=this._lifeCount<=0,this._engine.dispatchEvent("emitterCreated",{container:e,data:{emitter:this}}),this.play()}externalPause(){this._paused=!0,this.pause()}externalPlay(){this._paused=!1,this.play()}getPosition(){if(this.options.domId){const t=this.container,i=document.getElementById(this.options.domId);if(i){const e=i.getBoundingClientRect();return{x:(e.x+e.width/2)*t.retina.pixelRatio,y:(e.y+e.height/2)*t.retina.pixelRatio}}}return this.position}getSize(){const t=this.container;if(this.options.domId){const i=document.getElementById(this.options.domId);if(i){const e=i.getBoundingClientRect();return{width:e.width*t.retina.pixelRatio,height:e.height*t.retina.pixelRatio}}}return{width:"percent"===this.size.mode?t.canvas.size.width*this.size.width/100:this.size.width,height:"percent"===this.size.mode?t.canvas.size.height*this.size.height/100:this.size.height}}pause(){this._paused||delete this._emitDelay}play(){var t;if(!this._paused&&this.container.retina.reduceFactor&&(this._lifeCount>0||this._immortal||!this.options.life.count)&&(this._firstSpawn||this._currentSpawnDelay>=(null!==(t=this._spawnDelay)&&void 0!==t?t:0))){if(void 0===this._emitDelay){const t=v(this.options.rate.delay);this._emitDelay=1e3*t/this.container.retina.reduceFactor}(this._lifeCount>0||this._immortal)&&this.prepareToDie()}}resize(){const t=this._initialPosition;this.position=t&&U(t,this.container.canvas.size,o.origin)?t:this.calcPosition()}update(t){var i,e,s;this._paused||(this._firstSpawn&&(this._firstSpawn=!1,this._currentSpawnDelay=null!==(i=this._spawnDelay)&&void 0!==i?i:0,this._currentEmitDelay=null!==(e=this._emitDelay)&&void 0!==e?e:0),this._startParticlesAdded||(this._startParticlesAdded=!0,this.emitParticles(this.options.startCount)),void 0!==this._duration&&(this._currentDuration+=t.value,this._currentDuration>=this._duration&&(this.pause(),void 0!==this._spawnDelay&&delete this._spawnDelay,this._immortal||this._lifeCount--,this._lifeCount>0||this._immortal?(this.position=this.calcPosition(),this._spawnDelay=1e3*(null!==(s=this.options.life.delay)&&void 0!==s?s:0)/this.container.retina.reduceFactor):this.destroy(),this._currentDuration-=this._duration,delete this._duration)),void 0!==this._spawnDelay&&(this._currentSpawnDelay+=t.value,this._currentSpawnDelay>=this._spawnDelay&&(this._engine.dispatchEvent("emitterPlay",{container:this.container}),this.play(),this._currentSpawnDelay-=this._currentSpawnDelay,delete this._spawnDelay)),void 0!==this._emitDelay&&(this._currentEmitDelay+=t.value,this._currentEmitDelay>=this._emitDelay&&(this.emit(),this._currentEmitDelay-=this._emitDelay)))}calcPosition(){return P({size:this.container.canvas.size,position:this.options.position})}destroy(){this.emitters.removeEmitter(this),this._engine.dispatchEvent("emitterDestroyed",{container:this.container,data:{emitter:this}})}emit(){if(this._paused)return;const t=v(this.options.rate.quantity);this.emitParticles(t)}emitParticles(t){var i,e,s;const o=this.getPosition(),n=this.getSize(),a=Q(this._particlesOptions);for(let r=0;r<t;r++){const t=W({},a);if(this.spawnColor){const e=null===(i=this.options.spawnColor)||void 0===i?void 0:i.animation;e&&(this.spawnColor.h=this.setColorAnimation(e.h,this.spawnColor.h,360),this.spawnColor.s=this.setColorAnimation(e.s,this.spawnColor.s,100),this.spawnColor.l=this.setColorAnimation(e.l,this.spawnColor.l,100)),t.color?t.color.value=this.spawnColor:t.color={value:this.spawnColor}}if(!o)return;const r=null!==(s=null===(e=this._shape)||void 0===e?void 0:e.randomPosition(o,n,this.fill))&&void 0!==s?s:o;this.container.particles.addParticle(r,t)}}prepareToDie(){var t;if(this._paused)return;const i=null===(t=this.options.life)||void 0===t?void 0:t.duration;this.container.retina.reduceFactor&&(this._lifeCount>0||this._immortal)&&void 0!==i&&i>0&&(this._duration=1e3*i)}setColorAnimation(t,i,e){var s;const o=this.container;if(!t.enable)return i;const n=p(t.offset),a=1e3*v(this.options.rate.delay)/o.retina.reduceFactor;return(i+v(null!==(s=t.speed)&&void 0!==s?s:0)*o.fpsLimit/a+3.6*n)%e}}class je{constructor(t,i){this.container=i,this._engine=t,this.array=[],this.emitters=[],this.interactivityEmitters={random:{count:1,enable:!1},value:[]},i.getEmitter=t=>void 0===t||"number"==typeof t?this.array[t||0]:this.array.find((i=>i.name===t)),i.addEmitter=(t,i)=>this.addEmitter(t,i),i.removeEmitter=t=>{const e=i.getEmitter(t);e&&this.removeEmitter(e)},i.playEmitter=t=>{const e=i.getEmitter(t);e&&e.externalPlay()},i.pauseEmitter=t=>{const e=i.getEmitter(t);e&&e.externalPause()}}addEmitter(t,i){const e=new Ne;e.load(t);const s=new Ge(this._engine,this,this.container,e,i);return this.array.push(s),s}handleClickMode(t){const i=this.emitters,e=this.interactivityEmitters;if("emitter"!==t)return;let s;if(e&&e.value instanceof Array)if(e.value.length>0&&e.random.enable){s=[];const t=[];for(let i=0;i<e.random.count;i++){const o=V(e.value);t.includes(o)&&t.length<e.value.length?i--:(t.push(o),s.push(B(e.value,o)))}}else s=e.value;else s=null==e?void 0:e.value;const o=null!=s?s:i,n=this.container.interactivity.mouse.clickPosition;Z(o,(t=>{this.addEmitter(t,n)}))}async init(){if(this.emitters=this.container.actualOptions.emitters,this.interactivityEmitters=this.container.actualOptions.interactivity.modes.emitters,this.emitters)if(this.emitters instanceof Array)for(const t of this.emitters)this.addEmitter(t);else this.addEmitter(this.emitters)}pause(){for(const t of this.array)t.pause()}play(){for(const t of this.array)t.play()}removeEmitter(t){const i=this.array.indexOf(t);i>=0&&this.array.splice(i,1)}resize(){for(const t of this.array)t.resize()}stop(){this.array=[]}update(t){for(const i of this.array)i.update(t)}}const $e=new Map;class Xe{constructor(t){this._engine=t}addShape(t,i){this.getShape(t)||$e.set(t,i)}getShape(t){return $e.get(t)}getSupportedShapes(){return $e.keys()}}function Ye(t,i){return t+i*(h()-.5)}class Je{randomPosition(t,i,e){if(e)return{x:Ye(t.x,i.width),y:Ye(t.y,i.height)};{const e=i.width/2,s=i.height/2,o=Math.floor(4*h()),n=2*(h()-.5);switch(o){case 0:return{x:t.x+n*e,y:t.y-s};case 1:return{x:t.x-e,y:t.y+n*s};case 2:return{x:t.x+n*e,y:t.y+s};default:return{x:t.x+e,y:t.y+n*s}}}}}class Ze{constructor(t){this._engine=t,this.id="emitters"}getPlugin(t){return new je(this._engine,t)}loadOptions(t,i){var e,s,o,n,a,r;if(!this.needsPlugin(t)&&!this.needsPlugin(i))return;(null==i?void 0:i.emitters)&&(t.emitters=Z(i.emitters,(t=>{const i=new Ne;return i.load(t),i})));const l=null===(s=null===(e=null==i?void 0:i.interactivity)||void 0===e?void 0:e.modes)||void 0===s?void 0:s.emitters;if(l)if(l instanceof Array)t.interactivity.modes.emitters={random:{count:1,enable:!0},value:l.map((t=>{const i=new Ne;return i.load(t),i}))};else{const i=l;if(void 0!==i.value)if(i.value instanceof Array)t.interactivity.modes.emitters={random:{count:null!==(o=i.random.count)&&void 0!==o?o:1,enable:null!==(n=i.random.enable)&&void 0!==n&&n},value:i.value.map((t=>{const i=new Ne;return i.load(t),i}))};else{const e=new Ne;e.load(i.value),t.interactivity.modes.emitters={random:{count:null!==(a=i.random.count)&&void 0!==a?a:1,enable:null!==(r=i.random.enable)&&void 0!==r&&r},value:e}}else{(t.interactivity.modes.emitters={random:{count:1,enable:!1},value:new Ne}).value.load(l)}}}needsPlugin(t){var i,e,s;if(!t)return!1;const o=t.emitters;return o instanceof Array&&!!o.length||void 0!==o||!!(null===(s=null===(e=null===(i=t.interactivity)||void 0===i?void 0:i.events)||void 0===e?void 0:e.onClick)||void 0===s?void 0:s.mode)&&L("emitter",t.interactivity.events.onClick.mode)}}class Qe extends xi{constructor(){super(),this.sync=!1}load(t){t&&(super.load(t),void 0!==t.sync&&(this.sync=t.sync))}}class Ke extends xi{constructor(){super(),this.random.minimumValue=1e-4,this.sync=!1}load(t){t&&(super.load(t),void 0!==t.sync&&(this.sync=t.sync))}}class ts{constructor(){this.count=0,this.delay=new Qe,this.duration=new Ke}load(t){t&&(void 0!==t.count&&(this.count=t.count),this.delay.load(t.delay),this.duration.load(t.duration))}}class is{constructor(t){this.container=t}init(t){const i=this.container,e=t.options.life;e&&(t.life={delay:i.retina.reduceFactor?v(e.delay.value)*(e.delay.sync?1:h())/i.retina.reduceFactor*1e3:0,delayTime:0,duration:i.retina.reduceFactor?v(e.duration.value)*(e.duration.sync?1:h())/i.retina.reduceFactor*1e3:0,time:0,count:e.count},t.life.duration<=0&&(t.life.duration=-1),t.life.count<=0&&(t.life.count=-1),t.life&&(t.spawning=t.life.delay>0))}isEnabled(t){return!t.destroyed}loadOptions(t,...i){t.life||(t.life=new ts);for(const e of i)t.life.load(null==e?void 0:e.life)}update(t,i){if(!this.isEnabled(t)||!t.life)return;const e=t.life;let s=!1;if(t.spawning){if(e.delayTime+=i.value,!(e.delayTime>=t.life.delay))return;s=!0,t.spawning=!1,e.delayTime=0,e.time=0}if(-1===e.duration)return;if(t.spawning)return;if(s?e.time=0:e.time+=i.value,e.time<e.duration)return;if(e.time=0,t.life.count>0&&t.life.count--,0===t.life.count)return void t.destroy();const o=this.container.canvas.size,n=y(0,o.width),a=y(0,o.width);t.position.x=p(n),t.position.y=p(a),t.spawning=!0,e.delayTime=0,e.time=0,t.reset();const r=t.options.life;r&&(e.delay=1e3*v(r.delay.value),e.duration=1e3*v(r.duration.value))}}class es{draw(t,i,e){t.moveTo(-e/2,0),t.lineTo(e/2,0)}getSidesCount(){return 1}}class ss{constructor(t){this.container=t}init(t){const i=t.options.opacity;t.opacity={enable:i.animation.enable,max:f(i.value),min:m(i.value),value:v(i.value),loops:0,maxLoops:v(i.animation.count)};const e=i.animation;if(e.enable){t.opacity.decay=1-v(e.decay),t.opacity.status="increasing";const s=i.value;switch(t.opacity.min=m(s),t.opacity.max=f(s),e.startValue){case"min":t.opacity.value=t.opacity.min,t.opacity.status="increasing";break;case"random":t.opacity.value=p(t.opacity),t.opacity.status=h()>=.5?"increasing":"decreasing";break;default:t.opacity.value=t.opacity.max,t.opacity.status="decreasing"}t.opacity.velocity=v(e.speed)/100*this.container.retina.reduceFactor,e.sync||(t.opacity.velocity*=h())}t.opacity.initialValue=t.opacity.value}isEnabled(t){var i,e,s,o;return!t.destroyed&&!t.spawning&&!!t.opacity&&t.opacity.enable&&((null!==(i=t.opacity.maxLoops)&&void 0!==i?i:0)<=0||(null!==(e=t.opacity.maxLoops)&&void 0!==e?e:0)>0&&(null!==(s=t.opacity.loops)&&void 0!==s?s:0)<(null!==(o=t.opacity.maxLoops)&&void 0!==o?o:0))}reset(t){t.opacity&&(t.opacity.loops=0)}update(t,i){this.isEnabled(t)&&function(t,i){var e,s,o,n,a,r;if(!t.opacity)return;const l=t.opacity.min,c=t.opacity.max,h=null!==(e=t.opacity.decay)&&void 0!==e?e:1;if(!(t.destroyed||!t.opacity.enable||(null!==(s=t.opacity.maxLoops)&&void 0!==s?s:0)>0&&(null!==(o=t.opacity.loops)&&void 0!==o?o:0)>(null!==(n=t.opacity.maxLoops)&&void 0!==n?n:0))){switch(t.opacity.status){case"increasing":t.opacity.value>=c?(t.opacity.status="decreasing",t.opacity.loops||(t.opacity.loops=0),t.opacity.loops++):t.opacity.value+=(null!==(a=t.opacity.velocity)&&void 0!==a?a:0)*i.factor;break;case"decreasing":t.opacity.value<=l?(t.opacity.status="increasing",t.opacity.loops||(t.opacity.loops=0),t.opacity.loops++):t.opacity.value-=(null!==(r=t.opacity.velocity)&&void 0!==r?r:0)*i.factor}t.opacity.velocity&&1!==t.opacity.decay&&(t.opacity.velocity*=h),function(t,i,e,s){switch(t.options.opacity.animation.destroy){case"max":i>=s&&t.destroy();break;case"min":i<=e&&t.destroy()}}(t,t.opacity.value,l,c),t.destroyed||(t.opacity.value=d(t.opacity.value,l,c))}}(t,i)}}class os{constructor(t){this.container=t,this.modes=["bounce","bounce-vertical","bounce-horizontal","bounceVertical","bounceHorizontal","split"]}update(t,i,e,s){if(!this.modes.includes(s))return;const o=this.container;let n=!1;for(const[,s]of o.plugins)if(void 0!==s.particleBounce&&(n=s.particleBounce(t,e,i)),n)break;if(n)return;const a=t.getPosition(),r=t.offset,l=t.getRadius(),c=q(a,l),h=o.canvas.size;!function(t){if("bounce"!==t.outMode&&"bounce-horizontal"!==t.outMode&&"bounceHorizontal"!==t.outMode&&"split"!==t.outMode)return;t.bounds.right<0?t.particle.position.x=t.size+t.offset.x:t.bounds.left>t.canvasSize.width&&(t.particle.position.x=t.canvasSize.width-t.size-t.offset.x);const i=t.particle.velocity.x;let e=!1;if("right"===t.direction&&t.bounds.right>=t.canvasSize.width&&i>0||"left"===t.direction&&t.bounds.left<=0&&i<0){const i=g(t.particle.options.bounce.horizontal);t.particle.velocity.x*=-i,e=!0}if(!e)return;const s=t.offset.x+t.size;t.bounds.right>=t.canvasSize.width?t.particle.position.x=t.canvasSize.width-s:t.bounds.left<=0&&(t.particle.position.x=s),"split"===t.outMode&&t.particle.destroy()}({particle:t,outMode:s,direction:i,bounds:c,canvasSize:h,offset:r,size:l}),function(t){if("bounce"!==t.outMode&&"bounce-vertical"!==t.outMode&&"bounceVertical"!==t.outMode&&"split"!==t.outMode)return;t.bounds.bottom<0?t.particle.position.y=t.size+t.offset.y:t.bounds.top>t.canvasSize.height&&(t.particle.position.y=t.canvasSize.height-t.size-t.offset.y);const i=t.particle.velocity.y;let e=!1;if("bottom"===t.direction&&t.bounds.bottom>=t.canvasSize.height&&i>0||"top"===t.direction&&t.bounds.top<=0&&i<0){const i=g(t.particle.options.bounce.vertical);t.particle.velocity.y*=-i,e=!0}if(!e)return;const s=t.offset.y+t.size;t.bounds.bottom>=t.canvasSize.height?t.particle.position.y=t.canvasSize.height-s:t.bounds.top<=0&&(t.particle.position.y=s),"split"===t.outMode&&t.particle.destroy()}({particle:t,outMode:s,direction:i,bounds:c,canvasSize:h,offset:r,size:l})}}class ns{constructor(t){this.container=t,this.modes=["destroy"]}update(t,i,e,s){if(!this.modes.includes(s))return;const n=this.container;switch(t.outType){case"normal":case"outside":if(U(t.position,n.canvas.size,o.origin,t.getRadius(),i))return;break;case"inside":{const{dx:i,dy:e}=w(t.position,t.moveCenter),{x:s,y:o}=t.velocity;if(s<0&&i>t.moveCenter.radius||o<0&&e>t.moveCenter.radius||s>=0&&i<-t.moveCenter.radius||o>=0&&e<-t.moveCenter.radius)return;break}}n.particles.remove(t,void 0,!0)}}class as{constructor(t){this.container=t,this.modes=["none"]}update(t,i,e,s){if(!this.modes.includes(s))return;if(t.options.move.distance.horizontal&&("left"===i||"right"===i)||t.options.move.distance.vertical&&("top"===i||"bottom"===i))return;const n=t.options.move.gravity,a=this.container,r=a.canvas.size,l=t.getRadius();if(n.enable){const e=t.position;(!n.inverse&&e.y>r.height+l&&"bottom"===i||n.inverse&&e.y<-l&&"top"===i)&&a.particles.remove(t)}else{if(t.velocity.y>0&&t.position.y<=r.height+l||t.velocity.y<0&&t.position.y>=-l||t.velocity.x>0&&t.position.x<=r.width+l||t.velocity.x<0&&t.position.x>=-l)return;U(t.position,a.canvas.size,o.origin,l,i)||a.particles.remove(t)}}}class rs{constructor(t){this.container=t,this.modes=["out"]}update(t,i,e,s){if(!this.modes.includes(s))return;const n=this.container;switch(t.outType){case"inside":{const{x:i,y:e}=t.velocity,s=o.origin;s.length=t.moveCenter.radius,s.angle=t.velocity.angle+Math.PI,s.addTo(o.create(t.moveCenter));const{dx:a,dy:r}=w(t.position,s);if(i<=0&&a>=0||e<=0&&r>=0||i>=0&&a<=0||e>=0&&r<=0)return;t.position.x=Math.floor(p({min:0,max:n.canvas.size.width})),t.position.y=Math.floor(p({min:0,max:n.canvas.size.height}));const{dx:l,dy:c}=w(t.position,t.moveCenter);t.direction=Math.atan2(-c,-l),t.velocity.angle=t.direction;break}default:if(U(t.position,n.canvas.size,o.origin,t.getRadius(),i))return;switch(t.outType){case"outside":{t.position.x=Math.floor(p({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.x,t.position.y=Math.floor(p({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.y;const{dx:i,dy:e}=w(t.position,t.moveCenter);t.moveCenter.radius&&(t.direction=Math.atan2(e,i),t.velocity.angle=t.direction);break}case"normal":{const e=t.options.move.warp,s=n.canvas.size,o={bottom:s.height+t.getRadius()+t.offset.y,left:-t.getRadius()-t.offset.x,right:s.width+t.getRadius()+t.offset.x,top:-t.getRadius()-t.offset.y},a=t.getRadius(),r=q(t.position,a);"right"===i&&r.left>s.width+t.offset.x?(t.position.x=o.left,t.initialPosition.x=t.position.x,e||(t.position.y=h()*s.height,t.initialPosition.y=t.position.y)):"left"===i&&r.right<-t.offset.x&&(t.position.x=o.right,t.initialPosition.x=t.position.x,e||(t.position.y=h()*s.height,t.initialPosition.y=t.position.y)),"bottom"===i&&r.top>s.height+t.offset.y?(e||(t.position.x=h()*s.width,t.initialPosition.x=t.position.x),t.position.y=o.top,t.initialPosition.y=t.position.y):"top"===i&&r.bottom<-t.offset.y&&(e||(t.position.x=h()*s.width,t.initialPosition.x=t.position.x),t.position.y=o.bottom,t.initialPosition.y=t.position.y);break}}}}}class ls{constructor(t){this.container=t,this.updaters=[new os(t),new ns(t),new rs(t),new as(t)]}init(){}isEnabled(t){return!t.destroyed&&!t.spawning}update(t,i){var e,s,o,n;const a=t.options.move.outModes;this.updateOutMode(t,i,null!==(e=a.bottom)&&void 0!==e?e:a.default,"bottom"),this.updateOutMode(t,i,null!==(s=a.left)&&void 0!==s?s:a.default,"left"),this.updateOutMode(t,i,null!==(o=a.right)&&void 0!==o?o:a.default,"right"),this.updateOutMode(t,i,null!==(n=a.top)&&void 0!==n?n:a.default,"top")}updateOutMode(t,i,e,s){for(const o of this.updaters)o.update(t,s,i,e)}}class cs{init(t){var i;const e=t.container,s=t.options.size.animation;s.enable&&(t.size.velocity=(null!==(i=t.retina.sizeAnimationSpeed)&&void 0!==i?i:e.retina.sizeAnimationSpeed)/100*e.retina.reduceFactor,s.sync||(t.size.velocity*=h()))}isEnabled(t){var i,e,s,o;return!t.destroyed&&!t.spawning&&t.size.enable&&((null!==(i=t.size.maxLoops)&&void 0!==i?i:0)<=0||(null!==(e=t.size.maxLoops)&&void 0!==e?e:0)>0&&(null!==(s=t.size.loops)&&void 0!==s?s:0)<(null!==(o=t.size.maxLoops)&&void 0!==o?o:0))}reset(t){t.size.loops=0}update(t,i){this.isEnabled(t)&&function(t,i){var e,s,o,n,a;const r=(null!==(e=t.size.velocity)&&void 0!==e?e:0)*i.factor,l=t.size.min,c=t.size.max,h=null!==(s=t.size.decay)&&void 0!==s?s:1;if(!(t.destroyed||!t.size.enable||(null!==(o=t.size.maxLoops)&&void 0!==o?o:0)>0&&(null!==(n=t.size.loops)&&void 0!==n?n:0)>(null!==(a=t.size.maxLoops)&&void 0!==a?a:0))){switch(t.size.status){case"increasing":t.size.value>=c?(t.size.status="decreasing",t.size.loops||(t.size.loops=0),t.size.loops++):t.size.value+=r;break;case"decreasing":t.size.value<=l?(t.size.status="increasing",t.size.loops||(t.size.loops=0),t.size.loops++):t.size.value-=r}t.size.velocity&&1!==h&&(t.size.velocity*=h),function(t,i,e,s){switch(t.options.size.animation.destroy){case"max":i>=s&&t.destroy();break;case"min":i<=e&&t.destroy()}}(t,t.size.value,l,c),t.destroyed||(t.size.value=d(t.size.value,l,c))}}(t,i)}}class hs{constructor(){this.loop=!1,this.source=""}load(t){void 0!==t&&("object"==typeof t?(void 0!==t.loop&&(this.loop=t.loop),void 0!==t.source&&(this.source=t.source)):this.source=t)}}class ds{constructor(){this.duration=500,this.value=[]}load(t){t&&(void 0!==t.duration&&(this.duration=t.duration),void 0!==t.value&&(this.value=t.value))}}class us{constructor(){this.loop=!1,this.melodies=[],this.notes=[]}load(t){void 0!==t&&(void 0!==t.loop&&(this.loop=t.loop),void 0!==t.melodies&&(this.melodies=t.melodies.map((t=>{const i=new us;return i.load(t),i}))),void 0!==t.notes&&(this.notes=t.notes.map((t=>{const i=new ds;return i.load(t),i}))))}}class ps{constructor(){this.event=[],this.notes=[]}load(t){t&&(void 0!==t.event&&(this.event=t.event),void 0!==t.audio&&(t.audio instanceof Array?this.audio=t.audio.map((t=>{const i=new hs;return i.load(t),i})):(this.audio=new hs,this.audio.load(t.audio))),void 0!==t.notes&&(this.notes=t.notes.map((t=>{const i=new ds;return i.load(t),i}))),void 0!==t.melodies&&(this.melodies=t.melodies.map((t=>{const i=new us;return i.load(t),i}))),void 0!==t.filter&&("string"==typeof t.filter?"function"==typeof window[t.filter]&&(this.filter=window[t.filter]):this.filter=t.filter))}}class vs{constructor(){this.width=24,this.height=24}load(t){t&&(void 0!==t.path&&(this.path=t.path),void 0!==t.svg&&(this.svg=t.svg),void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height))}}class ms{constructor(){this.mute=new vs,this.unmute=new vs,this.volumeDown=new vs,this.volumeUp=new vs,this.mute.svg='<?xml version="1.0"?>\n<svg baseProfile="tiny" height="24px" version="1.2" viewBox="0 0 24 24" width="24px"\n xml:space="preserve" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path fill="#fff" d="M19.707,5.293c-0.391-0.391-1.023-0.391-1.414,0l-1.551,1.551c-0.345-0.688-0.987-1.02-1.604-1.02c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C10.357,8.561,8.904,9,8,9c-1.654,0-3,1.346-3,3v2c0,1.237,0.754,2.302,1.826,2.76l-1.533,1.533c-0.391,0.391-0.391,1.023,0,1.414C5.488,19.902,5.744,20,6,20s0.512-0.098,0.707-0.293l2.527-2.527c0.697,0.174,1.416,0.455,1.875,0.762l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C16.035,20.176,17,19.495,17,18V9.414l2.707-2.707C20.098,6.316,20.098,5.684,19.707,5.293z M14.891,7.941c0.038-0.025,0.073-0.046,0.104-0.062C14.998,7.914,15,7.954,15,8v1.293l-2,2V9.202L14.891,7.941z M7,12c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v2.439l-2.83,2.83C8.757,15.046,8.356,15,8,15c-0.552,0-1-0.448-1-1V12z M10.301,15.406L12,13.707v2.439C11.519,15.859,10.925,15.604,10.301,15.406z M14.994,18.12c-0.03-0.016-0.065-0.036-0.104-0.062L13,16.798v-4.091l2-2V18C15,18.046,14.998,18.086,14.994,18.12z"/>\n </g>\n</svg>',this.unmute.svg='<?xml version="1.0"?>\n<svg baseProfile="tiny" height="24px" version="1.2" viewBox="0 0 24 24" width="24px"\n xml:space="preserve" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path fill="#fff" d="M17.138,5.824c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C12.357,8.561,10.904,9,10,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C18.035,20.176,19,19.495,19,18V8C19,6.505,18.035,5.824,17.138,5.824z M14,16.146C12.907,15.495,11.211,15,10,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146V16.146z M17,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L15,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C16.998,7.914,17,7.954,17,8V18z"/>\n </g>\n</svg>',this.volumeDown.svg='<?xml version="1.0"?>\n<svg baseProfile="tiny" height="24px" version="1.2" viewBox="0 0 24 24" width="24px"\n xml:space="preserve" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path fill="#fff" d="M15.138,5.824c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C10.357,8.561,8.904,9,8,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C16.035,20.176,17,19.495,17,18V8C17,6.505,16.035,5.824,15.138,5.824z M8,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v6.293C10.907,15.495,9.211,15,8,15z M15,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L13,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C14.998,7.914,15,7.954,15,8V18z"/>\n <path fill="#fff" d="M18.292,10.294c-0.39,0.391-0.39,1.023,0.002,1.414c0.345,0.345,0.535,0.803,0.535,1.291c0,0.489-0.19,0.948-0.536,1.294c-0.391,0.39-0.391,1.023,0,1.414C18.488,15.902,18.744,16,19,16s0.512-0.098,0.707-0.293c0.724-0.723,1.122-1.685,1.122-2.708s-0.398-1.984-1.123-2.707C19.317,9.903,18.683,9.901,18.292,10.294z"/>\n </g>\n</svg>',this.volumeUp.svg='<?xml version="1.0"?>\n<svg baseProfile="tiny" height="24px" version="1.2" viewBox="0 0 24 24" width="24px"\n xml:space="preserve" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Layer_1">\n <path fill="#fff" d="M16.706,10.292c-0.389-0.389-1.023-0.391-1.414,0.002c-0.39,0.391-0.39,1.023,0.002,1.414c0.345,0.345,0.535,0.803,0.535,1.291c0,0.489-0.19,0.948-0.536,1.294c-0.391,0.39-0.391,1.023,0,1.414C15.488,15.902,15.744,16,16,16s0.512-0.098,0.707-0.293c0.724-0.723,1.122-1.685,1.122-2.708S17.431,11.015,16.706,10.292z"/>\n <path fill="#fff" d="M18.706,8.292c-0.391-0.389-1.023-0.39-1.414,0.002c-0.39,0.391-0.39,1.024,0.002,1.414c0.879,0.877,1.363,2.044,1.364,3.287c0.001,1.246-0.484,2.417-1.365,3.298c-0.391,0.391-0.391,1.023,0,1.414C17.488,17.902,17.744,18,18,18s0.512-0.098,0.707-0.293c1.259-1.259,1.952-2.933,1.951-4.713C20.657,11.217,19.964,9.547,18.706,8.292z"/>\n <path fill="#fff" d="M20.706,6.292c-0.391-0.389-1.023-0.39-1.414,0.002c-0.39,0.391-0.39,1.024,0.002,1.414c1.412,1.409,2.191,3.285,2.192,5.284c0.002,2.002-0.777,3.885-2.193,5.301c-0.391,0.391-0.391,1.023,0,1.414C19.488,19.902,19.744,20,20,20s0.512-0.098,0.707-0.293c1.794-1.794,2.781-4.18,2.779-6.717C23.485,10.457,22.497,8.078,20.706,6.292z"/>\n <path fill="#fff" d="M12.138,5.824c-0.449,0-0.905,0.152-1.356,0.453L8.109,8.059C7.357,8.561,5.904,9,5,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C13.035,20.176,14,19.495,14,18V8C14,6.505,13.035,5.824,12.138,5.824z M5,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v6.293C7.907,15.495,6.211,15,5,15z M12,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L10,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C11.998,7.914,12,7.954,12,8V18z"/>\n </g>\n</svg>'}load(t){t&&(this.mute.load(t.mute),this.unmute.load(t.unmute),this.volumeDown.load(t.volumeDown),this.volumeUp.load(t.volumeUp))}}class fs{constructor(){this.value=100,this.max=100,this.min=0,this.step=10}load(t){void 0!==t&&("object"==typeof t?(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.step&&(this.step=t.step),void 0!==t.value&&(this.value=t.value)):this.value=t)}}class ys{constructor(){this.enable=!1,this.events=[],this.icons=new ms,this.volume=new fs}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.events&&(this.events=t.events.map((t=>{const i=new ps;return i.load(t),i}))),this.icons.load(t.icons),void 0!==t.volume&&this.volume.load(t.volume))}}const gs=new Map;function ws(t){const i=/(([A-G]b?)(\d))|pause/i.exec(t);if(!i||!i.length)return;console.log(i);const e=i[2]||i[0],s=gs.get(e);return s?s[parseInt(i[3]||"0")]:void 0}function bs(t,i,e,s,o,n,a){t.style.userSelect="none",t.style.webkitUserSelect="none",t.style.position="absolute",t.style.top=`${i+a}px`,t.style.left=e-a-n+"px",t.style.display=s,t.style.zIndex=`${o+1}`}gs.set("C",[16.35,32.7,65.41,130.81,261.63,523.25,1046.5,2093,4186.01]),gs.set("Db",[17.32,34.65,69.3,138.59,277.18,554.37,1108.73,2217.46,4434.92]),gs.set("D",[18.35,36.71,73.42,146.83,293.66,587.33,1174.66,2349.32,4698.63]),gs.set("Eb",[19.45,38.89,77.78,155.56,311.13,622.25,1244.51,2489.02,4978.03]),gs.set("E",[20.6,41.2,82.41,164.81,329.63,659.25,1318.51,2637.02,5274.04]),gs.set("F",[21.83,43.65,87.31,174.61,349.23,698.46,1396.91,2793.83,5587.65]),gs.set("Gb",[23.12,46.25,92.5,185,369.99,739.99,1479.98,2959.96,5919.91]),gs.set("G",[24.5,49,98,196,392,783.99,1567.98,3135.96,6271.93]),gs.set("Ab",[25.96,51.91,103.83,207.65,415.3,830.61,1661.22,3322.44,6644.88]),gs.set("A",[27.5,55,110,220,440,880,1760,3520,7040]),gs.set("Bb",[29.14,58.27,116.54,233.08,466.16,932.33,1864.66,3729.31,7458.62]),gs.set("B",[30.87,61.74,123.47,246.94,493.88,987.77,1975.53,3951.07,7902.13]),gs.set("pause",[0]);class xs{constructor(t,i){this._container=t,this._engine=i,this._volume=0,this._audioSources=[],this._audioMap=new Map}async init(){const t=this._container,i=t.actualOptions.sounds;if(!(null==i?void 0:i.enable))return;this._volume=i.volume.value;const e=i.events;this._audioMap=new Map;for(const i of e)i.audio&&Z(i.audio,(async i=>{const e=await fetch(i.source);if(!e.ok)return;const s=await e.arrayBuffer();t.audioContext=new AudioContext;const o=await t.audioContext.decodeAudioData(s);this._audioMap.set(i.source,o)}))}async start(){var t,i,e,s;const o=this._container,n=o.actualOptions,a=n.sounds;if(!(null==a?void 0:a.enable)||!o.canvas.element)return;o.muted=!0,this._muteImg=document.createElement("img"),this._unmuteImg=document.createElement("img"),this._volumeDownImg=document.createElement("img"),this._volumeUpImg=document.createElement("img");const r=this._muteImg,l=this._unmuteImg,c=this._volumeDownImg,h=this._volumeUpImg,d=o.canvas.element.offsetTop,u=o.canvas.element.offsetLeft+o.canvas.element.offsetWidth,p=a.icons,v=p.mute,m=p.unmute,f=p.volumeDown,y=p.volumeUp,g=10;bs(r,d+g,u-30-v.width-f.width-y.width,"block",n.fullScreen.zIndex+1,v.width,g),bs(l,d+g,u-30-m.width-f.width-y.width,"none",n.fullScreen.zIndex+1,m.width,g),bs(c,d+g,u-20-f.width-y.width,"block",n.fullScreen.zIndex+1,f.width,g),bs(h,d+g,u-g-y.width,"block",n.fullScreen.zIndex+1,y.width,g),r.src=null!==(t=v.path)&&void 0!==t?t:v.svg?`data:image/svg+xml;base64,${btoa(v.svg)}`:"",l.src=null!==(i=m.path)&&void 0!==i?i:m.svg?`data:image/svg+xml;base64,${btoa(m.svg)}`:"",c.src=null!==(e=f.path)&&void 0!==e?e:f.svg?`data:image/svg+xml;base64,${btoa(f.svg)}`:"",h.src=null!==(s=y.path)&&void 0!==s?s:y.svg?`data:image/svg+xml;base64,${btoa(y.svg)}`:"";const w=o.canvas.element.parentNode||document.body;w.append(r),w.append(l),w.append(c),w.append(h);const b=()=>{o.muted=!o.muted,this._updateMuteIcons(),this._updateMuteStatus()};r.addEventListener("click",b),l.addEventListener("click",b),c.addEventListener("click",(()=>{o.muted&&(this._volume=0),this._volume-=a.volume.step,this._updateVolume()})),h.addEventListener("click",(()=>{o.muted&&(this._volume=0),this._volume+=a.volume.step,this._updateVolume()}))}stop(){this._container.muted=!0,this._mute(),this._muteImg&&this._muteImg.remove(),this._unmuteImg&&this._unmuteImg.remove(),this._volumeDownImg&&this._volumeDownImg.remove(),this._volumeUpImg&&this._volumeUpImg.remove()}_addBuffer(t){const i=t.createBufferSource();return this._audioSources.push(i),i}_addOscillator(t){const i=t.createOscillator();return this._audioSources.push(i),i}_initEvents(){const t=this._container,i=t.actualOptions.sounds;if((null==i?void 0:i.enable)&&t.canvas.element)for(const t of i.events){const i=async e=>{if(this._container===e.container)if(!this._container||this._container.muted||this._container.destroyed)Z(t.event,(t=>{this._engine.removeEventListener(t,i)}));else if(!t.filter||t.filter(e))if(t.audio)this._playBuffer(Q(t.audio));else if(t.melodies){const i=B(t.melodies);i.melodies.length?await Promise.allSettled(i.melodies.map((t=>this._playNote(t.notes,0,i.loop)))):await this._playNote(i.notes,0,i.loop)}else if(t.notes){const i=B(t.notes);await this._playNote([i],0,!1)}};Z(t.event,(t=>{this._engine.addEventListener(t,i)}))}}_mute(){const t=this._container;if(t.audioContext){for(const t of this._audioSources)this._removeAudioSource(t);this._gain&&this._gain.disconnect(),t.audioContext.close(),t.audioContext=void 0,this._engine.dispatchEvent("soundsMuted",{container:this._container})}}_playBuffer(t){var i;const e=this._audioMap.get(t.source);if(!e)return;const s=this._container.audioContext;if(!s)return;const o=this._addBuffer(s);o.loop=t.loop,o.buffer=e,o.connect(null!==(i=this._gain)&&void 0!==i?i:s.destination),o.start()}async _playFrequency(t,i){if(!this._container.audioContext||!this._gain)return;const e=this._addOscillator(this._container.audioContext);return e.connect(this._gain),e.type="sine",e.frequency.value=t,e.start(),new Promise((t=>{setTimeout((()=>{this._removeAudioSource(e),t()}),i)}))}_playMuteSound(){const t=this._container;if(!t.audioContext)return;const i=t.audioContext.createGain();i.connect(t.audioContext.destination),i.gain.value=0;const e=t.audioContext.createOscillator();e.connect(i),e.type="sine",e.frequency.value=1,e.start(),setTimeout((()=>{e.stop(),e.disconnect(),i.disconnect()}))}async _playNote(t,i,e){if(this._container.muted)return;const s=t[i];if(!s)return;const o=Z(s.value,(async(e,s)=>this._playNoteValue(t,i,s)));await(o instanceof Array?Promise.allSettled(o):o);let n=i+1;e&&n>=t.length&&(n%=t.length),this._container.muted||await this._playNote(t,n,e)}async _playNoteValue(t,i,e){const s=t[i];if(!s)return;const o=Q(s.value,e,!0);try{const t=ws(o);if("number"!=typeof t)return;await this._playFrequency(t,s.duration)}catch(t){console.error(t)}}_removeAudioSource(t){t.stop(),t.disconnect(),this._audioSources.splice(this._audioSources.indexOf(t),1)}_unmute(){const t=this._container,i=t.actualOptions.sounds;if(!i)return;t.audioContext||(t.audioContext=new AudioContext),this._audioSources||(this._audioSources=[]);const e=t.audioContext.createGain();e.connect(t.audioContext.destination),e.gain.value=i.volume.value/100,this._gain=e,this._initEvents(),this._engine.dispatchEvent("soundsUnmuted",{container:this._container})}_updateMuteIcons(){const t=this._container,i=this._muteImg,e=this._unmuteImg;i&&(i.style.display=t.muted?"block":"none"),e&&(e.style.display=t.muted?"none":"block")}_updateMuteStatus(){this._container.muted?this._mute():(this._unmute(),this._playMuteSound())}_updateVolume(){var t;const i=this._container,e=i.actualOptions.sounds;if(!(null==e?void 0:e.enable))return;d(this._volume,e.volume.min,e.volume.max);let s=!1;this._volume<=0&&!i.muted?(this._volume=0,i.muted=!0,s=!0):this._volume>0&&i.muted&&(i.muted=!1,s=!0),s&&(this._updateMuteIcons(),this._updateMuteStatus()),(null===(t=this._gain)||void 0===t?void 0:t.gain)&&(this._gain.gain.value=this._volume/100)}}class _s{constructor(t){this.id="sounds",this._engine=t}getPlugin(t){return new xs(t,this._engine)}loadOptions(t,i){if(!this.needsPlugin(t)&&!this.needsPlugin(i))return;let e=t.sounds;void 0===(null==e?void 0:e.load)&&(t.sounds=e=new ys),e.load(null==i?void 0:i.sounds)}needsPlugin(t){var i,e;return null!==(e=null===(i=null==t?void 0:t.sounds)||void 0===i?void 0:i.enable)&&void 0!==e&&e}}function zs(t,i,e,s,o){var n,a;const r=i;if(!r||!r.enable||void 0!==r.loops&&void 0!==r.maxLoops&&r.maxLoops>0&&r.loops>=r.maxLoops)return;const l=p(e.offset),c=(null!==(n=i.velocity)&&void 0!==n?n:0)*t.factor+3.6*l,h=null!==(a=i.decay)&&void 0!==a?a:1;o&&"increasing"!==r.status?(r.value-=c,r.value<0&&(r.loops||(r.loops=0),r.loops++,r.status="increasing",r.value+=r.value)):(r.value+=c,r.value>s&&(r.loops||(r.loops=0),r.loops++,o&&(r.status="decreasing",r.value-=r.value%s))),r.velocity&&1!==h&&(r.velocity*=h),r.value>s&&(r.value%=s)}class Ms{constructor(t){this.container=t}init(t){var i,e,s;const o=this.container,n=Q(t.options.stroke,t.id,t.options.reduceDuplicates);t.strokeWidth=v(n.width)*o.retina.pixelRatio,t.strokeOpacity=v(null!==(i=n.opacity)&&void 0!==i?i:1),t.strokeAnimation=null===(e=n.color)||void 0===e?void 0:e.animation;const a=null!==(s=ct(n.color))&&void 0!==s?s:t.getFillColor();a&&(t.strokeColor=_t(a,t.strokeAnimation,o.retina.reduceFactor))}isEnabled(t){var i,e,s;const o=t.strokeAnimation;return!t.destroyed&&!t.spawning&&!!o&&(void 0!==(null===(i=t.strokeColor)||void 0===i?void 0:i.h.value)&&t.strokeColor.h.enable||void 0!==(null===(e=t.strokeColor)||void 0===e?void 0:e.s.value)&&t.strokeColor.s.enable||void 0!==(null===(s=t.strokeColor)||void 0===s?void 0:s.l.value)&&t.strokeColor.l.enable)}update(t,i){this.isEnabled(t)&&function(t,i){if(!t.strokeColor||!t.strokeAnimation)return;const e=t.strokeColor.h;e&&zs(i,e,t.strokeAnimation.h,360,!1);const s=t.strokeColor.s;s&&zs(i,s,t.strokeAnimation.s,100,!0);const o=t.strokeColor.l;o&&zs(i,o,t.strokeAnimation.l,100,!0)}(t,i)}}let Cs=!1,Ps=!1;const ks=t=>"line"===t.data.particle.shape;class Ss{constructor(t){this._container=t}pause(){this._container.pause()}play(){this._container.play()}stop(){this._container.stop()}}async function Os(){if(!Cs){if(Ps)return new Promise((t=>{const i=setInterval((()=>{Cs&&(clearInterval(i),t())}),100)}));Ps=!0,await async function(t){t.addMover("base",(()=>new Ie))}(Ce),await async function(t){t.emitterShapeManager||(t.emitterShapeManager=new Xe(t)),t.addEmitterShape||(t.addEmitterShape=(i,e)=>{var s;null===(s=t.emitterShapeManager)||void 0===s||s.addShape(i,e)});const i=new Ze(t);await t.addPlugin(i),t.addEmitterShape("circle",new Ue),t.addEmitterShape("square",new Je)}(Ce),await async function(t){const i=new _s(t);await t.addPlugin(i)}(Ce),await async function(t){await t.addShape("circle",new Ee)}(Ce),await async function(t){await t.addShape("line",new es)}(Ce),await async function(t){await t.addParticleUpdater("rotate",(t=>new Oe(t)))}(Ce),await async function(t){await t.addParticleUpdater("color",(t=>new De(t)))}(Ce),await async function(t){await t.addParticleUpdater("destroy",(i=>new Be(t,i)))}(Ce),await async function(t){await t.addParticleUpdater("life",(t=>new is(t)))}(Ce),await async function(t){await t.addParticleUpdater("opacity",(t=>new ss(t)))}(Ce),await async function(t){await t.addParticleUpdater("outModes",(t=>new ls(t)))}(Ce),await async function(t){await t.addParticleUpdater("size",(()=>new cs))}(Ce),await async function(t){await t.addParticleUpdater("strokeColor",(t=>new Ms(t)))}(Ce),Ps=!1,Cs=!0}}async function Is(t,i){let e;await Os();const s=new Pe;"string"==typeof t?(e=t,s.load(i)):(e="fireworks",s.load(t));const o={detectRetina:!0,background:{color:"#000"},fpsLimit:120,emitters:{direction:"top",life:{count:0,duration:.1,delay:.1},rate:{delay:"number"==typeof s.rate?1/s.rate:{min:1/m(s.rate),max:1/f(s.rate)},quantity:1},size:{width:100,height:0},position:{y:100,x:50}},particles:{number:{value:0},color:{value:s.colors},destroy:{mode:"split",bounds:{top:y(s.minHeight)},split:{sizeOffset:!1,count:1,factor:{value:.333333},rate:{value:s.splitCount},colorOffset:{s:s.saturation,l:s.brightness},particles:{stroke:{width:0},number:{value:0},opacity:{value:{min:.1,max:1},animation:{enable:!0,speed:.7,sync:!1,startValue:"max",destroy:"min"}},shape:{type:"circle"},size:{value:{min:1,max:2},animation:{enable:!0,speed:5,count:1,sync:!1,startValue:"min",destroy:"none"}},life:{count:1,duration:{value:{min:.25,max:.5}}},move:{decay:{min:.05,max:.1},enable:!0,gravity:{enable:!0,inverse:!1,acceleration:y(s.gravity)},speed:y(s.speed),direction:"none",outModes:"destroy"}}}},life:{count:1},shape:{type:"line"},size:{value:{min:.1,max:50},animation:{enable:!0,sync:!0,speed:90,startValue:"max",destroy:"min"}},stroke:{color:{value:"#ffffff"},width:.5},rotate:{path:!0},move:{enable:!0,gravity:{acceleration:15,enable:!0,inverse:!0,maxSpeed:100},speed:{min:10,max:20},outModes:{default:"destroy",top:"none"},trail:{fillColor:"#000",enable:!0,length:10}}},sounds:{enable:s.sounds,events:[{event:"particleRemoved",filter:ks,audio:["https://particles.js.org/audio/explosion0.mp3","https://particles.js.org/audio/explosion1.mp3","https://particles.js.org/audio/explosion2.mp3"]}],volume:50}},n=await Ce.load(e,o);if(n)return new Ss(n)}return i})()));
\No newline at end of file