"use strict";(globalThis.webpackChunkwordpress_particles=globalThis.webpackChunkwordpress_particles||[]).push([[585],{585:(t,i,s)=>{s.r(i),s.d(i,{Light:()=>r,LightArea:()=>e,LightGradient:()=>a,LightShadow:()=>n,loadLightInteraction:()=>h});var o=s(3290);class a{constructor(){this.start=new o.Oz,this.stop=new o.Oz,this.start.value="#ffffff",this.stop.value="#000000"}load(t){t&&(this.start=o.Oz.create(this.start,t.start),this.stop=o.Oz.create(this.stop,t.stop))}}class e{constructor(){this.gradient=new a,this.radius=1e3}load(t){t&&(this.gradient.load(t.gradient),void 0!==t.radius&&(this.radius=t.radius))}}class n{constructor(){this.color=new o.Oz,this.color.value="#000000",this.length=2e3}load(t){t&&(this.color=o.Oz.create(this.color,t.color),void 0!==t.length&&(this.length=t.length))}}class r{constructor(){this.area=new e,this.shadow=new n}load(t){t&&(this.area.load(t.area),this.shadow.load(t.shadow))}}class c extends o.L8{constructor(t){super(t)}clear(){}init(){}async interact(){const t=this.container;if(t.actualOptions.interactivity.events.onHover.enable&&"pointermove"===t.interactivity.status){const i=t.interactivity.mouse.position;if(!i)return;t.canvas.draw((s=>{!function(t,i,s){var a;const e=null===(a=t.actualOptions.interactivity.modes.light)||void 0===a?void 0:a.area;if(!e)return;i.beginPath(),i.arc(s.x,s.y,e.radius,0,2*Math.PI);const n=i.createRadialGradient(s.x,s.y,0,s.x,s.y,e.radius),r=t.canvas.mouseLight;r&&r.start&&r.stop&&(n.addColorStop(0,(0,o.iz)(r.start)),n.addColorStop(1,(0,o.iz)(r.stop)),i.fillStyle=n,i.fill())}(t,s,i)}))}}isEnabled(t){var i;const s=this.container,a=s.interactivity.mouse,e=null!==(i=null==t?void 0:t.interactivity)&&void 0!==i?i:s.actualOptions.interactivity,n=e.events;if(!n.onHover.enable||!a.position)return!1;const r=(0,o.dB)("light",n.onHover.mode);if(r&&e.modes.light){const t=e.modes.light.area.gradient;s.canvas.mouseLight={start:(0,o.tX)(t.start),stop:(0,o.tX)(t.stop)}}return r}loadModeOptions(t){t.light||(t.light=new r);for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];for(const i of s)t.light.load(null==i?void 0:i.light)}reset(){}}class l extends o.$S{constructor(t){super(t)}clear(){}init(){}async interact(t){const i=this.container;if(i.actualOptions.interactivity.events.onHover.enable&&"pointermove"===i.interactivity.status){const s=this.container.interactivity.mouse.position;s&&i.canvas.draw((a=>{!function(t,i,s,a){var e;const n=s.getPosition(),r=null===(e=t.actualOptions.interactivity.modes.light)||void 0===e?void 0:e.shadow;if(!r)return;const c=s.lightShadow;if(!c)return;const l=s.getRadius(),h=s.sides,d=2*Math.PI/h,u=-s.rotation+Math.PI/4,v=[];for(let t=0;t<h;t++)v.push({x:n.x+l*Math.sin(u+d*t)*1,y:n.y+l*Math.cos(u+d*t)*1});const g=[],p=r.length;for(const t of v){const i=Math.atan2(a.y-t.y,a.x-t.x),s=t.x+p*Math.sin(-i-Math.PI/2),o=t.y+p*Math.cos(-i-Math.PI/2);g.push({endX:s,endY:o,startX:t.x,startY:t.y})}const f=(0,o.iz)(c);for(let t=g.length-1;t>=0;t--){const s=t===g.length-1?0:t+1;i.beginPath(),i.moveTo(g[t].startX,g[t].startY),i.lineTo(g[s].startX,g[s].startY),i.lineTo(g[s].endX,g[s].endY),i.lineTo(g[t].endX,g[t].endY),i.fillStyle=f,i.fill()}}(i,a,t,s)}))}}isEnabled(t){var i;const s=this.container,a=null!==(i=t.interactivity)&&void 0!==i?i:s.actualOptions.interactivity,e=s.interactivity.mouse,n=a.events;if(!n.onHover.enable||!e.position)return!1;const r=(0,o.dB)("light",n.onHover.mode);if(r&&a.modes.light){const i=a.modes.light.shadow;t.lightShadow=(0,o.tX)(i.color)}return r}reset(){}}function h(t){t.addInteractor("externalLight",(t=>new c(t))),t.addInteractor("particlesLight",(t=>new l(t)))}}}]);