"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("regex-combined-emojis"),y=require("emoji-toolkit/emoji_strategy.json"),d=new RegExp(C.emojiPattern,"g"),f="9.0",u="https://cdn.jsdelivr.net/joypixels/assets/"+f+"/png/unicode/32/";exports.customEmojiAssetUrl=null;exports.emojiImageUrlSmall=u;exports.emojiFileExtensionSmall=".png";exports.emojiImageUrlLarge=u;exports.emojiFileExtensionLarge=".png";const m=y,j=new RegExp("(^| |(?<=:))(:\\w+:)","g");function g(){return m}function A(e,t=".png"){e.endsWith("/")||(e=e+"/"),exports.emojiImageUrlSmall=e,exports.emojiFileExtensionSmall=t}function x(e,t=".svg"){e.endsWith("/")||(e=e+"/"),exports.emojiImageUrlLarge=e,exports.emojiFileExtensionLarge=t}function P(e){exports.customEmojiAssetUrl=e}function T(e){E(e)}function E(e){const t=["custom","date_added","image"],o=["date_added","image","unicode_output","shortname","shortname_alternates","custom","name"],n=(s,i,r)=>{if(s[i]===void 0){if(!t.includes(i))return;s[i]=r}else Array.isArray(s[i])?s[i]=s[i].concat(r):s[i]=r};Object.entries(e).forEach(s=>{const[i,r]=s;if(i in m){const l=m[i];for(const c in r){const U=r[c];n(l,c,U)}}else o.every(c=>r[c]!==void 0)?m[i]=r:console.error("The following custom emoji doesn't contain the required properties:",r)})}function a(e){function t(n,s){if(!(!n||typeof n!="object")){if("shortname"in n&&(n.shortname===e||n.shortname_alternates.includes(e)))return n.key=s,o=n,!0;Object.keys(n).some(function(i){return t(n[i],i)})}}let o;return t(g(),null),o}function h(e){let t="";for(const o of e){const n=o.codePointAt(0).toString(16).padStart(4,"0");["200d","fe0f"].includes(n)||(t!==""&&(t=t+"-"),t=t+n)}return t}function p(e){const t=e.split("-");let o="";return t.forEach(n=>{o=o+String.fromCodePoint(parseInt(n,16))}),o}function v(e){if(e=e==null?void 0:e.trim(),e.startsWith(":")&&e.endsWith(":"))return a(e);{const t=h(e),o=m[t];return o&&(o.key=t),o}}function R(e){const t=(e.match(j)||[]).map(o=>o.trim());return S(t)}function S(e){const t=e?e.filter(o=>a(o)):[];return new Set(t)}function _(e){const t=[...e.matchAll(d)],o=t.length?t.map(n=>n[0]):[];return new Set(o)}exports.codeToEmojiData=v;exports.defaultEmojiAssetUrl=u;exports.emojiJson=m;exports.emojiRegex=d;exports.emojiShortCodeRegex=j;exports.emojiVersion=f;exports.filterValidShortCodes=S;exports.findEmojis=_;exports.findShortCodes=R;exports.getEmojiData=g;exports.setCustomEmojiJson=T;exports.setCustomEmojiUrl=P;exports.setEmojiAssetUrlLarge=x;exports.setEmojiAssetUrlSmall=A;exports.shortcodeToEmojiData=a;exports.stringToUnicode=p;exports.unicodeToString=h;exports.validateCustomEmojiJson=E;
//# sourceMappingURL=index.cjs.map
