"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[5448],{5448(i,t,s){s.d(t,{AbsorberInstance:()=>r});var o=s(3199),e=s(2202);const a=o.R1e,n=o.D_O/360;class r{color;limit;mass;name;opacity;options;position;size;#i;#t;#s;#o;#e;#a;#n;#r;#h;#l;constructor(i,t,s,a){this.#i=t,this.#h=i,this.#t=0,this.#s=0,this.#n=a?o.Miz.create(a.x,a.y):void 0,s instanceof e.h?this.options=s:(this.options=new e.h,this.options.load(s)),this.name=this.options.name,this.opacity=this.options.opacity,this.size=(0,o.VGA)(this.options.size.value)*t.retina.pixelRatio,this.mass=this.size*this.options.size.density*t.retina.reduceFactor;const n=this.options.size.limit;this.limit={radius:n.radius*t.retina.pixelRatio*t.retina.reduceFactor,mass:n.mass},this.color=(0,o.BN0)(this.#h,this.options.color)??{b:0,g:0,r:0},this.position=this.#n?.copy()??this.#c(),this.#e=!this.options.life.wait,this.#r=this.options.life.count??-1,this.#a=this.#r<=0,this.#l=t.retina.reduceFactor?(0,o.VGA)(this.options.life.delay??0)*o.XuV/t.retina.reduceFactor:1/0}attract(i,t){const s=this.#i,e=this.options,a=i.getPosition(),{dx:n,dy:r,distance:h}=(0,o.vrU)(this.position,a),l=o.Miz.create(n,r);if(l.length=this.mass/Math.pow(h,o.dmB)*s.retina.reduceFactor,h<this.size+i.getRadius()){const o=.033*i.getRadius()*s.retina.pixelRatio*t.factor;this.size>i.getRadius()&&h<this.size-i.getRadius()||void 0!==i.absorberOrbit&&i.absorberOrbit.length<0?e.destroy?i.destroy():(i.needsNewPosition=!0,this.#p(i,t,l)):(e.destroy&&(i.size.value-=o),this.#p(i,t,l)),(this.limit.radius<=0||this.size<this.limit.radius)&&(this.size+=o),(this.limit.mass<=0||this.mass<this.limit.mass)&&(this.mass+=o*this.options.size.density*s.retina.reduceFactor)}else this.#p(i,t,l)}draw(i){i.translate(this.position.x,this.position.y),i.beginPath(),i.arc(o.boI.x,o.boI.y,this.size,0,a,!1),i.closePath(),i.fillStyle=(0,o.xxz)(this.color,this.#i.hdr,this.opacity),i.fill()}resize(){const i=this.#n;this.position=i&&(0,o.Tj8)(i,this.#i.canvas.size,o.Miz.origin)?i:this.#c()}update(i){this.#e&&(this.#e=!1,this.#s=this.#l??0),void 0!==this.#o&&(this.#t+=i.value,this.#t>=this.#o&&(this.#a||this.#r--,(this.#r>0||this.#a)&&(this.position=this.#c(),this.#l=this.#i.retina.reduceFactor?(0,o.VGA)(this.options.life.delay??0)*o.XuV/this.#i.retina.reduceFactor:1/0),this.#t-=this.#o,this.#o=void 0)),void 0!==this.#l&&(this.#s+=i.value,this.#s>=this.#l&&(this.#u(),this.#s-=this.#l,this.#l=void 0))}#c(){const i=(0,o.l1q)({size:this.#i.canvas.size,position:this.options.position});return o.Miz.create(i.x,i.y)}#u(){(this.#r>0||this.#a||!this.options.life.count)&&(this.#e||this.#s>=(this.#l??0))&&(this.#r>0||this.#a)&&this.#d()}#d(){const i=void 0!==this.options.life.duration?(0,o.VGA)(this.options.life.duration):void 0;(this.#r>0||this.#a)&&void 0!==i&&i>0&&(this.#o=i*o.XuV)}#p(i,t,s){if(i.destroyed)return;const e=this.#i,r=e.canvas.size;if(i.needsNewPosition){const t=(0,o.MhH)({size:r});i.position.setTo(t),i.velocity.setTo(i.initialVelocity),i.absorberOrbit=void 0,i.needsNewPosition=!1}if(this.options.orbits){if(void 0===i.absorberOrbit&&(i.absorberOrbit=o.Miz.origin,i.absorberOrbit.length=(0,o.YfF)(i.getPosition(),this.position),i.absorberOrbit.angle=(0,o.G0i)()*a),i.absorberOrbit.length<=this.size&&!this.options.destroy){const t=Math.min(r.width,r.height),s=1,e=.1,a=.2;i.absorberOrbit.length=t*(s+((0,o.G0i)()*a-e))}i.absorberOrbitDirection??=i.velocity.x>=o.GWL?o.pTR.clockwise:o.pTR.counterClockwise;const h=i.absorberOrbit.length,l=i.absorberOrbit.angle,c=i.absorberOrbitDirection;i.velocity.setTo(o.Miz.origin);const p=i.size.max,u=i.options.move.size?i.getRadius()/p:o.D_O,d=t.factor||o.D_O,b=i.retina.moveSpeed*u*d*o.MXx;i.position.x=this.position.x+h*Math.cos(l),i.position.y=this.position.y+h*(c===o.pTR.clockwise?o.D_O:-o.D_O)*Math.sin(l),i.absorberOrbit.length=Math.max(0,i.absorberOrbit.length-s.length),i.absorberOrbit.angle+=b*n*e.retina.reduceFactor}else i.velocity.addTo(s)}}}}]);