"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[2038],{2038:(i,e,t)=>{t.d(e,{loadBaseMover:()=>o});var n=t(9201);class a{constructor(){this._initSpin=i=>{const e=i.container,t=i.options.move.spin;if(!t.enable)return;const a=t.position??{x:50,y:50},o={x:.01*a.x*e.canvas.size.width,y:.01*a.y*e.canvas.size.height},s=i.getPosition(),c=(0,n.Sp)(s,o),r=(0,n.Gu)(t.acceleration);i.retina.spinAcceleration=r*e.retina.pixelRatio,i.spin={center:o,direction:i.velocity.x>=0?"clockwise":"counter-clockwise",angle:i.velocity.angle,radius:c,acceleration:i.retina.spinAcceleration}}}init(i){const e=i.options.move.gravity;i.gravity={enable:e.enable,acceleration:(0,n.Gu)(e.acceleration),inverse:e.inverse},this._initSpin(i)}isEnabled(i){return!i.destroyed&&i.options.move.enable}move(i,e){const t=i.options,a=t.move;if(!a.enable)return;const o=i.container,s=o.retina.pixelRatio,c=function(i){return i.slow.inRange?i.slow.factor:1}(i),r=(i.retina.moveSpeed??=(0,n.Gu)(a.speed)*s)*o.retina.reduceFactor,l=i.retina.moveDrift??=(0,n.Gu)(i.options.move.drift)*s,p=(0,n.KI)(t.size.value)*s,y=r*(a.size?i.getRadius()/p:1)*c*(e.factor||1)/2,v=i.retina.maxSpeed??o.retina.maxSpeed;a.spin.enable?function(i,e){const t=i.container;if(!i.spin)return;const n={x:"clockwise"===i.spin.direction?Math.cos:Math.sin,y:"clockwise"===i.spin.direction?Math.sin:Math.cos};i.position.x=i.spin.center.x+i.spin.radius*n.x(i.spin.angle),i.position.y=i.spin.center.y+i.spin.radius*n.y(i.spin.angle),i.spin.radius+=i.spin.acceleration;const a=Math.max(t.canvas.size.width,t.canvas.size.height),o=.5*a;i.spin.radius>o?(i.spin.radius=o,i.spin.acceleration*=-1):i.spin.radius<0&&(i.spin.radius=0,i.spin.acceleration*=-1),i.spin.angle+=.01*e*(1-i.spin.radius/a)}(i,y):function(i,e,t,a,o,s){!function(i,e){const t=i.options.move.path;if(!t.enable)return;if(i.lastPathTime<=i.pathDelay)return void(i.lastPathTime+=e.value);const a=i.pathGenerator?.generate(i,e);a&&i.velocity.addTo(a),t.clamp&&(i.velocity.x=(0,n.uZ)(i.velocity.x,-1,1),i.velocity.y=(0,n.uZ)(i.velocity.y,-1,1)),i.lastPathTime-=i.pathDelay}(i,s);const c=i.gravity,r=c?.enable&&c.inverse?-1:1;o&&t&&(i.velocity.x+=o*s.factor/(60*t)),c?.enable&&t&&(i.velocity.y+=r*(c.acceleration*s.factor)/(60*t));const l=i.moveDecay;i.velocity.multTo(l);const p=i.velocity.mult(t);c?.enable&&a>0&&(!c.inverse&&p.y>=0&&p.y>=a||c.inverse&&p.y<=0&&p.y<=-a)&&(p.y=r*a,t&&(i.velocity.y=p.y/t));const y=i.options.zIndex,v=(1-i.zIndexFactor)**y.velocityRate;p.multTo(v);const{position:d}=i;d.addTo(p),e.vibrate&&(d.x+=Math.sin(d.x*Math.cos(d.y)),d.y+=Math.cos(d.y*Math.sin(d.x)))}(i,a,y,v,l,e),function(i){const e=i.initialPosition,{dx:t,dy:a}=(0,n.oW)(e,i.position),o=Math.abs(t),s=Math.abs(a),{maxDistance:c}=i.retina,r=c.horizontal,l=c.vertical;if(r||l)if((r&&o>=r||l&&s>=l)&&!i.misplaced)i.misplaced=!!r&&o>r||!!l&&s>l,r&&(i.velocity.x=.5*i.velocity.y-i.velocity.x),l&&(i.velocity.y=.5*i.velocity.x-i.velocity.y);else if((!r||o<r)&&(!l||s<l)&&i.misplaced)i.misplaced=!1;else if(i.misplaced){const t=i.position,a=i.velocity;r&&(t.x<e.x&&a.x<0||t.x>e.x&&a.x>0)&&(a.x*=-(0,n.sZ)()),l&&(t.y<e.y&&a.y<0||t.y>e.y&&a.y>0)&&(a.y*=-(0,n.sZ)())}}(i)}}async function o(i,e=!0){await i.addMover("base",(()=>new a),e)}}}]);