"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[1999],{1999:(s,t,e)=>{e.d(t,{loadEmittersShapePolygon:()=>y});var n=e(1814),o=e(9201);function i(s,t,e,n=0){const o=[],i=2*Math.PI/t;for(let r=0;r<t;r++){const t=i*r+n;o.push({x:s.x+e*Math.cos(t),y:s.y+e*Math.sin(t)})}return o}function r(s,t){let e=!1;for(let n=0,o=t.length-1;n<t.length;o=n++){const i=t[n],r=t[o];i.y>s.y!=r.y>s.y&&s.x<(r.x-i.x)*(s.y-i.y)/(r.y-i.y)+i.x&&(e=!e)}return e}class a extends n.F{constructor(s,t,e,n){super(s,t,e,n),this.sides=n.sides,this.angle=n.angle*Math.PI/180,this.polygon=i(s,this.sides,t.width/2,this.angle)}async init(){}async randomPosition(){const s=this.fill,t=this.polygon,e=s?function(s){const t={...s[0]},e={...s[0]};for(const n of s)n.x<t.x&&(t.x=n.x),n.x>e.x&&(e.x=n.x),n.y<t.y&&(t.y=n.y),n.y>e.y&&(e.y=n.y);let n=null;for(let i=0;i<100;i++){const i={x:t.x+(0,o.sZ)()*(e.x-t.x),y:t.y+(0,o.sZ)()*(e.y-t.y)};if(r(i,s)){n=i;break}}return n}(t):function(s){const t=Math.floor((0,o.sZ)()*s.length),e=s[t],n=s[(t+1)%s.length],i=(0,o.sZ)();return{x:e.x+(n.x-e.x)*i,y:e.y+(n.y-e.y)*i}}(t);return e?{position:e}:null}resize(s,t){super.resize(s,t),this.polygon=i(s,this.sides,t.width/2,this.angle)}}class l{constructor(){this.angle=0,this.sides=5}load(s){s&&(void 0!==s.angle&&(this.angle=s.angle),void 0!==s.sides&&(this.sides=s.sides))}}class h{generate(s,t,e,n){const o=new l;return o.load(n),new a(s,t,e,o)}}async function y(s,t=!0){const e=s;e.addEmitterShapeGenerator&&e.addEmitterShapeGenerator("polygon",new h),await e.refresh(t)}}}]);