"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[1859,2687],{2687(e,n,t){t.d(n,{loadBranchesPath:()=>o});var a=t(1859),i=t(3199);const s={segmentLength:20,branchChance:.2,maxAngle:Math.PI/3,speedVariation:.3,inertia:{enable:!1,factor:.1}};class r{options;#e;#n;constructor(e){this.#e=e,this.#n=i.Miz.origin,this.options={...s,inertia:{...s.inertia}}}generate(e){const n=this.options;e.branching??={angle:(0,i.G0i)()*i.R1e,remaining:n.segmentLength,baseSpeed:e.velocity.length,speed:e.velocity.length};const t=e.branching;if(t.remaining<=0){const e=(0,i.G0i)()<(n.branchChance??0),a=n.maxAngle??s.maxAngle,r=(2*(0,i.G0i)()-1)*(e?a:.3*a);t.angle+=r,t.remaining=n.segmentLength;const o=1+(2*(0,i.G0i)()-1)*(n.speedVariation??0);t.speed=t.baseSpeed*o}t.remaining-=t.speed;const a=Math.cos(t.angle)*t.speed,r=Math.sin(t.angle)*t.speed,o=n.inertia;if(o?.enable){const n=o.factor??.1;e.velocity.x+=(a-e.velocity.x)*n,e.velocity.y+=(r-e.velocity.y)*n,this.#n.x=e.velocity.x,this.#n.y=e.velocity.y}else e.velocity.x=0,e.velocity.y=0,this.#n.x=a,this.#n.y=r;return this.#n}init(){const e=this.#e.actualOptions.particles.move.path.options;this.options.segmentLength=e.segmentLength??this.options.segmentLength,this.options.branchChance=e.branchChance??this.options.branchChance,this.options.maxAngle=e.maxAngle??this.options.maxAngle,this.options.speedVariation=e.speedVariation??this.options.speedVariation;const n=e.inertia;if(n){const e={...s.inertia};e.enable=n.enable??e.enable,e.factor=n.factor??e.factor,this.options.inertia=e}}reset(e){delete e.branching}update(){}}async function o(e){e.checkVersion("4.1.3"),await e.pluginManager.register(e=>{(0,a.g)(e),e.pluginManager.addPathGenerator?.("branchesPathGenerator",e=>Promise.resolve(new r(e)))})}},1859(e,n,t){t.d(n,{g:()=>r,loadMovePlugin:()=>s});var a=t(3199);class i{id="move";#t;constructor(e){this.#t=e}async getPlugin(e){const{MovePluginInstance:n}=await t.e(5272).then(t.bind(t,5272));return new n(this.#t,e)}loadOptions(){}needsPlugin(){return!0}}async function s(e){e.checkVersion("4.1.3"),await e.pluginManager.register(e=>{const n=e.pluginManager;n.initializers.pathGenerators??=new Map,n.pathGenerators??=new Map,n.addPathGenerator=(e,t)=>{n.initializers.pathGenerators??=new Map,n.initializers.pathGenerators.set(e,t)},n.getPathGenerators=async(e,t=!1)=>(n.initializers.pathGenerators??=new Map,n.pathGenerators??=new Map,(0,a.OtU)(e,n.pathGenerators,n.initializers.pathGenerators,t)),e.pluginManager.addPlugin(new i(e.pluginManager))})}function r(e){if(!e.pluginManager.addPathGenerator)throw new Error("tsParticles Base Mover is not loaded")}}}]);