"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[806],{806:(t,i,a)=>{a.d(i,{loadExternalAttractInteraction:()=>o});var e=a(9201);class c{constructor(){this.distance=200,this.duration=.4,this.easing="ease-out-quad",this.factor=1,this.maxSpeed=50,this.speed=1}load(t){t&&(void 0!==t.distance&&(this.distance=t.distance),void 0!==t.duration&&(this.duration=t.duration),void 0!==t.easing&&(this.easing=t.easing),void 0!==t.factor&&(this.factor=t.factor),void 0!==t.maxSpeed&&(this.maxSpeed=t.maxSpeed),void 0!==t.speed&&(this.speed=t.speed))}}const s="attract";class n extends e.L8{constructor(t,i){super(i),this._clickAttract=()=>{const t=this.container;t.attract||(t.attract={particles:[]});const{attract:i}=t;if(i.finish||(i.count||(i.count=0),i.count++,i.count===t.particles.count&&(i.finish=!0)),i.clicking){const i=t.interactivity.mouse.clickPosition,a=t.retina.attractModeDistance;if(!a||a<0||!i)return;this._processAttract(i,a,new e.Cd(i.x,i.y,a))}else!1===i.clicking&&(i.particles=[])},this._hoverAttract=()=>{const t=this.container,i=t.interactivity.mouse.position,a=t.retina.attractModeDistance;!a||a<0||!i||this._processAttract(i,a,new e.Cd(i.x,i.y,a))},this._processAttract=(t,i,a)=>{const c=this.container,s=c.actualOptions.interactivity.modes.attract;if(!s)return;const n=c.particles.quadTree.query(a,(t=>this.isEnabled(t)));for(const a of n){const{dx:c,dy:n,distance:o}=(0,e.oW)(a.position,t),r=s.speed*s.factor,d=(0,e.uZ)((0,e._X)(s.easing)(1-o/i)*r,0,s.maxSpeed),l=e.OW.create(0===o?r:c/o*d,0===o?r:n/o*d);a.position.subFrom(l)}},this._engine=t,i.attract||(i.attract={particles:[]}),this.handleClickMode=t=>{const a=this.container.actualOptions.interactivity.modes.attract;if(a&&t===s){i.attract||(i.attract={particles:[]}),i.attract.clicking=!0,i.attract.count=0;for(const t of i.attract.particles)this.isEnabled(t)&&t.velocity.setTo(t.initialVelocity);i.attract.particles=[],i.attract.finish=!1,setTimeout((()=>{i.destroyed||(i.attract||(i.attract={particles:[]}),i.attract.clicking=!1)}),1e3*a.duration)}}}clear(){}init(){const t=this.container,i=t.actualOptions.interactivity.modes.attract;i&&(t.retina.attractModeDistance=i.distance*t.retina.pixelRatio)}async interact(){const t=this.container,i=t.actualOptions,a=t.interactivity.status===e.Wt,c=i.interactivity.events,n=c.onHover.enable,o=c.onHover.mode,r=c.onClick.enable,d=c.onClick.mode;a&&n&&(0,e.dB)(s,o)?this._hoverAttract():r&&(0,e.dB)(s,d)&&this._clickAttract()}isEnabled(t){const i=this.container,a=i.actualOptions,c=i.interactivity.mouse,n=(t?.interactivity??a.interactivity).events;if(!(c.position&&n.onHover.enable||c.clickPosition&&n.onClick.enable))return!1;const o=n.onHover.mode,r=n.onClick.mode;return(0,e.dB)(s,o)||(0,e.dB)(s,r)}loadModeOptions(t,...i){t.attract||(t.attract=new c);for(const a of i)t.attract.load(a?.attract)}reset(){}}async function o(t,i=!0){await t.addInteractor("externalAttract",(i=>new n(t,i)),i)}}}]);