"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[7923],{7923(t,e,o){o.d(e,{loadEmojiShape:()=>c});var n=o(3199);const a=["emoji"];var i=o(9306);const s='"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif';class r{#t=new Map;destroy(){for(const[t,e]of this.#t)e instanceof ImageBitmap&&e.close(),this.#t.delete(t)}draw(t){const e=t.particle.emojiDataKey;if(!e)return;const o=this.#t.get(e);o&&function(t,e){const{context:o,opacity:a}=t,i=o.globalAlpha,s=e.width,r=s*n.MXx;o.globalAlpha=a,o.drawImage(e,-r,-r,s,s),o.globalAlpha=i}(t,o)}async init(t){const e=t.actualOptions.particles.shape;if(!a.some(t=>(0,n.hnD)(t,e.type)))return;const o=[(0,i.Al)(s)],r=a.map(t=>e.options[t])[0];(0,n.wJ2)(r,t=>{t.font&&o.push((0,i.Al)(t.font))}),await Promise.all(o)}particleDestroy(t){t.emojiDataKey=void 0}particleInit(t,e){const o=e.shapeData;if(!o.value)return;const a=(0,n.TA3)(o.value,e.randomIndexData);if(!a)return;const i="string"==typeof a?{font:o.font??s,padding:o.padding??0,value:a}:{font:s,padding:0,...o,...a},r=i.font,c=i.value,l=`${c}_${r}`;if(this.#t.has(l))return void(e.emojiDataKey=l);const h=i.padding*n.gdl,g=(0,n.W9e)(e.size.value),d=g+h,p=d*n.gdl,f=new OffscreenCanvas(p,p),u=f.getContext("2d",t.canvas.render.settings);if(!u)return;u.font=`400 ${(g*n.gdl).toString()}px ${r}`,u.textBaseline="middle",u.textAlign="center",u.fillText(c,d,d);const m=f instanceof HTMLCanvasElement?f:f.transferToImageBitmap();this.#t.set(l,m),e.emojiDataKey=l}}async function c(t){t.checkVersion("4.1.3"),await t.pluginManager.register(t=>{t.pluginManager.addShape(a,()=>Promise.resolve(new r))})}},9306(t,e,o){o.d(e,{V6:()=>i,YL:()=>s,M5:()=>r,iO:()=>c,Al:()=>l});var n=o(3199);const a=n.D_O/255;function i(t,e,o){t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(o.x,o.y),t.closePath()}function s(t,e,o,i=!0){const s=t.getImageData(n.boI.x,n.boI.y,e.width,e.height).data;i&&t.clearRect(n.boI.x,n.boI.y,e.width,e.height);const r=[];for(let t=0;t<s.length;t+=o){const i=t/o,c={x:i%e.width,y:Math.floor(i/e.width)};r[c.y]??=[];const l=r[c.y];l&&(l[c.x]={r:s[t+0]??n.Fli,g:s[t+1]??n.Fli,b:s[t+2]??n.Fli,a:(s[t+3]??n.aZx)*a})}return{pixels:r,width:Math.min(...r.map(t=>t.length)),height:r.length}}function r(t,e,o){const a=new Image;a.crossOrigin="Anonymous";const i=new Promise((t,i)=>{a.onerror=i,a.onload=()=>{const r=(0,n.T5G)().createElement("canvas");r.width=a.width,r.height=a.height;const c=r.getContext("2d",o);c?(c.drawImage(a,n.boI.x,n.boI.y,a.width,a.height,n.boI.x,n.boI.y,r.width,r.height),t(s(c,r,e))):i(new Error("Could not get canvas context"))}});return a.src=t,i}function c(t,e,o,a){const i=(0,n.T5G)().createElement("canvas"),r=i.getContext("2d",a),{font:c,text:l,lines:h,color:g}=t;if(!l||!r)return;const d=l.split(h.separator),p=(0,n.EtT)(c.size)?`${c.size.toString()}px`:c.size,f=[];let u=0,m=0;for(const t of d){r.font=`${c.style||""} ${c.variant||""} ${c.weight||""} ${p} ${c.family}`;const e=r.measureText(t),o={measure:e,text:t,height:e.actualBoundingBoxAscent+e.actualBoundingBoxDescent,width:e.width};u=Math.max(u||0,o.width),m+=o.height+h.spacing,f.push(o)}i.width=u,i.height=m;let x=0;for(const t of f)r.font=`${c.style||""} ${c.variant||""} ${c.weight||""} ${p} ${c.family}`,o?(r.fillStyle=g,r.fillText(t.text,n.boI.x,x+t.measure.actualBoundingBoxAscent)):(r.strokeStyle=g,r.strokeText(t.text,n.boI.x,x+t.measure.actualBoundingBoxAscent)),x+=t.height+h.spacing;return s(r,i,e)}async function l(t,e){try{await(0,n.T5G)().fonts.load(`${e??"400"} 36px '${t??"Verdana"}'`)}catch{}}}}]);