"use strict";(self.webpackChunkwordpress_particles=self.webpackChunkwordpress_particles||[]).push([[9219],{9219:function(e,t,n){n.r(t),n.d(t,{Bounce:function(){return i},loadExternalBounceInteraction:function(){return c}});var o=n(3563);class i{constructor(){this.distance=200}load(e){e&&void 0!==e.distance&&(this.distance=e.distance)}}class s extends o.L8{constructor(e){super(e)}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.bounce;t&&(e.retina.bounceModeDistance=t.distance*e.retina.pixelRatio)}async interact(){const e=this.container,t=e.actualOptions.interactivity.events,n=e.interactivity.status===o.Wt,i=t.onHover.enable,s=t.onHover.mode,c=t.onDiv;n&&i&&(0,o.dB)("bounce",s)?this.processMouseBounce():(0,o.XD)("bounce",c,((e,t)=>this.singleSelectorBounce(e,t)))}isEnabled(e){var t;const n=this.container,i=n.actualOptions,s=n.interactivity.mouse,c=(null!==(t=null==e?void 0:e.interactivity)&&void 0!==t?t:i.interactivity).events,r=c.onDiv;return s.position&&c.onHover.enable&&(0,o.dB)("bounce",c.onHover.mode)||(0,o.wm)("bounce",r)}loadModeOptions(e){e.bounce||(e.bounce=new i);for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];for(const t of n)e.bounce.load(null==t?void 0:t.bounce)}reset(){}processBounce(e,t,n){const i=this.container.particles.quadTree.query(n,(e=>this.isEnabled(e)));for(const s of i)n instanceof o.Cd?(0,o.kR)((0,o.gy)(s),{position:e,radius:t,mass:t**2*Math.PI/2,velocity:o.OW.origin,factor:o.OW.origin}):n instanceof o.Ae&&(0,o.dp)(s,(0,o.M_)(e,t))}processMouseBounce(){const e=this.container,t=10*e.retina.pixelRatio,n=e.interactivity.mouse.position,i=e.retina.bounceModeDistance;!i||i<0||!n||this.processBounce(n,i,new o.Cd(n.x,n.y,i+t))}singleSelectorBounce(e,t){const n=this.container,i=document.querySelectorAll(e);i.length&&i.forEach((e=>{const i=e,s=n.retina.pixelRatio,c={x:(i.offsetLeft+i.offsetWidth/2)*s,y:(i.offsetTop+i.offsetHeight/2)*s},r=i.offsetWidth/2*s,a=10*s,u="circle"===t.type?new o.Cd(c.x,c.y,r+a):new o.Ae(i.offsetLeft*s-a,i.offsetTop*s-a,i.offsetWidth*s+2*a,i.offsetHeight*s+2*a);this.processBounce(c,r,u)}))}}async function c(e){await e.addInteractor("externalBounce",(e=>new s(e)))}}}]);