"use strict";(globalThis.webpackChunkwordpress_particles=globalThis.webpackChunkwordpress_particles||[]).push([[8721],{8721:(e,l,a)=>{a.r(l),a.d(l,{loadRollUpdater:()=>i});var o=a(3290);class n{constructor(){this.enable=!1,this.value=0}load(e){e&&(void 0!==e.enable&&(this.enable=e.enable),void 0!==e.value&&(this.value=(0,o.Cs)(e.value)))}}class r{constructor(){this.darken=new n,this.enable=!1,this.enlighten=new n,this.mode="vertical",this.speed=25}load(e){e&&(void 0!==e.backColor&&(this.backColor=o.Oz.create(this.backColor,e.backColor)),this.darken.load(e.darken),void 0!==e.enable&&(this.enable=e.enable),this.enlighten.load(e.enlighten),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.speed&&(this.speed=(0,o.Cs)(e.speed)))}}class t{getTransformValues(e){var l;const a=(null===(l=e.roll)||void 0===l?void 0:l.enable)&&e.roll,o=a&&a.horizontal,n=a&&a.vertical;return{a:o?Math.cos(a.angle):void 0,d:n?Math.sin(a.angle):void 0}}init(e){const l=e.options.roll;if(null==l?void 0:l.enable)if(e.roll={enable:l.enable,horizontal:"horizontal"===l.mode||"both"===l.mode,vertical:"vertical"===l.mode||"both"===l.mode,angle:(0,o.sZ)()*Math.PI*2,speed:(0,o.Gu)(l.speed)/360},l.backColor)e.backColor=(0,o.lN)(l.backColor);else if(l.darken.enable&&l.enlighten.enable){const a=(0,o.sZ)()>=.5?"darken":"enlighten";e.roll.alter={type:a,value:(0,o.Gu)("darken"===a?l.darken.value:l.enlighten.value)}}else l.darken.enable?e.roll.alter={type:"darken",value:(0,o.Gu)(l.darken.value)}:l.enlighten.enable&&(e.roll.alter={type:"enlighten",value:(0,o.Gu)(l.enlighten.value)});else e.roll={enable:!1,horizontal:!1,vertical:!1,angle:0,speed:0}}isEnabled(e){const l=e.options.roll;return!e.destroyed&&!e.spawning&&!!(null==l?void 0:l.enable)}loadOptions(e){e.roll||(e.roll=new r);for(var l=arguments.length,a=new Array(l>1?l-1:0),o=1;o<l;o++)a[o-1]=arguments[o];for(const l of a)e.roll.load(null==l?void 0:l.roll)}update(e,l){this.isEnabled(e)&&function(e,l){const a=e.options.roll;if(!e.roll||!(null==a?void 0:a.enable))return;const o=e.roll.speed*l.factor,n=2*Math.PI;e.roll.angle+=o,e.roll.angle>n&&(e.roll.angle-=n)}(e,l)}}async function i(e){await e.addParticleUpdater("roll",(()=>new t))}}}]);