import "./components-DaDed2hn.js";
import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
import { l as t } from "./enums-De8CDKZ1.js";
import { t as n } from "./wt-button-dC4nOW56.js";
import { n as r } from "./wt-toast-DXrSMdRm.js";
import { Teleport as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createVNode as l, nextTick as u, onBeforeUnmount as d, openBlock as f, ref as p, resolveDirective as m, unref as h, withDirectives as g } from "vue";
//#region node_modules/emoji-picker-element/database.js
function _(e) {
	if (typeof e != "string" || !e) throw Error("expected a non-empty string, got: " + e);
}
function v(e) {
	if (typeof e != "number") throw Error("expected a number, got: " + e);
}
var y = 1, b = 1, x = "emoji", S = "keyvalue", C = "favorites", w = "tokens", T = "tokens", E = "unicode", D = "count", O = "group", ee = "order", k = "group-order", A = "eTag", j = "url", te = "skinTone", M = "readonly", N = "readwrite", ne = "skinUnicodes", P = "skinUnicodes", re = "https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json", ie = "en";
function ae(e, t) {
	let n = /* @__PURE__ */ new Set(), r = [];
	for (let i of e) {
		let e = t(i);
		n.has(e) || (n.add(e), r.push(i));
	}
	return r;
}
function F(e) {
	return ae(e, (e) => e.unicode);
}
function oe(e) {
	function t(t, n, r) {
		let i = n ? e.createObjectStore(t, { keyPath: n }) : e.createObjectStore(t);
		if (r) for (let [e, [t, n]] of Object.entries(r)) i.createIndex(e, t, { multiEntry: n });
		return i;
	}
	t(S), t(x, E, {
		[T]: [w, !0],
		[k]: [[O, ee]],
		[ne]: [P, !0]
	}), t(C, void 0, { [D]: [""] });
}
var I = {}, L = {}, R = {};
function se(e, t, n) {
	n.onerror = () => t(n.error), n.onblocked = () => t(/* @__PURE__ */ Error("IDB blocked")), n.onsuccess = () => e(n.result);
}
async function ce(e) {
	let t = await new Promise((t, n) => {
		let r = indexedDB.open(e, y);
		I[e] = r, r.onupgradeneeded = (e) => {
			/* istanbul ignore else */
			e.oldVersion < b && oe(r.result);
		}, se(t, n, r);
	});
	return t.onclose = () => ue(e), t;
}
function le(e) {
	return L[e] || (L[e] = ce(e)), L[e];
}
function z(e, t, n, r) {
	return new Promise((i, a) => {
		let o = e.transaction(t, n, { durability: "relaxed" }), s = typeof t == "string" ? o.objectStore(t) : t.map((e) => o.objectStore(e)), c;
		/* istanbul ignore next */
		r(s, o, (e) => {
			c = e;
		}), o.oncomplete = () => i(c), o.onerror = () => a(o.error);
	});
}
function ue(e) {
	let t = I[e], n = t && t.result;
	if (n) {
		n.close();
		let t = R[e];
		/* istanbul ignore else */
		if (t) for (let e of t) e();
	}
	delete I[e], delete L[e], delete R[e];
}
function de(e) {
	return new Promise((t, n) => {
		ue(e), se(t, n, indexedDB.deleteDatabase(e));
	});
}
function fe(e, t) {
	let n = R[e];
	n ||= R[e] = [], n.push(t);
}
var pe = /* @__PURE__ */ new Set(/* @__PURE__ */ ":D.XD.:'D.O:).:X.:P.;P.XP.:L.:Z.:j.8D.XO.8).:B.:O.:S.:'o.Dx.X(.D:.:C.>0).:3.</3.<3.\\M/.:E.8#".split("."));
function B(e) {
	return e.split(/[\s_]+/).map((e) => !e.match(/\w/) || pe.has(e) ? e.toLowerCase() : e.replace(/[)(:,]/g, "").replace(/’/g, "'").toLowerCase()).filter(Boolean);
}
var me = 2;
function he(e) {
	return e.filter(Boolean).map((e) => e.toLowerCase()).filter((e) => e.length >= me);
}
function ge(e) {
	return e.map(({ annotation: e, emoticon: t, group: n, order: r, shortcodes: i, skins: a, tags: o, emoji: s, version: c }) => {
		let l = {
			annotation: e,
			group: n,
			order: r,
			tags: o,
			tokens: [...new Set(he([
				...(i || []).map(B).flat(),
				...(o || []).map(B).flat(),
				...B(e),
				t
			]))].sort(),
			unicode: s,
			version: c
		};
		if (t && (l.emoticon = t), i && (l.shortcodes = i), a) {
			l.skinTones = [], l.skinUnicodes = [], l.skinVersions = [];
			for (let { tone: e, emoji: t, version: n } of a) l.skinTones.push(e), l.skinUnicodes.push(t), l.skinVersions.push(n);
		}
		return l;
	});
}
function _e(e, t, n, r) {
	e[t](n).onsuccess = (e) => r && r(e.target.result);
}
function V(e, t, n) {
	_e(e, "get", t, n);
}
function ve(e, t, n) {
	_e(e, "getAll", t, n);
}
function H(e) {
	/* istanbul ignore else */
	e.commit && e.commit();
}
function ye(e, t) {
	let n = e[0];
	for (let r = 1; r < e.length; r++) {
		let i = e[r];
		t(n) > t(i) && (n = i);
	}
	return n;
}
function be(e, t) {
	let n = ye(e, (e) => e.length), r = [];
	for (let i of n) e.some((e) => e.findIndex((e) => t(e) === t(i)) === -1) || r.push(i);
	return r;
}
async function xe(e) {
	return !await U(e, S, j);
}
async function Se(e, t, n) {
	let [r, i] = await Promise.all([A, j].map((t) => U(e, S, t)));
	return r === n && i === t;
}
async function Ce(e, t) {
	return z(e, x, M, (e, n, r) => {
		let i, a = () => {
			e.getAll(i && IDBKeyRange.lowerBound(i, !0), 50).onsuccess = (e) => {
				let n = e.target.result;
				for (let e of n) if (i = e.unicode, t(e)) return r(e);
				if (n.length < 50) return r();
				a();
			};
		};
		a();
	});
}
async function we(e, t, n, r) {
	try {
		let i = ge(t);
		await z(e, [x, S], N, ([e, t], a) => {
			let o, s, c = 0;
			function l() {
				++c === 2 && u();
			}
			function u() {
				if (!(o === r && s === n)) {
					e.clear();
					for (let t of i) e.put(t);
					t.put(r, A), t.put(n, j), H(a);
				}
			}
			V(t, A, (e) => {
				o = e, l();
			}), V(t, j, (e) => {
				s = e, l();
			});
		});
	} finally {}
}
async function Te(e, t) {
	return z(e, x, M, (e, n, r) => {
		let i = IDBKeyRange.bound([t, 0], [t + 1, 0], !1, !0);
		ve(e.index(k), i, r);
	});
}
async function Ee(e, t) {
	let n = he(B(t));
	return n.length ? z(e, x, M, (e, t, r) => {
		let i = [], a = () => {
			i.length === n.length && o();
		}, o = () => {
			r(be(i, (e) => e.unicode).sort((e, t) => e.order < t.order ? -1 : 1));
		};
		for (let t = 0; t < n.length; t++) {
			let r = n[t], o = t === n.length - 1 ? IDBKeyRange.bound(r, r + "", !1, !0) : IDBKeyRange.only(r);
			ve(e.index(T), o, (e) => {
				i.push(e), a();
			});
		}
	}) : [];
}
async function De(e, t) {
	let n = await Ee(e, t);
	return n.length ? n.filter((e) => (e.shortcodes || []).map((e) => e.toLowerCase()).includes(t.toLowerCase()))[0] || null : await Ce(e, (e) => (e.shortcodes || []).includes(t.toLowerCase())) || null;
}
async function Oe(e, t) {
	return z(e, x, M, (e, n, r) => V(e, t, (n) => {
		if (n) return r(n);
		V(e.index(ne), t, (e) => r(e || null));
	}));
}
function U(e, t, n) {
	return z(e, t, M, (e, t, r) => V(e, n, r));
}
function ke(e, t, n, r) {
	return z(e, t, N, (e, t) => {
		e.put(r, n), H(t);
	});
}
function Ae(e, t) {
	return z(e, C, N, (e, n) => V(e, t, (r) => {
		e.put((r || 0) + 1, t), H(n);
	}));
}
function je(e, t, n) {
	return n === 0 ? [] : z(e, [C, x], M, ([e, r], i, a) => {
		let o = [];
		e.index(D).openCursor(void 0, "prev").onsuccess = (e) => {
			let i = e.target.result;
			if (!i) return a(o);
			function s(e) {
				if (o.push(e), o.length === n) return a(o);
				i.continue();
			}
			let c = i.primaryKey, l = t.byName(c);
			if (l) return s(l);
			V(r, c, (e) => {
				if (e) return s(e);
				i.continue();
			});
		};
	});
}
var W = "";
function Me(e, t) {
	let n = /* @__PURE__ */ new Map();
	for (let r of e) {
		let e = t(r);
		for (let t of e) {
			let e = n;
			for (let n = 0; n < t.length; n++) {
				let r = t.charAt(n), i = e.get(r);
				i || (i = /* @__PURE__ */ new Map(), e.set(r, i)), e = i;
			}
			let i = e.get(W);
			i || (i = [], e.set(W, i)), i.push(r);
		}
	}
	return (e, t) => {
		let r = n;
		for (let t = 0; t < e.length; t++) {
			let n = e.charAt(t), i = r.get(n);
			if (i) r = i;
			else return [];
		}
		if (t) return r.get(W) || [];
		let i = [], a = [r];
		for (; a.length;) {
			let e = [...a.shift().entries()].sort((e, t) => e[0] < t[0] ? -1 : 1);
			for (let [t, n] of e) t === W ? i.push(...n) : a.push(n);
		}
		return i;
	};
}
var Ne = ["name", "url"];
function Pe(e) {
	let t = e && Array.isArray(e), n = t && e.length && (!e[0] || Ne.some((t) => !(t in e[0])));
	if (!t || n) throw Error("Custom emojis are in the wrong format");
}
function Fe(e) {
	Pe(e);
	let t = (e, t) => e.name.toLowerCase() < t.name.toLowerCase() ? -1 : 1, n = e.sort(t), r = Me(e, (e) => {
		let t = /* @__PURE__ */ new Set();
		if (e.shortcodes) for (let n of e.shortcodes) for (let e of B(n)) t.add(e);
		return t;
	}), i = (e) => r(e, !0), a = (e) => r(e, !1), o = (e) => {
		let n = B(e);
		return be(n.map((e, t) => (t < n.length - 1 ? i : a)(e)), (e) => e.name).sort(t);
	}, s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
	for (let t of e) {
		c.set(t.name.toLowerCase(), t);
		for (let e of t.shortcodes || []) s.set(e.toLowerCase(), t);
	}
	return {
		all: n,
		search: o,
		byShortcode: (e) => s.get(e.toLowerCase()),
		byName: (e) => c.get(e.toLowerCase())
	};
}
var Ie = typeof wrappedJSObject < "u";
function G(e) {
	if (!e) return e;
	if (Ie && (e = structuredClone(e)), delete e.tokens, e.skinTones) {
		let t = e.skinTones.length;
		e.skins = Array(t);
		for (let n = 0; n < t; n++) e.skins[n] = {
			tone: e.skinTones[n],
			unicode: e.skinUnicodes[n],
			version: e.skinVersions[n]
		};
		delete e.skinTones, delete e.skinUnicodes, delete e.skinVersions;
	}
	return e;
}
function Le(e) {
	e || console.warn("emoji-picker-element is more efficient if the dataSource server exposes an ETag header.");
}
var Re = [
	"annotation",
	"emoji",
	"group",
	"order",
	"version"
];
function ze(e) {
	if (!e || !Array.isArray(e) || !e[0] || typeof e[0] != "object" || Re.some((t) => !(t in e[0]))) throw Error("Emoji data is in the wrong format");
}
function Be(e, t) {
	if (Math.floor(e.status / 100) !== 2) throw Error("Failed to fetch: " + t + ":  " + e.status);
}
async function Ve(e) {
	let t = await fetch(e, { method: "HEAD" });
	Be(t, e);
	let n = t.headers.get("etag");
	return Le(n), n;
}
async function He(e) {
	let t = await fetch(e);
	Be(t, e);
	let n = t.headers.get("etag");
	Le(n);
	let r = await t.json();
	return ze(r), [n, r];
}
function Ue(e) {
	for (var t = "", n = new Uint8Array(e), r = n.byteLength, i = -1; ++i < r;) t += String.fromCharCode(n[i]);
	return t;
}
function We(e) {
	for (var t = e.length, n = new ArrayBuffer(t), r = new Uint8Array(n), i = -1; ++i < t;) r[i] = e.charCodeAt(i);
	return n;
}
async function Ge(e) {
	let t = We(JSON.stringify(e)), n = Ue(await crypto.subtle.digest("SHA-1", t));
	return btoa(n);
}
async function Ke(e, t) {
	let n, r = await Ve(t);
	if (!r) {
		let e = await He(t);
		r = e[0], n = e[1], r ||= await Ge(n);
	}
	await Se(e, t, r) || (n ||= (await He(t))[1], await we(e, n, t, r));
}
async function qe(e, t) {
	let [n, r] = await He(t);
	n ||= await Ge(r), await we(e, r, t, n);
}
async function Je(e, t) {
	try {
		await Ke(e, t);
	} catch (e) {
		if (e.name !== "InvalidStateError") throw e;
	}
}
var Ye = class {
	constructor({ dataSource: e = re, locale: t = ie, customEmoji: n = [] } = {}) {
		this.dataSource = e, this.locale = t, this._dbName = `emoji-picker-element-${this.locale}`, this._db = void 0, this._lazyUpdate = void 0, this._custom = Fe(n), this._clear = this._clear.bind(this), this._ready = this._init();
	}
	async _init() {
		let e = this._db = await le(this._dbName);
		fe(this._dbName, this._clear);
		let t = this.dataSource;
		await xe(e) ? await qe(e, t) : this._lazyUpdate = Je(e, t);
	}
	async ready() {
		let e = async () => (this._ready ||= this._init(), this._ready);
		await e(), this._db || await e();
	}
	async getEmojiByGroup(e) {
		return v(e), await this.ready(), F(await Te(this._db, e)).map(G);
	}
	async getEmojiBySearchQuery(e) {
		_(e), await this.ready();
		let t = this._custom.search(e), n = F(await Ee(this._db, e)).map(G);
		return [...t, ...n];
	}
	async getEmojiByShortcode(e) {
		return _(e), await this.ready(), this._custom.byShortcode(e) || G(await De(this._db, e));
	}
	async getEmojiByUnicodeOrName(e) {
		return _(e), await this.ready(), this._custom.byName(e) || G(await Oe(this._db, e));
	}
	async getPreferredSkinTone() {
		return await this.ready(), await U(this._db, S, te) || 0;
	}
	async setPreferredSkinTone(e) {
		return v(e), await this.ready(), ke(this._db, S, te, e);
	}
	async incrementFavoriteEmojiCount(e) {
		return _(e), await this.ready(), Ae(this._db, e);
	}
	async getTopFavoriteEmoji(e) {
		return v(e), await this.ready(), (await je(this._db, this._custom, e)).map(G);
	}
	set customEmoji(e) {
		this._custom = Fe(e);
	}
	get customEmoji() {
		return this._custom.all;
	}
	async _shutdown() {
		await this.ready();
		try {
			await this._lazyUpdate;
		} catch {}
	}
	_clear() {
		this._db = this._ready = this._lazyUpdate = void 0;
	}
	async close() {
		await this._shutdown(), await ue(this._dbName);
	}
	async delete() {
		await this._shutdown(), await de(this._dbName);
	}
}, Xe = [
	[
		-1,
		"✨",
		"custom"
	],
	[
		0,
		"😀",
		"smileys-emotion"
	],
	[
		1,
		"👋",
		"people-body"
	],
	[
		3,
		"🐱",
		"animals-nature"
	],
	[
		4,
		"🍎",
		"food-drink"
	],
	[
		5,
		"🏠️",
		"travel-places"
	],
	[
		6,
		"⚽",
		"activities"
	],
	[
		7,
		"📝",
		"objects"
	],
	[
		8,
		"⛔️",
		"symbols"
	],
	[
		9,
		"🏁",
		"flags"
	]
].map(([e, t, n]) => ({
	id: e,
	emoji: t,
	name: n
})), Ze = Xe.slice(1), Qe = 2, $e = 6, et = typeof requestIdleCallback == "function" ? requestIdleCallback : setTimeout;
function tt(e) {
	return e.unicode.includes("‍");
}
var nt = {
	"🫪": 17,
	"🫩": 16,
	"🫨": 15.1,
	"🫠": 14,
	"🥲": 13.1,
	"🥻": 12.1,
	"🥰": 11,
	"🤩": 5,
	"👱‍♀️": 4,
	"🤣": 3,
	"👁️‍🗨️": 2,
	"😀": 1,
	"😐️": .7,
	"😃": .6
}, rt = 1e3, it = "🖐️", at = 8, ot = [
	"😊",
	"😒",
	"❤️",
	"👍️",
	"😍",
	"😂",
	"😭",
	"☺️",
	"😔",
	"😩",
	"😏",
	"💕",
	"🙌",
	"😘"
], st = "\"Twemoji Mozilla\",\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\",\"EmojiOne Color\",\"Android Emoji\",sans-serif", ct = (e, t) => e < t ? -1 : +(e > t), lt = (e, t) => {
	let n = document.createElement("canvas");
	n.width = n.height = 1;
	let r = n.getContext("2d", { willReadFrequently: !0 });
	return r.textBaseline = "top", r.font = `100px ${st}`, r.fillStyle = t, r.scale(.01, .01), r.fillText(e, 0, 0), r.getImageData(0, 0, 1, 1).data;
}, ut = (e, t) => {
	let n = [...e].join(",");
	return n === [...t].join(",") && !n.startsWith("0,0,0,");
};
function dt(e) {
	let t = lt(e, "#000"), n = lt(e, "#fff");
	return t && n && ut(t, n);
}
function ft() {
	let e = Object.entries(nt);
	try {
		for (let [t, n] of e) if (dt(t)) return n;
	} catch {}
	return e[0][1];
}
var pt, mt = () => (pt ||= new Promise((e) => et(() => e(ft()))), pt), ht = /* @__PURE__ */ new Map(), gt = "️", _t = "\ud83c", vt = "‍", yt = 127995, bt = 57339;
function xt(e, t) {
	if (t === 0) return e;
	let n = e.indexOf(vt);
	return n === -1 ? (e.endsWith(gt) && (e = e.substring(0, e.length - 1)), e + _t + String.fromCodePoint(bt + t - 1)) : e.substring(0, n) + String.fromCodePoint(yt + t - 1) + e.substring(n);
}
function K(e) {
	e.preventDefault(), e.stopPropagation();
}
function St(e, t, n) {
	return t += e ? -1 : 1, t < 0 ? t = n.length - 1 : t >= n.length && (t = 0), t;
}
function Ct(e, t) {
	let n = /* @__PURE__ */ new Set(), r = [];
	for (let i of e) {
		let e = t(i);
		n.has(e) || (n.add(e), r.push(i));
	}
	return r;
}
function wt(e, t) {
	let n = (e) => {
		let n = {};
		for (let r of e) typeof r.tone == "number" && r.version <= t && (n[r.tone] = r.unicode);
		return n;
	};
	return e.map(({ unicode: e, skins: t, shortcodes: r, url: i, name: a, category: o, annotation: s }) => ({
		unicode: e,
		name: a,
		shortcodes: r,
		url: i,
		category: o,
		annotation: s,
		id: e || a,
		skins: t && n(t)
	}));
}
var q = requestAnimationFrame, Tt = typeof ResizeObserver == "function";
function Et(e, t, n) {
	let r;
	Tt ? (r = new ResizeObserver(n), r.observe(e)) : q(n), t.addEventListener("abort", () => {
		r && r.disconnect();
	});
}
function Dt(e) {
	/* istanbul ignore else */
	{
		let t = document.createRange();
		return t.selectNode(e.firstChild), t.getBoundingClientRect().width;
	}
}
var Ot = "😀", kt, J;
function At(e, t, n) {
	let r = Dt(t);
	/* istanbul ignore if */
	if (!r) {
		if (!J) {
			J = n.cloneNode(!0);
			let e = getComputedStyle(n);
			for (let t of [
				"font-family",
				"line-height",
				"width",
				"height",
				"font-size",
				"display",
				"align-items",
				"justify-content"
			]) J.style.setProperty(t, e.getPropertyValue(t), "important");
		}
		try {
			return document.body.appendChild(J), J.firstChild.nodeValue = e, Dt(J);
		} finally {
			J.remove();
		}
	}
	return r;
}
function jt(e, t, n) {
	let r = !0;
	for (let i of e) {
		let e = n(i);
		/* istanbul ignore if */
		if (!e) continue;
		kt === void 0 && (kt = At(Ot, t, t));
		let a = At(i.unicode, e, t) / 1.8 < kt;
		ht.set(i.unicode, a), a || (r = !1);
	}
	return r;
}
function Mt(e) {
	return Ct(e, (e) => e);
}
function Nt(e) {
	/* istanbul ignore else */
	e && (e.scrollTop = 0);
}
function Y(e, t, n) {
	let r = e.get(t);
	return r || (r = n(), e.set(t, r)), r;
}
function Pt(e) {
	return "" + e;
}
function Ft(e) {
	let t = document.createElement("template");
	return t.innerHTML = e, t;
}
var It = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), Rt = Symbol("un-keyed"), zt = "replaceChildren" in Element.prototype;
function Bt(e, t) {
	/* istanbul ignore else */
	zt ? e.replaceChildren(...t) : (e.innerHTML = "", e.append(...t));
}
function Vt(e, t) {
	let n = e.firstChild, r = 0;
	for (; n;) {
		if (t[r] !== n) return !0;
		n = n.nextSibling, r++;
	}
	return r !== t.length;
}
function Ht(e, t) {
	let { targetNode: n } = t, { targetParentNode: r } = t, i = !1;
	r ? i = Vt(r, e) : (i = !0, t.targetNode = void 0, t.targetParentNode = r = n.parentNode), i && Bt(r, e);
}
function Ut(e, t) {
	for (let n of t) {
		let { targetNode: t, currentExpression: r, binding: { expressionIndex: i, attributeName: a, attributeValuePre: o, attributeValuePost: s } } = n, c = e[i];
		if (r !== c) if (n.currentExpression = c, a) if (c === null) t.removeAttribute(a);
		else {
			let e = o + Pt(c) + s;
			t.setAttribute(a, e);
		}
		else {
			let e;
			Array.isArray(c) ? Ht(c, n) : c instanceof Element ? (e = c, t.replaceWith(e)) : t.nodeValue = Pt(c), e && (n.targetNode = e);
		}
	}
}
function Wt(e) {
	let t = "", n = !1, r = !1, i = -1, a = /* @__PURE__ */ new Map(), o = [], s = 0;
	for (let c = 0, l = e.length; c < l; c++) {
		let u = e[c];
		if (t += u.slice(s), c === l - 1) break;
		for (let e = 0; e < u.length; e++) switch (u.charAt(e)) {
			case "<":
				u.charAt(e + 1) === "/" ? o.pop() : (n = !0, o.push(++i));
				break;
			case ">":
				n = !1, r = !1;
				break;
			case "=":
				r = !0;
				break;
		}
		let d = o[o.length - 1], f = Y(a, d, () => []), p, m, h;
		if (r) {
			let n = /(\S+)="?([^"=]*)$/.exec(u);
			p = n[1], m = n[2];
			let r = /^([^">]*)("?)/.exec(e[c + 1]);
			h = r[1], t = t.slice(0, -1 * n[0].length), s = r[0].length;
		} else s = 0;
		let g = {
			attributeName: p,
			attributeValuePre: m,
			attributeValuePost: h,
			expressionIndex: c
		};
		f.push(g), !n && !r && (t += " ");
	}
	return {
		template: Ft(t),
		elementsToBindings: a
	};
}
function Gt(e, t, n) {
	for (let r = 0; r < e.length; r++) {
		let i = e[r], a = {
			binding: i,
			targetNode: i.attributeName ? t : t.firstChild,
			targetParentNode: void 0,
			currentExpression: void 0
		};
		n.push(a);
	}
}
function Kt(e, t) {
	let n = [], r;
	if (t.size === 1 && (r = t.get(0))) Gt(r, e, n);
	else {
		let r = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT), i = e, a = -1;
		do {
			let e = t.get(++a);
			e && Gt(e, i, n);
		} while (i = r.nextNode());
	}
	return n;
}
function qt(e) {
	let { template: t, elementsToBindings: n } = Y(It, e, () => Wt(e)), r = t.cloneNode(!0).content.firstElementChild, i = Kt(r, n);
	return function(e) {
		return Ut(e, i), r;
	};
}
function Jt(e) {
	let t = Y(Lt, e, () => /* @__PURE__ */ new Map()), n = Rt;
	function r(e, ...r) {
		return Y(Y(t, e, () => /* @__PURE__ */ new Map()), n, () => qt(e))(r);
	}
	function i(e, t, r) {
		return e.map((e, i) => {
			let a = n;
			n = r(e);
			try {
				return t(e, i);
			} finally {
				n = a;
			}
		});
	}
	return {
		map: i,
		html: r
	};
}
function Yt(e, t, n, r, i, a, o, s, c) {
	let { labelWithSkin: l, titleForEmoji: u, unicodeWithSkin: d } = n, { html: f, map: p } = Jt(t);
	function m(e, n, r) {
		return p(e, (e, i) => f`<button role="${n ? "option" : "menuitem"}" aria-selected="${n ? i === t.activeSearchItem : null}" aria-label="${l(e, t.currentSkinTone)}" title="${u(e)}" class="${"emoji" + (n && i === t.activeSearchItem ? " active" : "") + (e.unicode ? "" : " custom-emoji")}" id="${`${r}-${e.id}`}" style="${e.unicode ? null : `--custom-emoji-background: url(${JSON.stringify(e.url)})`}">${e.unicode ? d(e, t.currentSkinTone) : ""}</button>`, (e) => `${r}-${e.id}`);
	}
	let h = f`<section data-ref="rootElement" class="picker" aria-label="${t.i18n.regionLabel}" style="${t.pickerStyle || ""}"><div class="pad-top"></div><div class="search-row"><div class="search-wrapper"><input id="search" class="search" type="search" role="combobox" enterkeyhint="search" placeholder="${t.i18n.searchLabel}" autocapitalize="none" autocomplete="off" spellcheck="true" aria-expanded="${!!(t.searchMode && t.currentEmojis.length)}" aria-controls="search-results" aria-describedby="search-description" aria-autocomplete="list" aria-activedescendant="${t.activeSearchItemId ? `emo-${t.activeSearchItemId}` : null}" data-ref="searchElement" data-on-input="onSearchInput" data-on-keydown="onSearchKeydown"><label class="sr-only" for="search">${t.i18n.searchLabel}</label> <span id="search-description" class="sr-only">${t.i18n.searchDescription}</span></div><div class="skintone-button-wrapper ${t.skinTonePickerExpandedAfterAnimation ? "expanded" : ""}"><button id="skintone-button" class="emoji ${t.skinTonePickerExpanded ? "hide-focus" : ""}" aria-label="${t.skinToneButtonLabel}" title="${t.skinToneButtonLabel}" aria-describedby="skintone-description" aria-haspopup="listbox" aria-expanded="${t.skinTonePickerExpanded}" aria-controls="skintone-list" data-on-click="onClickSkinToneButton">${t.skinToneButtonText || ""}</button></div><span id="skintone-description" class="sr-only">${t.i18n.skinToneDescription}</span><div data-ref="skinToneDropdown" id="skintone-list" class="skintone-list hide-focus ${t.skinTonePickerExpanded ? "" : "hidden no-animate"}" style="transform:translateY(${t.skinTonePickerExpanded ? 0 : "calc(-1 * var(--num-skintones) * var(--total-emoji-size))"})" role="listbox" aria-label="${t.i18n.skinTonesLabel}" aria-activedescendant="skintone-${t.activeSkinTone}" aria-hidden="${!t.skinTonePickerExpanded}" tabIndex="-1" data-on-focusout="onSkinToneOptionsFocusOut" data-on-click="onSkinToneOptionsClick" data-on-keydown="onSkinToneOptionsKeydown" data-on-keyup="onSkinToneOptionsKeyup">${p(t.skinTones, (e, n) => f`<div id="skintone-${n}" class="emoji ${n === t.activeSkinTone ? "active" : ""}" aria-selected="${n === t.activeSkinTone}" role="option" title="${t.i18n.skinTones[n]}" aria-label="${t.i18n.skinTones[n]}">${e}</div>`, (e) => e)}</div></div><div class="nav" role="tablist" style="grid-template-columns:repeat(${t.groups.length},1fr)" aria-label="${t.i18n.categoriesLabel}" data-on-keydown="onNavKeydown" data-on-click="onNavClick">${p(t.groups, (e) => f`<button role="tab" class="nav-button" aria-controls="tab-${e.id}" aria-label="${t.i18n.categories[e.name]}" aria-selected="${!t.searchMode && t.currentGroup.id === e.id}" title="${t.i18n.categories[e.name]}" data-group-id="${e.id}"><div class="nav-emoji emoji">${e.emoji}</div></button>`, (e) => e.id)}</div><div class="indicator-wrapper"><div class="indicator" style="transform:translateX(${(t.isRtl ? -1 : 1) * t.currentGroupIndex * 100}%)"></div></div><div class="message ${t.message ? "" : "gone"}" role="alert" aria-live="polite">${t.message || ""}</div><div data-ref="tabpanelElement" class="tabpanel ${!t.databaseLoaded || t.message ? "gone" : ""}" role="${t.searchMode ? "region" : "tabpanel"}" aria-label="${t.searchMode ? t.i18n.searchResultsLabel : t.i18n.categories[t.currentGroup.name]}" id="${t.searchMode ? null : `tab-${t.currentGroup.id}`}" tabIndex="0" data-on-click="onEmojiClick"><div data-action="calculateEmojiGridStyle">${p(t.currentEmojisWithCategories, (e, n) => f`<div><div id="menu-label-${n}" class="category ${t.currentEmojisWithCategories.length === 1 && t.currentEmojisWithCategories[0].category === "" ? "gone" : ""}" aria-hidden="true">${t.searchMode ? t.i18n.searchResultsLabel : e.category ? e.category : t.currentEmojisWithCategories.length > 1 ? t.i18n.categories.custom : t.i18n.categories[t.currentGroup.name]}</div><div class="emoji-menu ${n !== 0 && !t.searchMode && t.currentGroup.id === -1 ? "visibility-auto" : ""}" style="${`--num-rows: ${Math.ceil(e.emojis.length / t.numColumns)}`}" data-action="updateOnIntersection" role="${t.searchMode ? "listbox" : "menu"}" aria-labelledby="menu-label-${n}" id="${t.searchMode ? "search-results" : null}">${m(e.emojis, t.searchMode, "emo")}</div></div>`, (e) => e.category)}</div></div><div class="favorites onscreen emoji-menu ${t.message ? "gone" : ""}" role="menu" aria-label="${t.i18n.favoritesLabel}" data-on-click="onEmojiClick">${m(t.currentFavorites, !1, "fav")}</div><button data-ref="baselineEmoji" aria-hidden="true" tabindex="-1" class="abs-pos hidden emoji baseline-emoji">😀</button></section>`, g = (t, n) => {
		for (let r of e.querySelectorAll(`[${t}]`)) n(r, r.getAttribute(t));
	};
	if (c) {
		e.appendChild(h);
		for (let e of [
			"click",
			"focusout",
			"input",
			"keydown",
			"keyup"
		]) g(`data-on-${e}`, (t, n) => {
			t.addEventListener(e, r[n]);
		});
		g("data-ref", (e, t) => {
			a[t] = e;
		}), o.addEventListener("abort", () => {
			e.removeChild(h);
		});
	}
	g("data-action", (e, t) => {
		let n = s.get(t);
		n || s.set(t, n = /* @__PURE__ */ new WeakSet()), n.has(e) || (n.add(e), i[t](e));
	});
}
/* istanbul ignore next */
var X = typeof queueMicrotask == "function" ? queueMicrotask : (e) => Promise.resolve().then(e);
function Xt(e) {
	let t = !1, n, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), a, o = () => {
		if (t) return;
		let e = [...i];
		i.clear();
		try {
			for (let t of e) t();
		} finally {
			a = !1, i.size && (a = !0, X(o));
		}
	}, s = new Proxy({}, {
		get(e, t) {
			if (n) {
				let e = r.get(t);
				e || (e = /* @__PURE__ */ new Set(), r.set(t, e)), e.add(n);
			}
			return e[t];
		},
		set(e, t, n) {
			if (e[t] !== n) {
				e[t] = n;
				let s = r.get(t);
				if (s) {
					for (let e of s) i.add(e);
					a || (a = !0, X(o));
				}
			}
			return !0;
		}
	});
	return e.addEventListener("abort", () => {
		t = !0;
	}), {
		state: s,
		createEffect: (e) => {
			let t = () => {
				let r = n;
				n = t;
				try {
					return e();
				} finally {
					n = r;
				}
			};
			return t();
		}
	};
}
function Z(e, t, n) {
	if (e.length !== t.length) return !1;
	for (let r = 0; r < e.length; r++) if (!n(e[r], t[r])) return !1;
	return !0;
}
var Zt = /* @__PURE__ */ new WeakMap();
function Qt(e, t, n) {
	/* istanbul ignore else */
	{
		let r = e.closest(".tabpanel"), i = Zt.get(r);
		i || (i = new IntersectionObserver(n, {
			root: r,
			rootMargin: "50% 0px 50% 0px",
			threshold: 0
		}), Zt.set(r, i), t.addEventListener("abort", () => {
			i.disconnect();
		})), i.observe(e);
	}
}
var $t = [], { assign: Q } = Object;
function en(e, t) {
	let n = {}, r = new AbortController(), i = r.signal, { state: a, createEffect: o } = Xt(i), s = /* @__PURE__ */ new Map();
	Q(a, {
		skinToneEmoji: void 0,
		i18n: void 0,
		database: void 0,
		customEmoji: void 0,
		customCategorySorting: void 0,
		emojiVersion: void 0
	}), Q(a, t), Q(a, {
		initialLoad: !0,
		currentEmojis: [],
		currentEmojisWithCategories: [],
		rawSearchText: "",
		searchText: "",
		searchMode: !1,
		activeSearchItem: -1,
		message: void 0,
		skinTonePickerExpanded: !1,
		skinTonePickerExpandedAfterAnimation: !1,
		currentSkinTone: 0,
		activeSkinTone: 0,
		skinToneButtonText: void 0,
		pickerStyle: void 0,
		skinToneButtonLabel: "",
		skinTones: [],
		currentFavorites: [],
		defaultFavoriteEmojis: void 0,
		numColumns: at,
		isRtl: !1,
		currentGroupIndex: 0,
		groups: Ze,
		databaseLoaded: !1,
		activeSearchItemId: void 0
	}), o(() => {
		a.currentGroup !== a.groups[a.currentGroupIndex] && (a.currentGroup = a.groups[a.currentGroupIndex]);
	});
	let c = (t) => {
		e.getElementById(t).focus();
	}, l = (t) => e.getElementById(`emo-${t.id}`), u = (e, t) => {
		n.rootElement.dispatchEvent(new CustomEvent(e, {
			detail: t,
			bubbles: !0,
			composed: !0
		}));
	}, d = (e, t) => e.id === t.id, f = (e, t) => {
		let { category: n, emojis: r } = e, { category: i, emojis: a } = t;
		return n === i ? Z(r, a, d) : !1;
	}, p = (e) => {
		Z(a.currentEmojis, e, d) || (a.currentEmojis = e);
	}, m = (e) => {
		a.searchMode !== e && (a.searchMode = e);
	}, h = (e) => {
		Z(a.currentEmojisWithCategories, e, f) || (a.currentEmojisWithCategories = e);
	}, g = (e, t) => t && e.skins && e.skins[t] || e.unicode, _ = {
		labelWithSkin: (e, t) => Mt([
			e.name || g(e, t),
			e.annotation,
			...e.shortcodes || $t
		].filter(Boolean)).join(", "),
		titleForEmoji: (e) => e.annotation || (e.shortcodes || $t).join(", "),
		unicodeWithSkin: g
	}, v = {
		onClickSkinToneButton: ie,
		onEmojiClick: ne,
		onNavClick: j,
		onNavKeydown: te,
		onSearchKeydown: A,
		onSkinToneOptionsClick: re,
		onSkinToneOptionsFocusOut: oe,
		onSkinToneOptionsKeydown: ae,
		onSkinToneOptionsKeyup: F,
		onSearchInput: I
	}, y = {
		calculateEmojiGridStyle: S,
		updateOnIntersection: C
	}, b = !0;
	o(() => {
		Yt(e, a, _, v, y, n, i, s, b), b = !1;
	}), a.emojiVersion || mt().then((e) => {
		/* istanbul ignore next */
		e || (a.message = a.i18n.emojiUnsupportedMessage);
	}), o(() => {
		async function e() {
			let e = !1, t = setTimeout(() => {
				e = !0, a.message = a.i18n.loadingMessage;
			}, rt);
			try {
				await a.database.ready(), a.databaseLoaded = !0;
			} catch (e) {
				console.error(e), a.message = a.i18n.networkErrorMessage;
			} finally {
				clearTimeout(t), e && (e = !1, a.message = "");
			}
		}
		a.database && e();
	}), o(() => {
		a.pickerStyle = `
      --num-groups: ${a.groups.length}; 
      --indicator-opacity: ${+!a.searchMode}; 
      --num-skintones: ${$e};`;
	}), o(() => {
		a.customEmoji && a.database && x();
	}), o(() => {
		a.customEmoji && a.customEmoji.length ? a.groups !== Xe && (a.groups = Xe) : a.groups !== Ze && (a.currentGroupIndex && a.currentGroupIndex--, a.groups = Ze);
	}), o(() => {
		async function e() {
			a.databaseLoaded && (a.currentSkinTone = await a.database.getPreferredSkinTone());
		}
		e();
	}), o(() => {
		a.skinTones = Array($e).fill().map((e, t) => xt(a.skinToneEmoji, t));
	}), o(() => {
		a.skinToneButtonText = a.skinTones[a.currentSkinTone];
	}), o(() => {
		a.skinToneButtonLabel = a.i18n.skinToneLabel.replace("{skinTone}", a.i18n.skinTones[a.currentSkinTone]);
	}), o(() => {
		async function e() {
			let { database: e } = a, t = (await Promise.all(ot.map((t) => e.getEmojiByUnicodeOrName(t)))).filter(Boolean);
			a.defaultFavoriteEmojis = t;
		}
		a.databaseLoaded && e();
	});
	function x() {
		let { customEmoji: e, database: t } = a, n = e || $t;
		t.customEmoji !== n && (t.customEmoji = n);
	}
	o(() => {
		async function e() {
			x();
			let { database: e, defaultFavoriteEmojis: t, numColumns: n } = a, r = await O(Ct([...await e.getTopFavoriteEmoji(n), ...t], (e) => e.unicode || e.name).slice(0, n));
			a.currentFavorites = r;
		}
		a.databaseLoaded && a.defaultFavoriteEmojis && e();
	});
	function S(e) {
		Et(e, i, () => {
			/* istanbul ignore next */
			{
				let e = getComputedStyle(n.rootElement), t = parseInt(e.getPropertyValue("--num-columns"), 10), r = e.getPropertyValue("direction") === "rtl";
				a.numColumns = t, a.isRtl = r;
			}
		});
	}
	function C(e) {
		Qt(e, i, (e) => {
			for (let { target: t, isIntersecting: n } of e) t.classList.toggle("onscreen", n);
		});
	}
	o(() => {
		async function e() {
			let { searchText: e, currentGroup: t, databaseLoaded: n, customEmoji: r } = a;
			if (!n) a.currentEmojis = [], a.searchMode = !1;
			else if (e.length >= Qe) {
				let t = await k(e);
				a.searchText === e && (p(t), m(!0));
			} else {
				let { id: e } = t;
				if (e !== -1 || r && r.length) {
					let t = await ee(e);
					a.currentGroup.id === e && (p(t), m(!1));
				}
			}
		}
		e();
	});
	let w = () => {
		q(() => Nt(n.tabpanelElement));
	};
	o(() => {
		let { currentEmojis: e, emojiVersion: t } = a, n = e.filter((e) => e.unicode).filter((e) => tt(e) && !ht.has(e.unicode));
		if (!t && n.length) p(e), q(() => T(n));
		else {
			let n = t ? e : e.filter(E);
			p(n), w();
		}
	});
	function T(e) {
		jt(e, n.baselineEmoji, l) ? w() : a.currentEmojis = [...a.currentEmojis];
	}
	function E(e) {
		return !e.unicode || !tt(e) || ht.get(e.unicode);
	}
	async function D(e) {
		let t = a.emojiVersion || await mt();
		return e.filter(({ version: e }) => !e || e <= t);
	}
	async function O(e) {
		return wt(e, a.emojiVersion || await mt());
	}
	async function ee(e) {
		return O(await D(e === -1 ? a.customEmoji : await a.database.getEmojiByGroup(e)));
	}
	async function k(e) {
		return O(await D(await a.database.getEmojiBySearchQuery(e)));
	}
	o(() => {}), o(() => {
		function e() {
			let { searchMode: e, currentEmojis: t } = a;
			if (e) return [{
				category: "",
				emojis: t
			}];
			let n = /* @__PURE__ */ new Map();
			for (let e of t) {
				let t = e.category || "", r = n.get(t);
				r || (r = [], n.set(t, r)), r.push(e);
			}
			return [...n.entries()].map(([e, t]) => ({
				category: e,
				emojis: t
			})).sort((e, t) => a.customCategorySorting(e.category, t.category));
		}
		let t = e();
		h(t);
	}), o(() => {
		a.activeSearchItemId = a.activeSearchItem !== -1 && a.currentEmojis[a.activeSearchItem].id;
	}), o(() => {
		let { rawSearchText: e } = a;
		et(() => {
			a.searchText = (e || "").trim(), a.activeSearchItem = -1;
		});
	});
	function A(e) {
		if (!a.searchMode || !a.currentEmojis.length) return;
		let t = (t) => {
			K(e), a.activeSearchItem = St(t, a.activeSearchItem, a.currentEmojis);
		};
		switch (e.key) {
			case "ArrowDown": return t(!1);
			case "ArrowUp": return t(!0);
			case "Enter": if (a.activeSearchItem === -1) a.activeSearchItem = 0;
			else return K(e), N(a.currentEmojis[a.activeSearchItem].id);
		}
	}
	function j(e) {
		let { target: t } = e, r = t.closest(".nav-button");
		/* istanbul ignore if */
		if (!r) return;
		let i = parseInt(r.dataset.groupId, 10);
		n.searchElement.value = "", a.rawSearchText = "", a.searchText = "", a.activeSearchItem = -1, a.currentGroupIndex = a.groups.findIndex((e) => e.id === i);
	}
	function te(e) {
		let { target: t, key: n } = e, r = (t) => {
			t && (K(e), t.focus());
		};
		switch (n) {
			case "ArrowLeft": return r(t.previousElementSibling);
			case "ArrowRight": return r(t.nextElementSibling);
			case "Home": return r(t.parentElement.firstElementChild);
			case "End": return r(t.parentElement.lastElementChild);
		}
	}
	async function M(e) {
		let t = await a.database.getEmojiByUnicodeOrName(e), n = [...a.currentEmojis, ...a.currentFavorites].find((t) => t.id === e), r = n.unicode && g(n, a.currentSkinTone);
		return await a.database.incrementFavoriteEmojiCount(e), {
			emoji: t,
			skinTone: a.currentSkinTone,
			...r && { unicode: r },
			...n.name && { name: n.name }
		};
	}
	async function N(e) {
		let t = M(e);
		u("emoji-click-sync", t), u("emoji-click", await t);
	}
	function ne(e) {
		let { target: t } = e;
		t.classList.contains("emoji") && (K(e), N(t.id.substring(4)));
	}
	function P(e) {
		a.currentSkinTone = e, a.skinTonePickerExpanded = !1, c("skintone-button"), u("skin-tone-change", { skinTone: e }), a.database.setPreferredSkinTone(e);
	}
	function re(e) {
		let { target: { id: t } } = e, n = t && t.match(/^skintone-(\d)/);
		n && (K(e), P(parseInt(n[1], 10)));
	}
	function ie(e) {
		a.skinTonePickerExpanded = !a.skinTonePickerExpanded, a.activeSkinTone = a.currentSkinTone, a.skinTonePickerExpanded && (K(e), q(() => c("skintone-list")));
	}
	o(() => {
		a.skinTonePickerExpanded ? n.skinToneDropdown.addEventListener("transitionend", () => {
			a.skinTonePickerExpandedAfterAnimation = !0;
		}, { once: !0 }) : a.skinTonePickerExpandedAfterAnimation = !1;
	});
	function ae(e) {
		/* istanbul ignore if */
		if (!a.skinTonePickerExpanded) return;
		let t = async (t) => {
			K(e), a.activeSkinTone = t;
		};
		switch (e.key) {
			case "ArrowUp": return t(St(!0, a.activeSkinTone, a.skinTones));
			case "ArrowDown": return t(St(!1, a.activeSkinTone, a.skinTones));
			case "Home": return t(0);
			case "End": return t(a.skinTones.length - 1);
			case "Enter": return K(e), P(a.activeSkinTone);
			case "Escape": return K(e), a.skinTonePickerExpanded = !1, c("skintone-button");
		}
	}
	function F(e) {
		if (a.skinTonePickerExpanded) switch (e.key) {
			case " ": return K(e), P(a.activeSkinTone);
		}
	}
	async function oe(e) {
		let { relatedTarget: t } = e;
		/* istanbul ignore else */
		(!t || t.id !== "skintone-list") && (a.skinTonePickerExpanded = !1);
	}
	function I(e) {
		a.rawSearchText = e.target.value;
	}
	return {
		$set(e) {
			Q(a, e);
		},
		$destroy() {
			r.abort();
		}
	};
}
var tn = "https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json", nn = "en", rn = {
	categoriesLabel: "Categories",
	emojiUnsupportedMessage: "Your browser does not support color emoji.",
	favoritesLabel: "Favorites",
	loadingMessage: "Loading…",
	networkErrorMessage: "Could not load emoji.",
	regionLabel: "Emoji picker",
	searchDescription: "When search results are available, press up or down to select and enter to choose.",
	searchLabel: "Search",
	searchResultsLabel: "Search results",
	skinToneDescription: "When expanded, press up or down to select and enter to choose.",
	skinToneLabel: "Choose a skin tone (currently {skinTone})",
	skinTonesLabel: "Skin tones",
	skinTones: [
		"Default",
		"Light",
		"Medium-Light",
		"Medium",
		"Medium-Dark",
		"Dark"
	],
	categories: {
		custom: "Custom",
		"smileys-emotion": "Smileys and emoticons",
		"people-body": "People and body",
		"animals-nature": "Animals and nature",
		"food-drink": "Food and drink",
		"travel-places": "Travel and places",
		activities: "Activities",
		objects: "Objects",
		symbols: "Symbols",
		flags: "Flags"
	}
}, an = ":host{--emoji-size:1.375rem;--emoji-padding:0.5rem;--category-emoji-size:var(--emoji-size);--category-emoji-padding:var(--emoji-padding);--indicator-height:3px;--input-border-radius:0.5rem;--input-border-size:1px;--input-font-size:1rem;--input-line-height:1.5;--input-padding:0.25rem;--num-columns:8;--outline-size:2px;--border-size:1px;--border-radius:0;--skintone-border-radius:1rem;--category-font-size:1rem;display:flex;width:min-content;height:400px}:host,:host(.light){color-scheme:light;--background:#fff;--border-color:#e0e0e0;--indicator-color:#385ac1;--input-border-color:#999;--input-font-color:#111;--input-placeholder-color:#999;--outline-color:#999;--category-font-color:#111;--button-active-background:#e6e6e6;--button-hover-background:#d9d9d9}:host(.dark){color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}@media (prefers-color-scheme:dark){:host{color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}}:host([hidden]){display:none}button{margin:0;padding:0;border:0;background:0 0;box-shadow:none;-webkit-tap-highlight-color:transparent}button::-moz-focus-inner{border:0}input{padding:0;margin:0;line-height:1.15;font-family:inherit}input[type=search]{-webkit-appearance:none}:focus{outline:var(--outline-color) solid var(--outline-size);outline-offset:calc(-1*var(--outline-size))}:host([data-js-focus-visible]) :focus:not([data-focus-visible-added]){outline:0}:focus:not(:focus-visible){outline:0}.hide-focus{outline:0}*{box-sizing:border-box}.picker{contain:content;display:flex;flex-direction:column;background:var(--background);border:var(--border-size) solid var(--border-color);border-radius:var(--border-radius);width:100%;height:100%;overflow:hidden;--total-emoji-size:calc(var(--emoji-size) + (2 * var(--emoji-padding)));--total-category-emoji-size:calc(var(--category-emoji-size) + (2 * var(--category-emoji-padding)))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.hidden{opacity:0;pointer-events:none}.abs-pos{position:absolute;left:0;top:0}.gone{display:none!important}.skintone-button-wrapper,.skintone-list{background:var(--background);z-index:3}.skintone-button-wrapper.expanded{z-index:1}.skintone-list{position:absolute;inset-inline-end:0;top:0;z-index:2;overflow:visible;border-bottom:var(--border-size) solid var(--border-color);border-radius:0 0 var(--skintone-border-radius) var(--skintone-border-radius);will-change:transform;transition:transform .2s ease-in-out;transform-origin:center 0}@media (prefers-reduced-motion:reduce){.skintone-list{transition-duration:.001s}}@supports not (inset-inline-end:0){.skintone-list{right:0}}.skintone-list.no-animate{transition:none}.tabpanel{overflow-y:auto;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;will-change:transform;min-height:0;flex:1;contain:content}.emoji-menu{display:grid;grid-template-columns:repeat(var(--num-columns),var(--total-emoji-size));justify-content:space-around;align-items:flex-start;width:100%}.emoji-menu.visibility-auto{content-visibility:auto;contain-intrinsic-size:calc(var(--num-columns)*var(--total-emoji-size)) calc(var(--num-rows)*var(--total-emoji-size))}.category{padding:var(--emoji-padding);font-size:var(--category-font-size);color:var(--category-font-color)}.emoji,button.emoji{font-size:var(--emoji-size);display:flex;align-items:center;justify-content:center;border-radius:100%;height:var(--total-emoji-size);width:var(--total-emoji-size);line-height:1;overflow:hidden;font-family:var(--emoji-font-family);cursor:pointer}@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{background:var(--button-hover-background)}}.emoji.active,.emoji:active,button.emoji.active,button.emoji:active{background:var(--button-active-background)}.onscreen .custom-emoji::after{content:\"\";width:var(--emoji-size);height:var(--emoji-size);background-repeat:no-repeat;background-position:center center;background-size:contain;background-image:var(--custom-emoji-background)}.nav,.nav-button{align-items:center}.nav{display:grid;justify-content:space-between;contain:content}.nav-button{display:flex;justify-content:center}.nav-emoji{font-size:var(--category-emoji-size);width:var(--total-category-emoji-size);height:var(--total-category-emoji-size)}.indicator-wrapper{display:flex;border-bottom:1px solid var(--border-color)}.indicator{width:calc(100%/var(--num-groups));height:var(--indicator-height);opacity:var(--indicator-opacity);background-color:var(--indicator-color);will-change:transform,opacity;transition:opacity .1s linear,transform .25s ease-in-out}@media (prefers-reduced-motion:reduce){.indicator{will-change:opacity;transition:opacity .1s linear}}.pad-top,input.search{background:var(--background);width:100%}.pad-top{height:var(--emoji-padding);z-index:3}.search-row{display:flex;align-items:center;position:relative;padding-inline-start:var(--emoji-padding);padding-bottom:var(--emoji-padding)}.search-wrapper{flex:1;min-width:0}input.search{padding:var(--input-padding);border-radius:var(--input-border-radius);border:var(--input-border-size) solid var(--input-border-color);color:var(--input-font-color);font-size:var(--input-font-size);line-height:var(--input-line-height)}input.search::placeholder{color:var(--input-placeholder-color)}.favorites{overflow-y:auto;scrollbar-gutter:stable;display:flex;flex-direction:row;border-top:var(--border-size) solid var(--border-color);contain:content}.message{padding:var(--emoji-padding)}", on = [
	"customEmoji",
	"customCategorySorting",
	"database",
	"dataSource",
	"i18n",
	"locale",
	"skinToneEmoji",
	"emojiVersion"
], sn = `:host{--emoji-font-family:${st}}`, $ = class extends HTMLElement {
	constructor(e) {
		super(), this.attachShadow({ mode: "open" });
		let t = document.createElement("style");
		t.textContent = an + sn, this.shadowRoot.appendChild(t), this._ctx = {
			locale: nn,
			dataSource: tn,
			skinToneEmoji: it,
			customCategorySorting: ct,
			customEmoji: null,
			i18n: rn,
			emojiVersion: null,
			...e
		};
		for (let e of on) e !== "database" && Object.prototype.hasOwnProperty.call(this, e) && (this._ctx[e] = this[e], delete this[e]);
		this._dbFlush();
	}
	connectedCallback() {
		ln(this), this._cmp ||= en(this.shadowRoot, this._ctx);
	}
	disconnectedCallback() {
		ln(this), X(() => {
			if (!this.isConnected && this._cmp) {
				this._cmp.$destroy(), this._cmp = void 0;
				let { database: e } = this._ctx;
				e.close().catch((e) => console.error(e));
			}
		});
	}
	static get observedAttributes() {
		return [
			"locale",
			"data-source",
			"skin-tone-emoji",
			"emoji-version"
		];
	}
	attributeChangedCallback(e, t, n) {
		this._set(e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), e === "emoji-version" ? parseFloat(n) : n);
	}
	_set(e, t) {
		this._ctx[e] = t, this._cmp && this._cmp.$set({ [e]: t }), ["locale", "dataSource"].includes(e) && this._dbFlush();
	}
	_dbCreate() {
		let { locale: e, dataSource: t, database: n } = this._ctx;
		(!n || n.locale !== e || n.dataSource !== t) && this._set("database", new Ye({
			locale: e,
			dataSource: t
		}));
	}
	_dbFlush() {
		X(() => this._dbCreate());
	}
}, cn = {};
for (let e of on) cn[e] = {
	get() {
		return e === "database" && this._dbCreate(), this._ctx[e];
	},
	set(t) {
		if (e === "database") throw Error("database is read-only");
		this._set(e, t);
	}
};
Object.defineProperties($.prototype, cn);
function ln(e) {
	/* istanbul ignore if */
	e instanceof $ || Object.setPrototypeOf(e, customElements.get(e.tagName.toLowerCase()).prototype);
}
/* istanbul ignore else */
customElements.get("emoji-picker") || customElements.define("emoji-picker", $);
//#endregion
//#region src/components/on-demand/wt-chat-emoji/wt-chat-emoji.vue
var un = { class: "wt-chat-emoji" }, dn = /*#__PURE__*/ e({
	__name: "wt-chat-emoji",
	props: {
		size: {
			type: String,
			default: t.MD
		},
		popupTeleportTo: {
			type: String,
			default: ""
		},
		filled: {
			type: Boolean,
			default: !1
		},
		rounded: {
			type: Boolean,
			default: !0
		}
	},
	emits: ["insert-emoji"],
	setup(e, { emit: t }) {
		let _ = e, v = t, y = p(null), b = p(!1), x = p(null), S = a(() => _.popupTeleportTo || "body"), C = a(() => _.filled || b.value ? "active" : "outlined"), w = async () => {
			x.value || (x.value = document.createElement("emoji-picker"), T(), x.value.addEventListener("emoji-click", E));
		}, T = () => {
			y.value && x.value && y.value.appendChild(x.value);
		}, E = (e) => {
			let { unicode: t } = e.detail;
			v("insert-emoji", t), D();
		}, D = () => {
			b.value = !1, x.value && y.value && (x.value.removeEventListener("emoji-click", E), y.value.removeChild(x.value), x.value = null);
		}, O = (e) => {
			y.value?.contains(e.target) || D();
		}, ee = async () => {
			k(), b.value = !b.value, b.value ? (await u(), await w()) : D();
		}, k = () => r.$emit("chat-input-focus");
		return d(() => {
			D();
		}), (t, r) => {
			let a = m("clickaway");
			return g((f(), c("div", un, [l(h(n), {
				size: e.size,
				variant: C.value,
				color: "secondary",
				icon: "chat-emoji",
				rounded: e.rounded,
				wide: "",
				onClick: ee
			}, null, 8, [
				"size",
				"variant",
				"rounded"
			]), (f(), o(i, {
				defer: "",
				disabled: !e.popupTeleportTo,
				to: S.value
			}, [b.value ? (f(), c("div", {
				key: 0,
				ref_key: "emojiPickerWrapper",
				ref: y,
				class: "wt-chat-emoji__wrapper"
			}, null, 512)) : s("", !0)], 8, ["disabled", "to"]))])), [[a, O]]);
		};
	}
}, [["__scopeId", "data-v-d6ce560a"]]);
//#endregion
export { dn as default };
