"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[1815],{1815:(e,t,a)=>{a.d(t,{loadEmojiShape:()=>l});var i=a(9201);const o=["emoji"],s='"Twemoji Mozilla", Apple Color Emoji, "Segoe UI Emoji", "Noto Color Emoji", "EmojiOne Color"';class n{constructor(){this._emojiShapeDict=new Map}destroy(){for(const[,e]of this._emojiShapeDict)e instanceof ImageBitmap&&e?.close()}draw(e){const{context:t,particle:a,radius:i,opacity:o}=e,s=a.emojiData;s&&(t.globalAlpha=o,t.drawImage(s,-i,-i,2*i,2*i),t.globalAlpha=1)}async init(e){const t=e.actualOptions;if(o.find((e=>(0,i.dB)(e,t.particles.shape.type)))){const e=[(0,i.mx)(s)],a=o.map((e=>t.particles.shape.options[e])).find((e=>!!e));a&&(0,i.KH)(a,(t=>{t.font&&e.push((0,i.mx)(t.font))})),await Promise.all(e)}}particleDestroy(e){delete e.emojiData}particleInit(e,t){if(!t.emojiData){const e=t.shapeData;if(!e?.value)return;const a=(0,i.wA)(e.value,t.randomIndexData),o=e.font??s;if(!a)return;const n=`${a}_${o}`,l=this._emojiShapeDict.get(n);if(l)return void(t.emojiData=l);const c=2*(0,i.KI)(t.size.value);let r;if("undefined"!=typeof OffscreenCanvas){const e=new OffscreenCanvas(c,c),s=e.getContext("2d");if(!s)return;s.font=`400 ${2*(0,i.KI)(t.size.value)}px ${o}`,s.textBaseline="middle",s.textAlign="center",s.fillText(a,(0,i.KI)(t.size.value),(0,i.KI)(t.size.value)),r=e.transferToImageBitmap()}else{const e=document.createElement("canvas");e.width=c,e.height=c;const s=e.getContext("2d");if(!s)return;s.font=`400 ${2*(0,i.KI)(t.size.value)}px ${o}`,s.textBaseline="middle",s.textAlign="center",s.fillText(a,(0,i.KI)(t.size.value),(0,i.KI)(t.size.value)),r=e}this._emojiShapeDict.set(n,r),t.emojiData=r}}}async function l(e,t=!0){await e.addShape(o,new n,t)}}}]);