"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[9032],{9032(t,e,n){n.d(e,{CanvasMaskPluginInstance:()=>a});var i=n(9306),o=n(3199);const s=t=>[...Array(t).keys()];class a{#t;constructor(t){this.#t=t}async init(){const t=this.#t,e=t.actualOptions.canvasMask;if(!e?.enable)return;let n={pixels:[],height:0,width:0};const a=e.pixels.offset;if(e.image){const o=e.image.src;if(!o)return;n=await(0,i.M5)(o,a,t.canvas.render.settings)}else if(e.text){const s=e.text,c=(0,i.iO)(s,a,s.fill,t.canvas.render.settings);if((0,o.kZJ)(c))return;n=c}else if(e.element??e.selector){const s=e.element??(e.selector&&(0,o.T5G)().querySelector(e.selector));if(!s)return;const c=s.getContext("2d",t.canvas.render.settings);if(!c)return;n=(0,i.YL)(c,s,a)}!function(t,e,n,i,a,c){const{height:r,width:l}=e,h=r*l,u=function(t){for(let e=t.length-1;e>=0;e--){const n=Math.floor((0,o.G0i)()*e),i=t[e],s=t[n];s!==i&&void 0!==s&&void 0!==i&&(t[e]=s,t[n]=i)}return t}(s(h)),g=Math.min(h,t.actualOptions.particles.number.value),x=t.canvas.size;let f=0;const d=x.width*n.x/o.a56-l*i*o.MXx,p=x.height*n.y/o.a56-r*i*o.MXx;for(;f<g&&u.length;){const n=0,o=u.pop()??n,s={x:o%l,y:Math.floor(o/l)},r=e.pixels[s.y];if(!r)continue;const h=r[s.x];if(!h)continue;if(!c(h))continue;const g={x:s.x*i+d,y:s.y*i+p},x={};a.color&&(x.paint={fill:{color:{value:h},enable:!0}}),a.opacity&&(x.opacity={value:h.a}),t.particles.addParticle(g,x),f++}}(t,n,e.position,e.scale,e.override,e.pixels.filter)}}},9306(t,e,n){n.d(e,{V6:()=>s,YL:()=>a,M5:()=>c,iO:()=>r,Al:()=>l});var i=n(3199);const o=i.D_O/255;function s(t,e,n){t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(n.x,n.y),t.closePath()}function a(t,e,n,s=!0){const a=t.getImageData(i.boI.x,i.boI.y,e.width,e.height).data;s&&t.clearRect(i.boI.x,i.boI.y,e.width,e.height);const c=[];for(let t=0;t<a.length;t+=n){const s=t/n,r={x:s%e.width,y:Math.floor(s/e.width)};c[r.y]??=[];const l=c[r.y];l&&(l[r.x]={r:a[t+0]??i.Fli,g:a[t+1]??i.Fli,b:a[t+2]??i.Fli,a:(a[t+3]??i.aZx)*o})}return{pixels:c,width:Math.min(...c.map(t=>t.length)),height:c.length}}function c(t,e,n){const o=new Image;o.crossOrigin="Anonymous";const s=new Promise((t,s)=>{o.onerror=s,o.onload=()=>{const c=(0,i.T5G)().createElement("canvas");c.width=o.width,c.height=o.height;const r=c.getContext("2d",n);r?(r.drawImage(o,i.boI.x,i.boI.y,o.width,o.height,i.boI.x,i.boI.y,c.width,c.height),t(a(r,c,e))):s(new Error("Could not get canvas context"))}});return o.src=t,s}function r(t,e,n,o){const s=(0,i.T5G)().createElement("canvas"),c=s.getContext("2d",o),{font:r,text:l,lines:h,color:u}=t;if(!l||!c)return;const g=l.split(h.separator),x=(0,i.EtT)(r.size)?`${r.size.toString()}px`:r.size,f=[];let d=0,p=0;for(const t of g){c.font=`${r.style||""} ${r.variant||""} ${r.weight||""} ${x} ${r.family}`;const e=c.measureText(t),n={measure:e,text:t,height:e.actualBoundingBoxAscent+e.actualBoundingBoxDescent,width:e.width};d=Math.max(d||0,n.width),p+=n.height+h.spacing,f.push(n)}s.width=d,s.height=p;let y=0;for(const t of f)c.font=`${r.style||""} ${r.variant||""} ${r.weight||""} ${x} ${r.family}`,n?(c.fillStyle=u,c.fillText(t.text,i.boI.x,y+t.measure.actualBoundingBoxAscent)):(c.strokeStyle=u,c.strokeText(t.text,i.boI.x,y+t.measure.actualBoundingBoxAscent)),y+=t.height+h.spacing;return a(c,s,e)}async function l(t,e){try{await(0,i.T5G)().fonts.load(`${e??"400"} 36px '${t??"Verdana"}'`)}catch{}}}}]);