"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[7365],{7365:(e,t,s)=>{s.d(t,{loadExternalRepulseInteraction:()=>l});var i=s(9201);class o{constructor(){this.distance=200,this.duration=.4,this.factor=100,this.speed=1,this.maxSpeed=50,this.easing="ease-out-quad"}load(e){e&&(void 0!==e.distance&&(this.distance=e.distance),void 0!==e.duration&&(this.duration=e.duration),void 0!==e.easing&&(this.easing=e.easing),void 0!==e.factor&&(this.factor=e.factor),void 0!==e.speed&&(this.speed=e.speed),void 0!==e.maxSpeed&&(this.maxSpeed=e.maxSpeed))}}class n extends o{constructor(){super(),this.selectors=[]}load(e){super.load(e),e&&void 0!==e.selectors&&(this.selectors=e.selectors)}}class c extends o{load(e){super.load(e),e&&(this.divs=(0,i.KH)(e.divs,(e=>{const t=new n;return t.load(e),t})))}}const r="repulse";class a extends i.L8{constructor(e,t){super(t),this._clickRepulse=()=>{const e=this.container,t=e.actualOptions.interactivity.modes.repulse;if(!t)return;const s=e.repulse||{particles:[]};if(s.finish||(s.count||(s.count=0),s.count++,s.count===e.particles.count&&(s.finish=!0)),s.clicking){const o=e.retina.repulseModeDistance;if(!o||o<0)return;const n=Math.pow(o/6,3),c=e.interactivity.mouse.clickPosition;if(void 0===c)return;const r=new i.Cd(c.x,c.y,n),a=e.particles.quadTree.query(r,(e=>this.isEnabled(e)));for(const e of a){const{dx:o,dy:r,distance:a}=(0,i.oW)(c,e.position),l=a**2,d=-n*t.speed/l;if(l<=n){s.particles.push(e);const t=i.OW.create(o,r);t.length=d,e.velocity.setTo(t)}}}else if(!1===s.clicking){for(const e of s.particles)e.velocity.setTo(e.initialVelocity);s.particles=[]}},this._hoverRepulse=()=>{const e=this.container,t=e.interactivity.mouse.position,s=e.retina.repulseModeDistance;!s||s<0||!t||this._processRepulse(t,s,new i.Cd(t.x,t.y,s))},this._processRepulse=(e,t,s,o)=>{const n=this.container,c=n.particles.quadTree.query(s,(e=>this.isEnabled(e))),r=n.actualOptions.interactivity.modes.repulse;if(!r)return;const{easing:a,speed:l,factor:d,maxSpeed:p}=r,u=(0,i._X)(a),h=(o?.speed??l)*d;for(const s of c){const{dx:o,dy:n,distance:c}=(0,i.oW)(s.position,e),r=(0,i.uZ)(u(1-c/t)*h,0,p),a=i.OW.create(0===c?h:o/c*r,0===c?h:n/c*r);s.position.addTo(a)}},this._singleSelectorRepulse=(e,t)=>{const s=this.container,o=s.actualOptions.interactivity.modes.repulse;if(!o)return;const n=document.querySelectorAll(e);n.length&&n.forEach((e=>{const n=e,c=s.retina.pixelRatio,r={x:(n.offsetLeft+n.offsetWidth/2)*c,y:(n.offsetTop+n.offsetHeight/2)*c},a=n.offsetWidth/2*c,l="circle"===t.type?new i.Cd(r.x,r.y,a):new i.Ae(n.offsetLeft*c,n.offsetTop*c,n.offsetWidth*c,n.offsetHeight*c),d=o.divs,p=(0,i.iC)(d,n);this._processRepulse(r,a,l,p)}))},this._engine=e,t.repulse||(t.repulse={particles:[]}),this.handleClickMode=e=>{const s=this.container.actualOptions.interactivity.modes.repulse;if(!s||e!==r)return;t.repulse||(t.repulse={particles:[]});const i=t.repulse;i.clicking=!0,i.count=0;for(const e of t.repulse.particles)this.isEnabled(e)&&e.velocity.setTo(e.initialVelocity);i.particles=[],i.finish=!1,setTimeout((()=>{t.destroyed||(i.clicking=!1)}),1e3*s.duration)}}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.repulse;t&&(e.retina.repulseModeDistance=t.distance*e.retina.pixelRatio)}async interact(){const e=this.container,t=e.actualOptions,s=e.interactivity.status===i.Wt,o=t.interactivity.events,n=o.onHover,c=n.enable,a=n.mode,l=o.onClick,d=l.enable,p=l.mode,u=o.onDiv;s&&c&&(0,i.dB)(r,a)?this._hoverRepulse():d&&(0,i.dB)(r,p)?this._clickRepulse():(0,i.XD)(r,u,((e,t)=>this._singleSelectorRepulse(e,t)))}isEnabled(e){const t=this.container,s=t.actualOptions,o=t.interactivity.mouse,n=(e?.interactivity??s.interactivity).events,c=n.onDiv,a=n.onHover,l=n.onClick,d=(0,i.wm)(r,c);if(!(d||a.enable&&o.position||l.enable&&o.clickPosition))return!1;const p=a.mode,u=l.mode;return(0,i.dB)(r,p)||(0,i.dB)(r,u)||d}loadModeOptions(e,...t){e.repulse||(e.repulse=new c);for(const s of t)e.repulse.load(s?.repulse)}reset(){}}async function l(e,t=!0){await e.addInteractor("externalRepulse",(t=>new a(e,t)),t)}}}]);