芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/public_html/wp-content/plugins/chaty/admin/assets/js/picmo-umd.min.js
var ye=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)},w=(e,t,o)=>(ye(e,t,"read from private field"),o?o.call(e):t.get(e)),b=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},J=(e,t,o,i)=>(ye(e,t,"write to private field"),i?i.call(e,o):t.set(e,o),o),v=(e,t,o)=>(ye(e,t,"access private method"),o);!function(e,t){"object"==typeof exports&&typeof module<"u"?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=typeof globalThis<"u"?globalThis:e||self).picmo={})}(this,(function(e){var t,o,i,s,r,a,n,c,l,h,d,m,u,p;async function g(e,t={}){const{local:o=!1,version:i="latest",cdnUrl:s,...r}=t,a=function(e,t,o){let i=`https://cdn.jsdelivr.net/npm/emojibase-data@${t}/${e}`;return"function"==typeof o?i=o(e,t):"string"==typeof o&&(i=`${o}/${e}`),i}(e,i,s),n=o?localStorage:sessionStorage,c=`emojibase/${i}/${e}`,l=n.getItem(c);if(l)return Promise.resolve(JSON.parse(l));const h=await fetch(a,{credentials:"omit",mode:"cors",redirect:"error",...r});if(!h.ok)throw new Error("Failed to load Emojibase dataset.");const d=await h.json();try{n.setItem(c,JSON.stringify(d))}catch{}return d}const y={discord:"joypixels",slack:"iamcal"};async function f(e,t,o){var i;return g(`${e}/shortcodes/${null!==(i=y[t])&&void 0!==i?i:t}.json`,o)}function j(e,t){if(0===t.length)return e;const o=new Set(e.shortcodes);return t.forEach((t=>{const i=t[e.hexcode];Array.isArray(i)?i.forEach((e=>o.add(e))):i&&o.add(i)})),e.shortcodes=[...o],e.skins&&e.skins.forEach((e=>{j(e,t)})),e}async function C(e,t={}){const{compact:o=!1,flat:i=!1,shortcodes:s=[],...r}=t,a=await g(`${e}/${o?"compact":"data"}.json`,r);let n=[];return s.length>0&&(n=await Promise.all(s.map((t=>{let o;if(t.includes("/")){const[e,i]=t.split("/");o=f(e,i,r)}else o=f(e,t,r);return o.catch((()=>({})))})))),i?function(e,t=[]){const o=[];return e.forEach((e=>{if(e.skins){const{skins:i,...s}=e;o.push(j(s,t)),i.forEach((e=>{const i={...e};s.tags&&(i.tags=[...s.tags]),o.push(j(i,t))}))}else o.push(j(e,t))})),o}(a,n):function(e,t){return 0===t.length||e.forEach((e=>{j(e,t)})),e}(a,n)}async function k(e,t){return g(`${e}/messages.json`,t)}function _(e,t){const o=e.target.closest("[data-emoji]");if(o){const e=t.find((e=>e.emoji===o.dataset.emoji));if(e)return e}return null}function x(e){var t;const o=null==(t=window.matchMedia)?void 0:t.call(window,"(prefers-reduced-motion: reduce)");return e.animate&&!(null!=o&&o.matches)}function E(e,t){return e.toLowerCase().includes(t.toLowerCase())}function S(e,t){let o=null;return()=>{o||(o=window.setTimeout((()=>{e(),o=null}),t))}}function z(e,t){let o=null;return(...i)=>{o&&window.clearTimeout(o),o=window.setTimeout((()=>{e(...i),o=null}),t)}}function P(e,t,o,i){if(x(i)&&e.animate)return e.animate(t,o).finished;const s="normal"===o.direction?1:0,r=Object.entries(t).reduce(((e,[t,o])=>({...e,[t]:o[s]})),{});return Object.assign(e.style,r),Promise.resolve()}function L(e){var t;const o=document.createElement("template");return o.innerHTML=e,null==(t=o.content)?void 0:t.firstElementChild}async function F(e){const t=(new TextEncoder).encode(e),o=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(o)).map((e=>e.toString(16).padStart(2,"0"))).join("")}function $(...e){return e.reduce(((e,t)=>({...e,[t]:A(t)})),{})}function A(e){return`picmo__${e}`}function I(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function T(e,...t){I(e).append(...t)}function M(e){try{return window[e].length,!0}catch{return!1}}function V(){return M("sessionStorage")}function R(){return M("localStorage")}function D(e){var t;return{emoji:e.emoji,label:e.label,tags:e.tags,skins:null==(t=e.skins)?void 0:t.map((e=>D(e))),order:e.order,custom:!1,hexcode:e.hexcode,version:e.version}}function B(e,t,o){var i;return!(o&&!o.some((t=>t.order===e.group)))&&(E(e.label,t)||(null==(i=e.tags)?void 0:i.some((e=>E(e,t)))))}class N{constructor(e="en"){this.locale=e}}const H=[(e,t)=>("1F91D"===e.hexcode&&t<14&&(e.skins=[]),e),(e,t)=>(e.skins&&(e.skins=e.skins.filter((e=>!e.version||e.version<=t))),e)];function O(e,t){return e.filter((e=>null!==function(e,t){return H.some((o=>null===o(e,t)))?null:e}(e,t)))}const K={};function U(e){return K[e]||(K[e]=new W(e)),K[e]}U.deleteDatabase=e=>{};class W extends N{open(){return Promise.resolve()}delete(){return Promise.resolve()}close(){}isPopulated(){return Promise.resolve(!1)}getEmojiCount(){return Promise.resolve(this.emojis.length)}getEtags(){return Promise.resolve({foo:"bar"})}getHash(){return Promise.resolve("")}populate(e){return this.categories=e.groups,this.emojis=e.emojis,Promise.resolve()}getCategories(e){var t;let o=this.categories.filter((e=>"component"!==e.key));if(e.showRecents&&o.unshift({key:"recents",order:-1}),null!=(t=e.custom)&&t.length&&o.push({key:"custom",order:10}),e.categories){const t=e.categories;o=o.filter((e=>t.includes(e.key))),o.sort(((e,o)=>t.indexOf(e.key)-t.indexOf(o.key)))}else o.sort(((e,t)=>e.order-t.order));return Promise.resolve(o)}getEmojis(e,t){const o=this.emojis.filter((t=>t.group===e.order)).filter((e=>e.version<=t)).sort(((e,t)=>null!=e.order&&null!=t.order?e.order-t.order:0)).map(D);return Promise.resolve(O(o,t))}searchEmojis(e,t,o,i){const s=this.emojis.filter((t=>B(t,e,i)&&t.version<=o)).map(D),r=t.filter((t=>B(t,e,i))),a=[...O(s,o),...r];return Promise.resolve(a)}setMeta(e){this.meta=e}}async function q(e){try{return(await fetch(e,{method:"HEAD"})).headers.get("etag")}catch{return null}}async function G(e,t,o){let i=o||t(e);try{await i.open()}catch{console.warn("[picmo] IndexedDB not available, falling back to InMemoryStoreFactory"),i=U(e)}return i}async function Z(e,t,o){if(!V()&&typeof window<"u")throw new Error("Session storage is required to use CDN emoji data.");const i=await G(e,t,o),[s,r]=await function(e){const{emojisUrl:t,messagesUrl:o}=function(e,t){const o=`https://cdn.jsdelivr.net/npm/emojibase-data@${"latest"}/${t}`;return{emojisUrl:`${o}/data.json`,messagesUrl:`${o}/messages.json`}}(0,e);try{return Promise.all([q(t),q(o)])}catch{return Promise.all([null,null])}}(e);if(await i.isPopulated())s&&r&&await async function(e,t,o){let i;try{i=await e.getEtags()}catch{i={}}const{storedEmojisEtag:s,storedMessagesEtag:r}=i;if(o!==r||t!==s){const[i,s]=await Promise.all([k(e.locale),C(e.locale)]);await e.populate({groups:i.groups,emojis:s,emojisEtag:t,messagesEtag:o})}}(i,s,r);else{const[t,o]=await Promise.all([k(e),C(e)]);await i.populate({groups:t.groups,emojis:o,emojisEtag:s,messagesEtag:r})}return i}async function Y(e,t,o,i,s){return o&&i?async function(e,t,o,i,s){const r=await G(e,t,s),a=await F(i);return(!await r.isPopulated()||await async function(e,t){return t!==await e.getHash()}(r,a))&&await r.populate({groups:o.groups,emojis:i,hash:a}),r}(e,t,o,i,s):Z(e,t,s)}class Q{constructor(){this.handleKeyDown=this.handleKeyDown.bind(this)}activate(e){this.rootElement=e,this.rootElement.addEventListener("keydown",this.handleKeyDown)}deactivate(){var e;null==(e=this.rootElement)||e.removeEventListener("keydown",this.handleKeyDown)}get focusableElements(){return this.rootElement.querySelectorAll('input, [tabindex="0"]')}get lastFocusableElement(){return this.focusableElements[this.focusableElements.length-1]}get firstFocusableElement(){return this.focusableElements[0]}checkFocus(e,t,o){e.target===t&&(o.focus(),e.preventDefault())}handleKeyDown(e){"Tab"===e.key&&this.checkFocus(e,e.shiftKey?this.firstFocusableElement:this.lastFocusableElement,e.shiftKey?this.lastFocusableElement:this.firstFocusableElement)}}const{light:X,dark:ee,auto:te}=$("light","dark","auto");class oe{constructor({template:e,classes:t,parent:o}){this.isDestroyed=!1,this.appEvents={},this.uiEvents=[],this.uiElements={},this.ui={},this.template=e,this.classes=t,this.parent=o,this.keyBindingHandler=this.keyBindingHandler.bind(this)}initialize(){this.bindAppEvents()}setCustomEmojis(e){this.customEmojis=e}setEvents(e){this.events=e}setPickerId(e){this.pickerId=e}emit(e,...t){this.events.emit(e,...t)}setI18n(e){this.i18n=e}setRenderer(e){this.renderer=e}setEmojiData(e){this.emojiDataPromise=e,e.then((e=>{this.emojiData=e}))}updateEmojiData(e){this.emojiData=e,this.emojiDataPromise=Promise.resolve(e)}setOptions(e){this.options=e}renderSync(e={}){return this.el=this.template.renderSync({classes:this.classes,i18n:this.i18n,pickerId:this.pickerId,...e}),this.postRender(),this.el}async render(e={}){return await this.emojiDataPromise,this.el=await this.template.renderAsync({classes:this.classes,i18n:this.i18n,pickerId:this.pickerId,...e}),this.postRender(),this.el}postRender(){this.bindUIElements(),this.bindKeyBindings(),this.bindUIEvents(),this.scheduleShowAnimation()}bindAppEvents(){Object.keys(this.appEvents).forEach((e=>{this.events.on(e,this.appEvents[e],this)})),this.events.on("data:ready",this.updateEmojiData,this)}unbindAppEvents(){Object.keys(this.appEvents).forEach((e=>{this.events.off(e,this.appEvents[e])})),this.events.off("data:ready",this.updateEmojiData)}keyBindingHandler(e){const t=this.keyBindings[e.key];t&&t.call(this,e)}bindKeyBindings(){this.keyBindings&&this.el.addEventListener("keydown",this.keyBindingHandler)}unbindKeyBindings(){this.keyBindings&&this.el.removeEventListener("keydown",this.keyBindingHandler)}bindUIElements(){this.ui=Object.keys(this.uiElements).reduce(((e,t)=>({...e,[t]:this.el.querySelector(this.uiElements[t])})),{})}bindUIEvents(){this.uiEvents.forEach((e=>{e.handler=e.handler.bind(this),(e.target?this.ui[e.target]:this.el).addEventListener(e.event,e.handler,e.options)}))}unbindUIEvents(){this.uiEvents.forEach((e=>{(e.target?this.ui[e.target]:this.el).removeEventListener(e.event,e.handler)}))}destroy(){this.unbindAppEvents(),this.unbindUIEvents(),this.unbindKeyBindings(),this.el.remove(),this.isDestroyed=!0}scheduleShowAnimation(){if(this.parent){const e=new MutationObserver((t=>{const[o]=t;"childList"===o.type&&o.addedNodes[0]===this.el&&(x(this.options)&&this.animateShow&&this.animateShow(),e.disconnect)}));e.observe(this.parent,{childList:!0})}}static childEvent(e,t,o,i={}){return{target:e,event:t,handler:o,options:i}}static uiEvent(e,t,o={}){return{event:e,handler:t,options:o}}static byClass(e){return`.${e}`}}const ie={clock:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',flag:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',frown:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',gamepad:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',lightbulb:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',mug:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',plane:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',robot:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',sad:'
\n
\n
\n
\n
\n
\n
\n \x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e\n
\n
\n
\n
\n
\n
',search:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',smiley:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',symbols:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',tree:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',users:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
',warning:'
\n
\n
\n
\n
\n
\n
\n \x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e\n
\n
',xmark:'
\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e
'},se={recents:"clock","smileys-emotion":"smiley","people-body":"users","animals-nature":"tree","food-drink":"mug",activities:"gamepad","travel-places":"plane",objects:"lightbulb",symbols:"symbols",flags:"flag",custom:"robot"};function re(e,t){if(!(e in ie))return console.warn(`Unknown icon: "${e}"`),document.createElement("div");const o=function(e,t){const o=L(t);return o.dataset.icon=e,o.classList.add(A("icon")),o}(e,ie[e]);return t&&o.classList.add(A(`icon-${t}`)),o}const ae="sync";class ne{constructor(e,s={}){b(this,i),b(this,r),b(this,n),b(this,t,void 0),b(this,o,void 0),J(this,t,e),J(this,o,s.mode||ae)}renderSync(e={}){const o=L(w(this,t).call(this,e));return v(this,n,c).call(this,o,e),v(this,r,a).call(this,o),v(this,i,s).call(this,o,e),o}async renderAsync(e={}){const o=L(w(this,t).call(this,e));return v(this,n,c).call(this,o,e),v(this,r,a).call(this,o),await v(this,i,s).call(this,o,e),o}render(e){return"sync"===w(this,o)?this.renderSync(e):this.renderAsync(e)}}t=new WeakMap,o=new WeakMap,i=new WeakSet,s=async function(e,t){const o=e.querySelectorAll("[data-view]"),i=[];for(const e of o){const o=t[e.dataset.view];o?"sync"!==e.dataset.render?i.push(o.render().then((t=>(e.replaceWith(t),t)))):e.replaceWith(o.renderSync()):e.remove()}return Promise.all(i)},r=new WeakSet,a=function(e){e.querySelectorAll("i[data-icon]").forEach((e=>{const{icon:t,size:o}=e.dataset;e.replaceWith(re(t,o))}))},n=new WeakSet,c=function(e,t){return e.querySelectorAll("[data-placeholder]").forEach((e=>{const o=e.dataset.placeholder;if(o&&t[o]){const i=t[o];e.replaceWith(...[i].flat())}else console.warn(`Missing placeholder element for key "${o}"`)})),e};const ce=$("imagePlaceholder","placeholder"),le=new ne((({classes:e})=>`\n
\n`));class he extends oe{constructor({classNames:e}={}){super({template:le,classes:ce}),this.classNames=e}load(e){const t=document.createElement("img");this.classNames&&(t.className=this.classNames),t.addEventListener("load",(()=>{this.el.replaceWith(t)}),{once:!0}),Promise.resolve(e).then((e=>t.src=e))}renderSync(){return super.renderSync(),this.classNames&&this.classNames.split(" ").forEach((e=>this.el.classList.add(e))),this.el}}const de=$("customEmoji");class me{renderElement(e){return{content:e}}renderImage(e="",t){const o=new he({classNames:e});return o.renderSync(),{content:o,resolver:()=>(o.load(t()),o.el)}}doRender(e,t,o){if(e.custom)return this.renderCustom(e,t,o);const{content:i,resolver:s}=this.render(e,o),r=i instanceof Element?i:i.el;return s&&s(),r}doEmit(e){return e.custom?this.emitCustom(e):this.emit(e)}emitCustom({url:e,label:t,emoji:o,data:i}){return{url:e,label:t,emoji:o,data:i}}renderCustom(e,t,o=""){const i=[de.customEmoji,o].join(" ").trim(),{content:s,resolver:r}=this.renderImage(i,(()=>e.url)),a=s instanceof Element?s:s.el;return r&&r(),a}}const ue=new ne((({emoji:e})=>`
${e}
`));class pe extends me{render(e){return this.renderElement(ue.renderSync({emoji:e.emoji}))}emit({emoji:e,hexcode:t,label:o}){return{emoji:e,hexcode:t,label:o}}}const ge={"categories.activities":"Activities","categories.animals-nature":"Animals & Nature","categories.custom":"Custom","categories.flags":"Flags","categories.food-drink":"Food & Drink","categories.objects":"Objects","categories.people-body":"People & Body","categories.recents":"Recently Used","categories.smileys-emotion":"Smileys & Emotion","categories.symbols":"Symbols","categories.travel-places":"Travel & Places","error.load":"Failed to load emojis","recents.clear":"Clear recent emojis","recents.none":"You haven't selected any emojis yet.",retry:"Try again","search.clear":"Clear search","search.error":"Failed to search emojis","search.notFound":"No results found",search:"Search emojis..."},ye="PicMo";function ve(e){return new fe(e)}ve.deleteDatabase=e=>new Promise(((t,o)=>{const i=indexedDB.deleteDatabase(`${ye}-${e}`);i.addEventListener("success",t),i.addEventListener("error",o)}));class fe extends N{async open(){const e=indexedDB.open(`${ye}-${this.locale}`);return new Promise(((t,o)=>{e.addEventListener("success",(e=>{var o;this.db=null==(o=e.target)?void 0:o.result,t()})),e.addEventListener("error",o),e.addEventListener("upgradeneeded",(async e=>{var t;this.db=null==(t=e.target)?void 0:t.result,this.db.createObjectStore("category",{keyPath:"order"});const o=this.db.createObjectStore("emoji",{keyPath:"emoji"});o.createIndex("category","group"),o.createIndex("version","version"),this.db.createObjectStore("meta")}))}))}async delete(){this.close();const e=indexedDB.deleteDatabase(`${ye}-${this.locale}`);await this.waitForRequest(e)}close(){this.db.close()}async getEmojiCount(){const e=this.db.transaction("emoji","readonly").objectStore("emoji");return(await this.waitForRequest(e.count())).target.result}async getEtags(){const e=this.db.transaction("meta","readonly").objectStore("meta"),[t,o]=await Promise.all([this.waitForRequest(e.get("emojisEtag")),this.waitForRequest(e.get("messagesEtag"))]);return{storedEmojisEtag:t.target.result,storedMessagesEtag:o.target.result}}async setMeta(e){const t=this.db.transaction("meta","readwrite"),o=t.objectStore("meta");return new Promise((i=>{t.oncomplete=i,Object.keys(e).filter(Boolean).forEach((t=>{o.put(e[t],t)}))}))}async getHash(){const e=this.db.transaction("meta","readonly").objectStore("meta");return(await this.waitForRequest(e.get("hash"))).target.result}async isPopulated(){const e=this.db.transaction("category","readonly").objectStore("category");return(await this.waitForRequest(e.count())).target.result>0}async populate({groups:e,emojis:t,emojisEtag:o,messagesEtag:i,hash:s}){await this.removeAllObjects("category","emoji");const r=[this.addObjects("category",e),this.addObjects("emoji",t),this.setMeta({emojisEtag:o,messagesEtag:i,hash:s})];await Promise.all(r)}async getCategories(e){var t;const o=this.db.transaction("category","readonly").objectStore("category");let i=(await this.waitForRequest(o.getAll())).target.result.filter((e=>"component"!==e.key));if(e.showRecents&&i.unshift({key:"recents",order:-1}),null!=(t=e.custom)&&t.length&&i.push({key:"custom",order:10}),e.categories){const t=e.categories;i=i.filter((e=>t.includes(e.key))),i.sort(((e,o)=>t.indexOf(e.key)-t.indexOf(o.key)))}else i.sort(((e,t)=>e.order-t.order));return i}async getEmojis(e,t){const o=this.db.transaction("emoji","readonly").objectStore("emoji").index("category");return O((await this.waitForRequest(o.getAll(e.order))).target.result.filter((e=>e.version<=t)).sort(((e,t)=>null!=e.order&&null!=t.order?e.order-t.order:0)).map(D),t)}async searchEmojis(e,t,o,i){const s=[];return new Promise(((r,a)=>{const n=this.db.transaction("emoji","readonly").objectStore("emoji").openCursor();n.addEventListener("success",(a=>{var n;const c=null==(n=a.target)?void 0:n.result;if(!c)return r([...O(s,o),...t.filter((t=>B(t,e)))]);const l=c.value;B(l,e,i)&&l.version<=o&&s.push(D(l)),c.continue()})),n.addEventListener("error",(e=>{a(e)}))}))}async waitForRequest(e){return new Promise(((t,o)=>{e.onsuccess=t,e.onerror=o}))}withTransaction(e,t="readwrite",o){return new Promise(((i,s)=>{const r=this.db.transaction(e,t);r.oncomplete=i,r.onerror=s,o(r)}))}async removeAllObjects(...e){const t=this.db.transaction(e,"readwrite"),o=e.map((e=>t.objectStore(e)));await Promise.all(o.map((e=>this.waitForRequest(e.clear()))))}async addObjects(e,t){return this.withTransaction(e,"readwrite",(o=>{const i=o.objectStore(e);t.forEach((e=>{i.add(e)}))}))}}function we(){let e={};return{getItem:t=>e[t],setItem:(t,o)=>e[t]=o,length:Object.keys(e).length,clear:()=>e={},key:t=>Object.keys(e)[t],removeItem:t=>delete e[t]}}class be{}const je="PicMo:recents";class Ce extends be{constructor(e){super(),this.storage=e}clear(){this.storage.removeItem(je)}getRecents(e){var t;try{return JSON.parse(null!=(t=this.storage.getItem(je))?t:"[]").slice(0,e)}catch{return[]}}addOrUpdateRecent(e,t){const o=[e,...this.getRecents(t).filter((t=>t.hexcode!==e.hexcode))].slice(0,t);try{this.storage.setItem(je,JSON.stringify(o))}catch{console.warn("storage is not available, recent emojis will not be saved")}}}class ke extends Ce{constructor(){super(R()?localStorage:we())}}const _e={dataStore:ve,theme:X,animate:!0,showCategoryTabs:!0,showPreview:!0,showRecents:!0,showSearch:!0,showVariants:!0,emojisPerRow:8,visibleRows:6,emojiVersion:"auto",i18n:ge,locale:"en",maxRecents:50,custom:[]};function xe(e={}){return{..._e,...e,renderer:e.renderer||new pe,recentsProvider:e.recentsProvider||new ke}}class Ee{constructor(){b(this,h),b(this,m),b(this,l,new Map)}on(e,t,o){v(this,m,u).call(this,e,t,o)}once(e,t,o){v(this,m,u).call(this,e,t,o,!0)}off(e,t){const o=v(this,h,d).call(this,e);w(this,l).set(e,o.filter((e=>e.handler!==t)))}emit(e,...t){v(this,h,d).call(this,e).forEach((o=>{o.handler.apply(o.context,t),o.once&&this.off(e,o.handler)}))}removeAll(){w(this,l).clear()}}l=new WeakMap,h=new WeakSet,d=function(e){return w(this,l).has(e)||w(this,l).set(e,[]),w(this,l).get(e)},m=new WeakSet,u=function(e,t,o,i=!1){v(this,h,d).call(this,e).push({context:o,handler:t,once:i})};const Se={injectStyles:!0};class ze extends Ee{}class Pe extends Ee{}const Le=$("emojiCategory","categoryName","noRecents","recentEmojis");class Fe extends oe{constructor({template:e,category:t,showVariants:o,lazyLoader:i}){super({template:e,classes:Le}),this.baseUIElements={categoryName:oe.byClass(Le.categoryName)},this.category=t,this.showVariants=o,this.lazyLoader=i}setActive(e,t,o){this.emojiContainer.setActive(e,t,o)}}const $e=new ne((({classes:e,emoji:t})=>`\n
\n
\n
\n`)),Ae=$("emojiButton");class Ie extends oe{constructor({emoji:e,lazyLoader:t,category:o}){super({template:$e,classes:Ae}),this.emoji=e,this.lazyLoader=t,this.category=o}initialize(){this.uiEvents=[oe.uiEvent("focus",this.handleFocus)],super.initialize()}handleFocus(){this.category&&this.events.emit("focus:change",this.category)}activateFocus(e){this.el.tabIndex=0,e&&this.el.focus()}deactivateFocus(){this.el.tabIndex=-1}renderSync(){return super.renderSync({emoji:this.emoji,emojiContent:this.renderer.doRender(this.emoji,this.lazyLoader)})}}class Te{constructor(e,t,o=0,i=0,s=!1){this.events=new Ee,this.keyHandlers={ArrowLeft:this.focusPrevious.bind(this),ArrowRight:this.focusNext.bind(this),ArrowUp:this.focusUp.bind(this),ArrowDown:this.focusDown.bind(this)},this.rowCount=Math.ceil(t/e),this.columnCount=e,this.focusedRow=o,this.focusedColumn=i,this.emojiCount=t,this.wrap=s,this.handleKeyDown=this.handleKeyDown.bind(this)}destroy(){this.events.removeAll()}on(e,t){this.events.on(e,t)}handleKeyDown(e){e.key in this.keyHandlers&&(e.preventDefault(),this.keyHandlers[e.key]())}setCell(e,t,o=!0){const i=this.getIndex();this.focusedRow=e,void 0!==t&&(this.focusedColumn=Math.min(this.columnCount,t)),(this.focusedRow>=this.rowCount||this.getIndex()>=this.emojiCount)&&(this.focusedRow=this.rowCount-1,this.focusedColumn=this.emojiCount%this.columnCount-1),this.events.emit("focus:change",{from:i,to:this.getIndex(),performFocus:o})}setFocusedIndex(e,t=!0){const o=Math.floor(e/this.columnCount),i=e%this.columnCount;this.setCell(o,i,t)}focusNext(){this.focusedColumn
0?this.setCell(this.focusedRow,this.focusedColumn-1):this.focusedRow>0?this.setCell(this.focusedRow-1,this.columnCount-1):this.wrap?this.setCell(this.rowCount-1,this.columnCount-1):this.events.emit("focus:underflow",this.columnCount-1)}focusUp(){this.focusedRow>0?this.setCell(this.focusedRow-1,this.focusedColumn):this.events.emit("focus:underflow",this.focusedColumn)}focusDown(){this.focusedRow
`\n
\n
\n
\n`)),Ve=$("emojiContainer");class Re extends oe{constructor({emojis:e,showVariants:t,preview:o=!0,lazyLoader:i,category:s,fullHeight:r=!1}){super({template:Me,classes:Ve}),this.fullHeight=!1,this.showVariants=t,this.lazyLoader=i,this.preview=o,this.emojis=e,this.category=s,this.fullHeight=r,this.setFocus=this.setFocus.bind(this),this.triggerNextCategory=this.triggerNextCategory.bind(this),this.triggerPreviousCategory=this.triggerPreviousCategory.bind(this)}initialize(){this.grid=new Te(this.options.emojisPerRow,this.emojiCount,0,0,!this.category),this.grid.on("focus:change",this.setFocus),this.grid.on("focus:overflow",this.triggerNextCategory),this.grid.on("focus:underflow",this.triggerPreviousCategory),this.uiEvents=[oe.uiEvent("click",this.selectEmoji),oe.uiEvent("keydown",this.grid.handleKeyDown)],this.preview&&this.uiEvents.push(oe.uiEvent("mouseover",this.showPreview),oe.uiEvent("mouseout",this.hidePreview),oe.uiEvent("focus",this.showPreview,{capture:!0}),oe.uiEvent("blur",this.hidePreview,{capture:!0})),super.initialize()}setFocusedView(e,t){if(e)if("string"==typeof e){const t=this.emojis.findIndex((t=>t.emoji===e));this.grid.setFocusedIndex(t,!1),setTimeout((()=>{var e,o,i,s;const r=this.emojiViews[t].el;r.scrollIntoView();const a=null==(e=r.parentElement)?void 0:e.previousElementSibling;(null==(i=null==(o=r.parentElement)?void 0:o.parentElement)?void 0:i.parentElement).scrollTop-=null!=(s=null==a?void 0:a.offsetHeight)?s:0}))}else"first"===e.row||0===e.row?this.grid.setCell(0,e.offset,t):"last"===e.row&&this.grid.setCell(this.grid.getRowCount()-1,e.offset,t)}setActive(e,t,o){var i;e?this.setFocusedView(t,o):null==(i=this.emojiViews[this.grid.getIndex()])||i.deactivateFocus()}renderSync(){return this.emojiViews=this.emojis.map((e=>this.viewFactory.create(Ie,{emoji:e,category:this.category,lazyLoader:this.lazyLoader,renderer:this.renderer}))),this.emojiElements=this.emojiViews.map((e=>e.renderSync())),super.renderSync({emojis:this.emojiElements,i18n:this.i18n})}destroy(){super.destroy(),this.emojiViews.forEach((e=>e.destroy())),this.grid.destroy()}triggerPreviousCategory(e){this.events.emit("category:previous",e)}triggerNextCategory(e){this.category&&this.events.emit("category:next",e)}setFocus({from:e,to:t,performFocus:o}){var i,s;null==(i=this.emojiViews[e])||i.deactivateFocus(),null==(s=this.emojiViews[t])||s.activateFocus(o)}selectEmoji(e){e.stopPropagation();const t=_(e,this.emojis);t&&this.events.emit("emoji:select",{emoji:t,showVariants:this.showVariants})}showPreview(e){const t=e.target.closest("button"),o=null==t?void 0:t.firstElementChild,i=_(e,this.emojis);i&&this.events.emit("preview:show",i,null==o?void 0:o.cloneNode(!0))}hidePreview(e){_(e,this.emojis)&&this.events.emit("preview:hide")}get emojiCount(){return this.emojis.length}}const De=new ne((({classes:e,category:t,pickerId:o,icon:i,i18n:s})=>`\n
\n
\n
\n ${s.get(`categories.${t.key}`,t.message||t.key)}\n
\n
\n
\n`));class Be extends Fe{constructor({category:e,showVariants:t,lazyLoader:o,emojiVersion:i}){super({category:e,showVariants:t,lazyLoader:o,template:De}),this.showVariants=t,this.lazyLoader=o,this.emojiVersion=i}initialize(){this.uiElements={...this.baseUIElements},super.initialize()}async render(){await this.emojiDataPromise;const e=await this.emojiData.getEmojis(this.category,this.emojiVersion);return this.emojiContainer=this.viewFactory.create(Re,{emojis:e,showVariants:this.showVariants,lazyLoader:this.lazyLoader,category:this.category.key}),super.render({category:this.category,emojis:this.emojiContainer,emojiCount:e.length,icon:se[this.category.key]})}}class Ne extends Re{constructor({category:e,emojis:t,preview:o=!0,lazyLoader:i}){super({category:e,emojis:t,showVariants:!1,preview:o,lazyLoader:i})}async addOrUpdate(e){const t=this.el.querySelector(`[data-emoji="${e.emoji}"]`);t&&(this.el.removeChild(t),this.emojis=this.emojis.filter((t=>t!==e)));const o=this.viewFactory.create(Ie,{emoji:e});if(this.el.insertBefore(o.renderSync(),this.el.firstChild),this.emojis=[e,...this.emojis.filter((t=>t!==e))],this.emojis.length>this.options.maxRecents){this.emojis=this.emojis.slice(0,this.options.maxRecents);const e=this.el.childElementCount-this.options.maxRecents;for(let t=0;t
`\n
\n
\n
\n ${r.get(`categories.${o.key}`,o.message||o.key)}\n
\n
\n
\n
\n
\n ${r.get("recents.none")}\n
\n
\n`),{mode:"async"});const Oe=new ne((({classes:e,category:t,pickerId:o,icon:i,i18n:s})=>`\n
\n
\n
\n ${s.get(`categories.${t.key}`,t.message||t.key)}\n
\n
\n
\n`));class Ke{constructor(){this.elements=new Map}lazyLoad(e,t){return this.elements.set(e,t),e}observe(e){if(window.IntersectionObserver){const t=new IntersectionObserver((e=>{e.filter((e=>e.intersectionRatio>0)).map((e=>e.target)).forEach((e=>{const o=this.elements.get(e);null==o||o(),t.unobserve(e)}))}),{root:e});this.elements.forEach(((e,o)=>{t.observe(o)}))}else this.elements.forEach((e=>{e()}))}}const Ue=$("emojiArea"),We=new ne((({classes:e})=>`\n
\n
\n
\n`),{mode:"async"}),qe={recents:class extends Fe{constructor({category:e,lazyLoader:t,provider:o}){super({category:e,showVariants:!1,lazyLoader:t,template:He}),this.provider=o}initialize(){this.uiElements={...this.baseUIElements,recents:oe.byClass(Le.recentEmojis)},this.appEvents={"recent:add":this.addRecent},super.initialize()}async addRecent(e){await this.emojiContainer.addOrUpdate(e),this.ui.recents.dataset.empty="false"}async render(){var e;const t=null==(e=this.provider)?void 0:e.getRecents(this.options.maxRecents);return this.emojiContainer=this.viewFactory.create(Ne,{emojis:t,showVariants:!1,lazyLoader:this.lazyLoader,category:this.category.key}),await super.render({category:this.category,emojis:this.emojiContainer,emojiCount:t.length,icon:se[this.category.key]}),this.el}},custom:class extends Fe{constructor({category:e,lazyLoader:t}){super({template:Oe,showVariants:!1,lazyLoader:t,category:e})}initialize(){this.uiElements={...this.baseUIElements},super.initialize()}async render(){return this.emojiContainer=this.viewFactory.create(Re,{emojis:this.customEmojis,showVariants:this.showVariants,lazyLoader:this.lazyLoader,category:this.category.key}),super.render({category:this.category,emojis:this.emojiContainer,emojiCount:this.customEmojis.length,icon:se[this.category.key]})}}};class Ge extends oe{constructor({categoryTabs:e,categories:t,emojiVersion:o}){super({template:We,classes:Ue}),this.selectedCategory=0,this.scrollListenerState="active",this.lazyLoader=new Ke,this.categoryTabs=e,this.categories=t,this.emojiVersion=o,this.handleScroll=S(this.handleScroll.bind(this),100)}initialize(){this.appEvents={"category:select":this.handleCategorySelect,"category:previous":this.focusPreviousCategory,"category:next":this.focusNextCategory,"focus:change":this.updateFocusedCategory},this.uiElements={emojis:oe.byClass(Ue.emojiArea)},this.uiEvents=[oe.uiEvent("scroll",this.handleScroll)],super.initialize()}get focusableEmoji(){return this.el.querySelector('[tabindex="0"]')}async render(){this.emojiCategories=this.categories.map(this.createCategory,this);const e={};return this.categories.forEach(((t,o)=>{e[`emojis-${t.key}`]=this.emojiCategories[o]})),await super.render({emojis:await Promise.all(this.emojiCategories.map((e=>e.render())))}),this.lazyLoader.observe(this.el),this.el}destroy(){super.destroy(),this.emojiCategories.forEach((e=>{var t;null==(t=this.observer)||t.unobserve(e.el),e.destroy()}))}handleCategorySelect(e,t){this.el.style.overflow="hidden",this.selectCategory(e,t),this.el.style.overflow="auto"}createCategory(e){const t=qe[e.key]||Be;return this.viewFactory.create(t,{category:e,showVariants:!0,lazyLoader:this.lazyLoader,emojiVersion:this.emojiVersion,provider:this.options.recentsProvider})}determineInitialCategory(){var e;return this.options.initialCategory&&this.categories.find((e=>e.key===this.options.initialCategory))?this.options.initialCategory:null==(e=this.categories.find((e=>"recents"!==e.key)))?void 0:e.key}determineFocusTarget(e){const t=this.emojiCategories.find((t=>t.category.key===e));return this.options.initialEmoji&&(null==t?void 0:t.el.querySelector(`[data-emoji="${this.options.initialEmoji}"]`))?this.options.initialEmoji:"button"}reset(e=!0){this.events.emit("preview:hide");const t=this.determineInitialCategory();t&&(this.selectCategory(t,{focus:this.determineFocusTarget(t),performFocus:e,scroll:"jump"}),this.selectedCategory=this.getCategoryIndex(t))}getCategoryIndex(e){return this.categories.findIndex((t=>t.key===e))}focusPreviousCategory(e){this.selectedCategory>0&&this.focusCategory(this.selectedCategory-1,{row:"last",offset:null!=e?e:this.options.emojisPerRow})}focusNextCategory(e){this.selectedCategory
{var i;return e<(null==(i=this.emojiCategories[o+1])?void 0:i.el.offsetTop)})),i={changeFocusable:!1,performFocus:!1,scroll:!1};0===e?this.categoryTabs.setActiveTab(0,i):Math.floor(e)===Math.floor(t)||o<0?this.categoryTabs.setActiveTab(this.categories.length-1,i):this.categoryTabs.setActiveTab(o,i)}}const Je=new ne((({classList:e,classes:t,icon:o,message:i})=>`\n
\n
\n
${i}
\n
\n`)),Ze=$("error","iconContainer","title");class Ye extends oe{constructor({message:e,icon:t="warning",template:o=Je,className:i}){super({template:o,classes:Ze}),this.message=e,this.icon=t,this.className=i}renderSync(){const e=[Ze.error,this.className].join(" ").trim();return super.renderSync({message:this.message,icon:this.icon,classList:e})}}const Qe=new ne((({classList:e,classes:t,icon:o,i18n:i,message:s})=>`\n
\n
\n
${s}
\n
${i.get("retry")}
\n
\n`)),Xe=$("dataError");class et extends Ye{constructor({message:e}){super({message:e,template:Qe,className:Xe.dataError})}initialize(){this.uiElements={retryButton:"button"},this.uiEvents=[oe.childEvent("retryButton","click",this.onRetry)],super.initialize()}async onRetry(){this.emojiData?await this.emojiData.delete():await this.options.dataStore.deleteDatabase(this.options.locale),this.events.emit("reinitialize");const e=await Y(this.options.locale,this.options.dataStore,this.options.messages,this.options.emojiData,this.emojiData);this.viewFactory.setEmojiData(e),this.events.emit("data:ready",e)}}const tt=$("preview","previewEmoji","previewName","tagList","tag"),ot=new ne((({classes:e,tag:t})=>`\n
${t}
\n`)),it=new ne((({classes:e})=>`\n
\n
\n
\n
\n
\n`));class st extends oe{constructor(){super({template:it,classes:tt})}initialize(){this.uiElements={emoji:oe.byClass(tt.previewEmoji),name:oe.byClass(tt.previewName),tagList:oe.byClass(tt.tagList)},this.appEvents={"preview:show":this.showPreview,"preview:hide":this.hidePreview},super.initialize()}showPreview(e,t){if(T(this.ui.emoji,t),this.ui.name.textContent=e.label,e.tags){this.ui.tagList.style.display="flex";const t=e.tags.map((e=>ot.renderSync({tag:e,classes:tt})));T(this.ui.tagList,...t)}}hidePreview(){I(this.ui.emoji),I(this.ui.name),I(this.ui.tagList)}}const rt=new ne((({classes:e,i18n:t})=>`\n
\n
\n
\n`)),at=new ne((({classes:e,i18n:t})=>`\n
\n
\n
\n
\n`),{mode:"async"}),nt=$("searchContainer","searchField","clearButton","searchAccessory","clearSearchButton","notFound");class ct extends oe{constructor({categories:e,emojiVersion:t}){super({template:at,classes:nt}),this.categories=e.filter((e=>"recents"!==e.key)),this.emojiVersion=t,this.search=z(this.search.bind(this),100)}initialize(){this.uiElements={searchField:oe.byClass(nt.searchField),searchAccessory:oe.byClass(nt.searchAccessory)},this.uiEvents=[oe.childEvent("searchField","keydown",this.onKeyDown),oe.childEvent("searchField","input",this.onSearchInput)],super.initialize()}async render(){return await super.render(),this.searchIcon=re("search"),this.notFoundMessage=this.viewFactory.create(Ye,{message:this.i18n.get("search.notFound"),className:nt.notFound,icon:"sad"}),this.notFoundMessage.renderSync(),this.errorMessage=this.viewFactory.create(Ye,{message:this.i18n.get("search.error")}),this.errorMessage.renderSync(),this.clearSearchButton=rt.render({classes:nt,i18n:this.i18n}),this.clearSearchButton.addEventListener("click",(e=>this.onClearSearch(e))),this.searchField=this.ui.searchField,this.showSearchIcon(),this.el}showSearchIcon(){this.showSearchAccessory(this.searchIcon)}showClearSearchButton(){this.showSearchAccessory(this.clearSearchButton)}showSearchAccessory(e){T(this.ui.searchAccessory,e)}clear(){this.searchField.value="",this.showSearchIcon()}focus(){this.searchField.focus()}onClearSearch(e){var t;e.stopPropagation(),this.searchField.value="",null==(t=this.resultsContainer)||t.destroy(),this.resultsContainer=null,this.showSearchIcon(),this.events.emit("content:show"),this.searchField.focus()}handleResultsKeydown(e){this.resultsContainer&&"Escape"===e.key&&this.onClearSearch(e)}onKeyDown(e){var t;"Escape"===e.key&&this.searchField.value?this.onClearSearch(e):("Enter"===e.key||"ArrowDown"===e.key)&&this.resultsContainer&&(e.preventDefault(),null==(t=this.resultsContainer.el.querySelector('[tabindex="0"]'))||t.focus())}onSearchInput(e){this.searchField.value?(this.showClearSearchButton(),this.search()):this.onClearSearch(e)}async search(){var e;if(this.searchField.value)try{const t=await this.emojiData.searchEmojis(this.searchField.value,this.customEmojis,this.emojiVersion,this.categories);if(this.events.emit("preview:hide"),t.length){const o=new Ke;this.resultsContainer=this.viewFactory.create(Re,{emojis:t,fullHeight:!0,showVariants:!0,lazyLoader:o}),this.resultsContainer.renderSync(),null!=(e=this.resultsContainer)&&e.el&&(o.observe(this.resultsContainer.el),this.resultsContainer.setActive(!0,{row:0,offset:0},!1),this.resultsContainer.el.addEventListener("keydown",(e=>this.handleResultsKeydown(e))),this.events.emit("content:show",this.resultsContainer))}else this.events.emit("content:show",this.notFoundMessage)}catch{this.events.emit("content:show",this.errorMessage)}}}const lt=new ne((({classes:e})=>`\n
\n
\n
\n
\n
\n`)),ht=$("variantOverlay","variantPopup"),dt={easing:"ease-in-out",duration:250,fill:"both"},mt={opacity:[0,1]},ut={opacity:[0,1],transform:["scale3d(0.8, 0.8, 0.8)","scale3d(1, 1, 1)"]};class pt extends oe{constructor({emoji:e,parent:t}){super({template:lt,classes:ht,parent:t}),this.focusedEmojiIndex=0,this.focusTrap=new Q,this.animateShow=()=>Promise.all([P(this.el,mt,dt,this.options),P(this.ui.popup,ut,dt,this.options)]),this.emoji=e}initialize(){this.uiElements={popup:oe.byClass(ht.variantPopup)},this.uiEvents=[oe.uiEvent("click",this.handleClick),oe.uiEvent("keydown",this.handleKeydown)],super.initialize()}animateHide(){const e={...dt,direction:"reverse"};return Promise.all([P(this.el,mt,e,this.options),P(this.ui.popup,ut,e,this.options)])}async hide(){await this.animateHide(),this.events.emit("variantPopup:hide")}handleKeydown(e){"Escape"===e.key&&(this.hide(),e.stopPropagation())}handleClick(e){this.ui.popup.contains(e.target)||this.hide()}getEmoji(e){return this.renderedEmojis[e]}setFocusedEmoji(e){this.getEmoji(this.focusedEmojiIndex).tabIndex=-1,this.focusedEmojiIndex=e;const t=this.getEmoji(this.focusedEmojiIndex);t.tabIndex=0,t.focus()}destroy(){this.emojiContainer.destroy(),this.focusTrap.deactivate(),super.destroy()}renderSync(){const e=[{...this.emoji,skins:null},...(this.emoji.skins||[]).map((e=>({...e,label:this.emoji.label,tags:this.emoji.tags})))];return this.emojiContainer=this.viewFactory.create(Re,{emojis:e,preview:!1}),super.renderSync({emojis:this.emojiContainer}),e.length
`\n
\n
\n
\n
\n`)),yt=$("categoryTab","categoryTabActive","categoryButton");class vt extends oe{constructor({category:e,icon:t}){super({template:gt,classes:yt}),this.isActive=!1,this.category=e,this.icon=t}initialize(){this.uiElements={button:oe.byClass(yt.categoryButton)},this.uiEvents=[oe.childEvent("button","click",this.selectCategory),oe.childEvent("button","focus",this.selectCategory)],super.initialize()}renderSync(){return super.renderSync({category:this.category,icon:this.icon}),this.ui.button.ariaSelected="false",this.el}setActive(e,t={}){const{changeFocusable:o,performFocus:i,scroll:s}={changeFocusable:!0,performFocus:!0,scroll:!0,...t};this.el.classList.toggle(yt.categoryTabActive,e),o&&(this.ui.button.tabIndex=e?0:-1,this.ui.button.ariaSelected=e.toString()),e&&i&&(this.ui.button.focus(),s&&this.events.emit("category:select",this.category.key,{scroll:"animate",focus:"button",performFocus:!1})),this.isActive=e}selectCategory(){this.isActive||this.events.emit("category:select",this.category.key,{scroll:"animate",focus:"button",performFocus:!0})}}const ft=new ne((({classes:e})=>`\n
\n
\n
\n
\n
\n`)),wt=$("categoryButtons","categoryButtonsContainer");class bt extends oe{constructor({categories:e}){super({template:ft,classes:wt}),this.activeCategoryIndex=0,this.categories=e}initialize(){this.keyBindings={ArrowLeft:this.stepSelectedTab(-1),ArrowRight:this.stepSelectedTab(1)},this.uiEvents=[oe.uiEvent("scroll",this.checkOverflow)],super.initialize()}checkOverflow(){const e=Math.abs(this.el.scrollLeft-(this.el.scrollWidth-this.el.offsetWidth))>1,t=this.el.scrollLeft>0;this.el.className="categoryButtonsContainer",t&&e?this.el.classList.add("has-overflow-both"):t?this.el.classList.add("has-overflow-left"):e&&this.el.classList.add("has-overflow-right")}renderSync(){return this.tabViews=this.categories.map((e=>this.viewFactory.create(vt,{category:e,icon:se[e.key]}))),super.renderSync({tabs:this.tabViews.map((e=>e.renderSync()))}),this.el}get currentCategory(){return this.categories[this.activeCategoryIndex]}get currentTabView(){return this.tabViews[this.activeCategoryIndex]}setActiveTab(e,t={}){this.checkOverflow();const o=this.currentTabView,i=this.tabViews[e];o.setActive(!1,t),i.setActive(!0,t),this.activeCategoryIndex=e}getTargetCategory(e){return e<0?this.categories.length-1:e>=this.categories.length?0:e}stepSelectedTab(e){return()=>{const t=this.activeCategoryIndex+e;this.setActiveTab(this.getTargetCategory(t),{changeFocusable:!0,performFocus:!0})}}}const jt=[{version:15,emoji:String.fromCodePoint(129768)},{version:14,emoji:String.fromCodePoint(128733)},{version:13,emoji:String.fromCodePoint(129729)},{version:12,emoji:String.fromCodePoint(129449)},{version:11,emoji:String.fromCodePoint(129463)},{version:5,emoji:String.fromCodePoint(129322)},{version:4,emoji:String.fromCodePoint(9877)},{version:3,emoji:String.fromCodePoint(129314)},{version:2,emoji:String.fromCodePoint(128488)},{version:1,emoji:String.fromCodePoint(128512)}];function Ct(){var e;const t=jt.find((e=>function(e){const t=document.createElement("canvas").getContext("2d");if(t)return t.textBaseline="top",t.font="32px Arial",t.fillText(e,0,0),0!==t.getImageData(16,16,1,1).data[0]}(e.emoji)));return null!=(e=null==t?void 0:t.version)?e:1}function kt(e,t){return Array.from({length:e},(()=>t)).join("")}function _t(e){const{emojiCount:t,classes:o,theme:i,className:s,categoryCount:r}=e;return`\n
\n ${(({showHeader:t,classes:o})=>t?`\n
\n ${(({showSearch:e,classes:t})=>e?`\n
\n
\n
\n `:"")(e)}\n ${(({showCategoryTabs:e,classes:t})=>e?`\n
\n ${kt(r,`
`)}\n
\n `:"")(e)}\n
\n `:"")(e)}\n
\n
\n
\n ${kt(t,`
`)}\n
\n
\n ${(({showPreview:e,classes:t})=>e?`\n
\n
\n
\n
\n ${kt(3,`
`)}\n
\n
\n `:"")(e)}\n
\n `}const xt=new ne((e=>e.isLoaded?function(e){const{classes:t,theme:o,className:i=""}=e;return`\n
\n ${function({showHeader:e,classes:t}){return e?`\n
\n
\n
\n
\n `:""}(e)}\n
\n
\n
\n
\n
\n `}(e):_t(e))),Et=$("picker","skeleton","placeholder","searchSkeleton","searchInput","categoryTabsSkeleton","headerSkeleton","categoryTab","contentSkeleton","categoryName","emojiGrid","emoji","previewSkeleton","previewEmoji","previewName","tagList","tag","overlay","content","fullHeight","pluginContainer","header"),St={emojisPerRow:"--emojis-per-row",visibleRows:"--row-count",emojiSize:"--emoji-size"};class zt extends oe{constructor(){super({template:xt,classes:Et}),this.pickerReady=!1,this.externalEvents=new Pe,this.updaters={styleProperty:e=>t=>this.el.style.setProperty(St[e],t.toString()),theme:e=>{const t=this.options.theme,o=this.el.closest(`.${t}`);this.el.classList.remove(t),null==o||o.classList.remove(t),this.el.classList.add(e),null==o||o.classList.add(e)},className:e=>{this.options.className&&this.el.classList.remove(this.options.className),this.el.classList.add(e)},emojisPerRow:this.updateStyleProperty.bind(this,"emojisPerRow"),emojiSize:this.updateStyleProperty.bind(this,"emojiSize"),visibleRows:this.updateStyleProperty.bind(this,"visibleRows")}}initialize(){this.uiElements={pickerContent:oe.byClass(Et.content),header:oe.byClass(Et.header)},this.uiEvents=[oe.uiEvent("keydown",this.handleKeyDown)],this.appEvents={error:this.onError,reinitialize:this.reinitialize,"data:ready":this.onDataReady,"content:show":this.showContent,"variantPopup:hide":this.hideVariantPopup,"emoji:select":this.selectEmoji},super.initialize(),this.options.recentsProvider}destroy(){var e,t;super.destroy(),null==(e=this.search)||e.destroy(),this.emojiArea.destroy(),null==(t=this.categoryTabs)||t.destroy(),this.events.removeAll(),this.externalEvents.removeAll()}clearRecents(){this.options.recentsProvider.clear()}addEventListener(e,t){this.externalEvents.on(e,t)}removeEventListener(e,t){this.externalEvents.off(e,t)}initializePickerView(){this.pickerReady&&(this.showContent(),this.emojiArea.reset(!1))}handleKeyDown(e){const t=e.ctrlKey||e.metaKey;"s"===e.key&&t&&this.search&&(e.preventDefault(),this.search.focus())}buildChildViews(){return this.options.showPreview&&(this.preview=this.viewFactory.create(st)),this.options.showSearch&&(this.search=this.viewFactory.create(ct,{categories:this.categories,emojiVersion:this.emojiVersion})),this.options.showCategoryTabs&&(this.categoryTabs=this.viewFactory.create(bt,{categories:this.categories})),this.currentView=this.emojiArea=this.viewFactory.create(Ge,{categoryTabs:this.categoryTabs,categories:this.categories,emojiVersion:this.emojiVersion}),[this.preview,this.search,this.emojiArea,this.categoryTabs]}setStyleProperties(){this.options.showSearch||this.el.style.setProperty("--search-height-full","0px"),this.options.showCategoryTabs||(this.el.style.setProperty("--category-tabs-height","0px"),this.el.style.setProperty("--category-tabs-offset","0px")),this.options.showPreview||this.el.style.setProperty("--emoji-preview-height-full","0px"),Object.keys(St).forEach((e=>{this.options[e]&&this.el.style.setProperty(St[e],this.options[e].toString())}))}updateStyleProperty(e,t){this.el.style.setProperty(St[e],t.toString())}reinitialize(){this.renderSync()}onError(e){const t=this.viewFactory.createWithOptions({data:!1},et,{message:this.i18n.get("error.load")}),o=this.el.offsetHeight||375;throw this.el.style.height=`${o}px`,T(this.el,t.renderSync()),e}async onDataReady(e){const t=this.el;try{e?this.emojiData=e:await this.emojiDataPromise,"auto"===this.options.emojiVersion?this.emojiVersion=Ct()||parseFloat("14.0"):this.emojiVersion=this.options.emojiVersion,this.categories=await this.emojiData.getCategories(this.options);const[o,i,s,r]=this.buildChildViews();await super.render({isLoaded:!0,search:i,categoryTabs:r,emojiArea:s,preview:o,showHeader:Boolean(this.search||this.categoryTabs),theme:this.options.theme,className:this.options.className}),this.el.style.setProperty("--category-count",this.categories.length.toString()),this.pickerReady=!0,t.replaceWith(this.el),this.setStyleProperties(),this.initializePickerView(),this.setInitialFocus(),this.externalEvents.emit("data:ready")}catch(e){this.events.emit("error",e)}}renderSync(){var e;let t=(null==(e=this.options.categories)?void 0:e.length)||10;if(this.options.showRecents&&(t+=1),super.renderSync({isLoaded:!1,theme:this.options.theme,className:this.options.className,showSearch:this.options.showSearch,showPreview:this.options.showPreview,showCategoryTabs:this.options.showCategoryTabs,showHeader:this.options.showSearch||this.options.showCategoryTabs,emojiCount:this.options.emojisPerRow*this.options.visibleRows,categoryCount:t}),this.el.style.setProperty("--category-count",t.toString()),!this.options.rootElement)throw new Error("Picker must be given a root element via the rootElement option");return T(this.options.rootElement,this.el),this.setStyleProperties(),this.pickerReady&&this.initializePickerView(),this.el}getInitialFocusTarget(){if(typeof this.options.autoFocus<"u")switch(this.options.autoFocus){case"emojis":return this.emojiArea.focusableEmoji;case"search":return this.search;case"auto":return this.search||this.emojiArea.focusableEmoji;default:return null}if(!0===this.options.autoFocusSearch)return console.warn("options.autoFocusSearch is deprecated, please use options.focusTarget instead"),this.search}setInitialFocus(){var e;!this.pickerReady||null==(e=this.getInitialFocusTarget())||e.focus()}reset(e=!0){var t;this.pickerReady&&(this.emojiArea.reset(e),this.showContent(this.emojiArea)),null==(t=this.search)||t.clear(),this.hideVariantPopup()}showContent(e=this.emojiArea){var t,o;e!==this.currentView&&(this.currentView!==this.emojiArea&&(null==(t=this.currentView)||t.destroy()),this.ui.pickerContent.classList.toggle(Et.fullHeight,e!==this.emojiArea),T(this.ui.pickerContent,e.el),this.currentView=e,e===this.emojiArea?(this.emojiArea.reset(),this.categoryTabs&&this.ui.header.appendChild(this.categoryTabs.el)):null==(o=this.categoryTabs)||o.el.remove())}hideVariantPopup(){var e;null==(e=this.variantPopup)||e.destroy()}isPickerClick(e){var t,o;const i=e.target,s=this.el.contains(i),r=null==(o=null==(t=this.variantPopup)?void 0:t.el)?void 0:o.contains(i);return s||r}async selectEmoji({emoji:e}){var t,o;(null==(t=e.skins)?void 0:t.length)&&this.options.showVariants&&!this.isVariantPopupOpen?this.showVariantPopup(e):(await(null==(o=this.variantPopup)?void 0:o.animateHide()),this.events.emit("variantPopup:hide"),await this.emitEmoji(e))}get isVariantPopupOpen(){return this.variantPopup&&!this.variantPopup.isDestroyed}async showVariantPopup(e){const t=document.activeElement;this.events.once("variantPopup:hide",(()=>{null==t||t.focus()})),this.variantPopup=this.viewFactory.create(pt,{emoji:e,parent:this.el}),this.el.appendChild(this.variantPopup.renderSync()),this.variantPopup.activate()}async emitEmoji(e){this.externalEvents.emit("emoji:select",await this.renderer.doEmit(e)),this.options.recentsProvider.addOrUpdateRecent(e,this.options.maxRecents),this.events.emit("recent:add",e)}updateOptions(e){Object.keys(e).forEach((t=>{this.updaters[t](e[t])})),Object.assign(this.options,e)}}class Pt{constructor({events:e,i18n:t,renderer:o,emojiData:i,options:s,customEmojis:r=[],pickerId:a}){this.events=e,this.i18n=t,this.renderer=o,this.emojiData=i,this.options=s,this.customEmojis=r,this.pickerId=a}setEmojiData(e){this.emojiData=Promise.resolve(e)}createWithOptions(e={},t,...o){const i=new t(...o);return i.setPickerId(this.pickerId),i.setEvents(this.events),i.setI18n(this.i18n),i.setRenderer(this.renderer),!1!==e.data&&i.setEmojiData(this.emojiData),i.setOptions(this.options),i.setCustomEmojis(this.customEmojis),i.viewFactory=this,i.initialize(),i}create(e,...t){return this.createWithOptions({},e,...t)}}class Lt{constructor(e={}){b(this,p,void 0),J(this,p,new Map(Object.entries(e)))}get(e,t=e){return w(this,p).get(e)||t}}function Ft(){let e=!1;return function(t){Se.injectStyles&&!e&&(function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===o&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}(t),e=!0)}}p=new WeakMap;let $t,At=0;const It=Ft();const Tt=Object.freeze(Object.defineProperty({__proto__:null,de:{"categories.activities":"Aktivitäten","categories.animals-nature":"Tiere & Natur","categories.custom":"Benutzerdefiniert","categories.flags":"Flaggen","categories.food-drink":"Essen & Trinken","categories.objects":"Gegenstände","categories.people-body":"Mensch & Körper","categories.recents":"Zuletzt genutzt","categories.smileys-emotion":"Smileys & Emotionen","categories.symbols":"Symbole","categories.travel-places":"Reisen & Orte","error.load":"Emojis wurden nicht geladen","recents.clear":"Zuletzt genutzte Emojis löschen","recents.none":"Kein Emoji ausgewählt.",retry:"Erneut versuchen","search.clear":"Suche löschen","search.error":"Suche erfolglos","search.notFound":"Kein Emoji gefunden",search:"Emojis durchsuchen ..."},en:ge,fi:{"categories.activities":"Aktiviteetit","categories.animals-nature":"Eläimet & luonto","categories.custom":"Mukautettu","categories.flags":"Liput","categories.food-drink":"Ruoka & juoma","categories.objects":"Esineet","categories.people-body":"Ihmiset & keho","categories.recents":"Viimeksi käytetty","categories.smileys-emotion":"Hymiöt & tunne","categories.symbols":"Symbolit","categories.travel-places":"Matkustus & paikat","error.load":"Emojien lataaminen epäonnistui","recents.clear":"Tyhjennä viimeksi käytetyt emojit","recents.none":"Et ole valinnut vielä emojia.",retry:"Kokeile uudestaan","search.clear":"Tyhjennä haku","search.error":"Emojien etsiminen epäonnistui","search.notFound":"Emojia ei löytynyt",search:"Etsi emojia..."},fr:{"categories.activities":"Activités","categories.animals-nature":"Animaux et nature","categories.custom":"Personnalisé","categories.flags":"Drapeaux","categories.food-drink":"Nourriture et boissons","categories.objects":"Objets","categories.people-body":"Personnes et corps","categories.recents":"Récemment utilisé","categories.smileys-emotion":"Visages et émotions","categories.symbols":"Symboles","categories.travel-places":"Voyages et lieux","error.load":"Échec du chargement des émojis","recents.clear":"Effacez les émojis récents","recents.none":"Vous n'avez pas encore sélectionné d'émojis.",retry:"Essayez à nouveau","search.clear":"Effacer la recherche","search.error":"Échec de la recherche d'émojis","search.notFound":"Aucun émoji trouvé",search:"Rechercher des émojis..."},nl:{"categories.activities":"Activiteiten","categories.animals-nature":"Dieren & Natuur","categories.custom":"Aangepast","categories.flags":"Vlaggen","categories.food-drink":"Eten & Drinken","categories.objects":"Voorwerpen","categories.people-body":"Mens & Lichaam","categories.recents":"Laatst gebruikt","categories.smileys-emotion":"Smileys en emoties","categories.symbols":"Symbolen","categories.travel-places":"Reizen & Plaatsen","error.load":"Kan emoji's niet laden","recents.clear":"Wis recente emoji's","recents.none":"Geen emoji geselecteerd.",retry:"Probeer het nog eens","search.clear":"Zoekopdracht wissen","search.error":"Zoeken mislukt","search.notFound":"Geen emoji gevonden",search:"Zoek emoji..."},no:{"categories.activities":"Aktiviteter","categories.animals-nature":"Dyr & natur","categories.custom":"Tilpasset","categories.flags":"Flagg","categories.food-drink":"Mat & drikke","categories.objects":"Objekter","categories.people-body":"Mennesker & kropp","categories.recents":"Nylig brukte","categories.smileys-emotion":"Smilefjes & følelser","categories.symbols":"Symboler","categories.travel-places":"Reise & steder","error.load":"Klarte ikke laste inn emojis","recents.clear":"Fjern nylige emojis","recents.none":"Du har ikke valgt noen emojis enda.",retry:"Prøv igjen","search.clear":"Tøm søk","search.error":"Klarte ikke å søke etter emojis","search.notFound":"Ingen emojis funnet",search:"Søk etter emojis..."},sv:{"categories.activities":"Aktiviteter","categories.animals-nature":"Djur & natur","categories.custom":"Anpassad","categories.flags":"Flagga","categories.food-drink":"Mat & dryck","categories.objects":"Objekt","categories.people-body":"Människor & kropp","categories.recents":"Nyligen använd","categories.smileys-emotion":"Humör & känslor","categories.symbols":"Symboler","categories.travel-places":"Resor & platser","error.load":"Det gick inte att ladda emojis","recents.clear":"Ta bort de senaste emojis","recents.none":"Du har inte valt några emojis än",retry:"Försök igen","search.clear":"Tom sökning","search.error":"Det gick inte att söka efter emojis","search.notFound":"Inga emojis hittades",search:"Sök efter emojis..."}},Symbol.toStringTag,{value:"Module"}));e.EmojiPicker=zt,e.Events=Ee,e.FocusTrap=Q,e.InMemoryProvider=class extends be{constructor(){super(...arguments),this.recents=[]}clear(){this.recents=[]}getRecents(e){return this.recents.slice(0,e)}addOrUpdateRecent(e,t){this.recents=[e,...this.getRecents(t).filter((t=>t.hexcode!==e.hexcode))].slice(0,t)}},e.InMemoryStoreFactory=U,e.IndexedDbStoreFactory=ve,e.LocalStorageProvider=ke,e.NativeRenderer=pe,e.RecentsProvider=be,e.Renderer=me,e.SessionStorageProvider=class extends Ce{constructor(){super(V()?sessionStorage:we())}},e.animate=P,e.autoTheme=te,e.caseInsensitiveIncludes=E,e.computeHash=F,e.createDatabase=async function(e,t,o,i){(await Y(e,t,o,i)).close()},e.createPicker=function(e){It('.picmo__picker .picmo__icon{width:1.25em;height:1em;fill:currentColor}.picmo__icon-small{font-size:.8em}.picmo__icon-medium{font-size:1em}.picmo__icon-large{font-size:1.25em}.picmo__icon-2x{font-size:2em}.picmo__icon-3x{font-size:3em}.picmo__icon-4x{font-size:4em}.picmo__icon-5x{font-size:5em}.picmo__icon-8x{font-size:8em}.picmo__icon-10x{font-size:10em}.picmo__light,.picmo__auto{color-scheme:light;--accent-color: #4f46e5;--background-color: #f9fafb;--border-color: #cccccc;--category-name-background-color: #f9fafb;--category-name-button-color: #999999;--category-name-text-color: hsl(214, 30%, 50%);--category-tab-active-background-color: rgba(255, 255, 255, .6);--category-tab-active-color: var(--accent-color);--category-tab-color: #666;--category-tab-highlight-background-color: rgba(0, 0, 0, .15);--error-color-dark: hsl(0, 100%, 45%);--error-color: hsl(0, 100%, 40%);--focus-indicator-background-color: hsl(198, 65%, 85%);--focus-indicator-color: #333333;--hover-background-color: #c7d2fe;--placeholder-background-color: #cccccc;--search-background-color: #f9fafb;--search-focus-background-color: #ffffff;--search-icon-color: #999999;--search-placeholder-color: #71717a;--secondary-background-color: #e2e8f0;--secondary-text-color: #666666;--tag-background-color: rgba(162, 190, 245, .3);--text-color: #000000;--variant-popup-background-color: #ffffff}.picmo__dark{color-scheme:dark;--accent-color: #A580F9;--background-color: #333333;--border-color: #666666;--category-name-background-color: #333333;--category-name-button-color: #eeeeee;--category-name-text-color: #ffffff;--category-tab-active-background-color: #000000;--category-tab-active-color: var(--accent-color);--category-tab-color: #cccccc;--category-tab-highlight-background-color: #4A4A4A;--error-color-dark: hsl(0, 7%, 3%);--error-color: hsl(0, 30%, 60%);--focus-indicator-background-color: hsl(0, 0%, 50%);--focus-indicator-color: #999999;--hover-background-color: hsla(0, 0%, 40%, .85);--image-placeholder-color: #ffffff;--placeholder-background-color: #666666;--search-background-color: #71717a;--search-focus-background-color: #52525b;--search-icon-color: #cccccc;--search-placeholder-color: #d4d4d8;--secondary-background-color: #000000;--secondary-text-color: #999999;--tag-background-color: rgba(162, 190, 245, .3);--text-color: #ffffff;--variant-popup-background-color: #333333}@media (prefers-color-scheme: dark){.picmo__auto{color-scheme:dark;--accent-color: #A580F9;--background-color: #333333;--border-color: #666666;--category-name-background-color: #333333;--category-name-button-color: #eeeeee;--category-name-text-color: #ffffff;--category-tab-active-background-color: #000000;--category-tab-active-color: var(--accent-color);--category-tab-color: #cccccc;--category-tab-highlight-background-color: #4A4A4A;--error-color-dark: hsl(0, 7%, 3%);--error-color: hsl(0, 30%, 60%);--focus-indicator-background-color: hsl(0, 0%, 50%);--focus-indicator-color: #999999;--hover-background-color: hsla(0, 0%, 40%, .85);--image-placeholder-color: #ffffff;--placeholder-background-color: #666666;--search-background-color: #71717a;--search-focus-background-color: #52525b;--search-icon-color: #cccccc;--search-placeholder-color: #d4d4d8;--secondary-background-color: #000000;--secondary-text-color: #999999;--tag-background-color: rgba(162, 190, 245, .3);--text-color: #ffffff;--variant-popup-background-color: #333333}}.picmo__picker .picmo__categoryButtonsContainer{overflow:auto;padding:2px 0}.picmo__picker .picmo__categoryButtonsContainer.picmo__has-overflow-right{mask-image:linear-gradient(270deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%);-webkit-mask-image:linear-gradient(270deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%)}.picmo__picker .picmo__categoryButtonsContainer.picmo__has-overflow-left{mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%);-webkit-mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%)}.picmo__picker .picmo__categoryButtonsContainer.picmo__has-overflow-both{mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%,rgba(255,255,255,1) 90%,rgba(255,255,255,0) 100%);-webkit-mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%,rgba(255,255,255,1) 90%,rgba(255,255,255,0) 100%)}.picmo__picker .picmo__categoryButtons{display:flex;flex-direction:row;gap:var(--tab-gap);margin:0;padding:0 .5em;align-items:center;height:var(--category-tabs-height);box-sizing:border-box;width:100%;justify-content:space-between;position:relative;list-style-type:none;justify-self:center;max-width:min(23.55rem,calc(var(--category-count, 1) * 2.5rem))}.picmo__picker .picmo__categoryButtons .picmo__categoryTab{display:flex;align-items:center;transition:all .1s;width:2em}.picmo__picker .picmo__categoryButtons .picmo__categoryTab.picmo__categoryTabActive .picmo__categoryButton{color:var(--category-tab-active-color);background:linear-gradient(rgba(255,255,255,.75) 0%,rgba(255,255,255,.75) 100%),linear-gradient(var(--category-tab-active-color) 0%,var(--category-tab-active-color) 100%);border:2px solid var(--category-tab-active-color)}.picmo__picker .picmo__categoryButtons .picmo__categoryTab.picmo__categoryTabActive .picmo__categoryButton:hover{background-color:var(--category-tab-active-background-color)}.picmo__picker .picmo__categoryButtons .picmo__categoryTab button.picmo__categoryButton{border-radius:5px;background:transparent;border:2px solid transparent;color:var(--category-tab-color);cursor:pointer;padding:2px;vertical-align:middle;display:flex;align-items:center;justify-content:center;font-size:1.2rem;width:1.6em;height:1.6em;transition:all .1s}.picmo__picker .picmo__categoryButtons .picmo__categoryTab button.picmo__categoryButton:is(img){width:var(--category-tab-size);height:var(--category-tab-size)}.picmo__picker .picmo__categoryButtons .picmo__categoryTab button.picmo__categoryButton:hover{background:var(--category-tab-highlight-background-color)}.picmo__dataError [data-icon]{opacity:.8}@keyframes appear{0%{opacity:0}to{opacity:.8}}@keyframes appear-grow{0%{opacity:0;transform:scale(.8)}to{opacity:.8;transform:scale(1)}}.picmo__picker .picmo__error{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--secondary-text-color)}.picmo__picker .picmo__error .picmo__iconContainer{opacity:.8;animation:appear-grow .25s cubic-bezier(.175,.885,.32,1.275);--color-primary: var(--error-color);--color-secondary: var(--error-color-dark)}.picmo__picker .picmo__error .picmo__title{animation:appear .25s;animation-delay:50ms;animation-fill-mode:both}.picmo__picker .picmo__error button{padding:8px 16px;cursor:pointer;background:var(--background-color);border:1px solid var(--text-color);border-radius:5px;color:var(--text-color)}.picmo__picker .picmo__error button:hover{background:var(--text-color);color:var(--background-color)}.picmo__emojiButton{background:transparent;border:none;border-radius:15px;cursor:pointer;display:flex;font-family:var(--emoji-font);font-size:var(--emoji-size);height:100%;justify-content:center;align-items:center;margin:0;overflow:hidden;padding:0;width:100%}.picmo__emojiButton:hover{background:var(--hover-background-color)}.picmo__emojiButton:focus{border-radius:0;background:var(--focus-indicator-background-color);outline:1px solid var(--focus-indicator-color)}.picmo__picker .picmo__emojiArea{height:var(--emoji-area-height);overflow-y:auto;position:relative}.picmo__picker .picmo__emojiCategory{position:relative}.picmo__picker .picmo__emojiCategory .picmo__categoryName{font-size:.9em;padding:.5rem;margin:0;background:var(--category-name-background-color);color:var(--category-name-text-color);top:0;z-index:1;display:grid;gap:4px;grid-template-columns:auto 1fr auto;align-items:center;line-height:1;box-sizing:border-box;height:var(--category-name-height);justify-content:flex-start;text-transform:uppercase}.picmo__picker .picmo__emojiCategory .picmo__categoryName button{background:transparent;border:none;display:flex;align-items:center;cursor:pointer;color:var(--category-name-button-color)}.picmo__picker .picmo__emojiCategory .picmo__categoryName button:hover{opacity:1}.picmo__picker .picmo__emojiCategory .picmo__noRecents{color:var(--secondary-text-color);grid-column:1 / span var(--emojis-per-row);font-size:.9em;text-align:center;display:flex;align-items:center;justify-content:center;min-height:calc(var(--emoji-size) * var(--emoji-size-multiplier))}.picmo__picker .picmo__emojiCategory .picmo__recentEmojis[data-empty=true]{display:none}:is(.picmo__picker .picmo__emojiCategory) .picmo__recentEmojis[data-empty=false]+div{display:none}.picmo__picker .picmo__emojiContainer{display:grid;justify-content:space-between;gap:1px;padding:0 .5em;grid-template-columns:repeat(var(--emojis-per-row),calc(var(--emoji-size) * var(--emoji-size-multiplier)));grid-auto-rows:calc(var(--emoji-size) * var(--emoji-size-multiplier));align-items:center;justify-items:center}.picmo__picker.picmo__picker{--border-radius: 5px;--emoji-area-height: calc( (var(--row-count) * var(--emoji-size) * var(--emoji-size-multiplier)) + var(--category-name-height) );--content-height: var(--emoji-area-height);--emojis-per-row: 8;--row-count: 6;--emoji-preview-margin: 4px;--emoji-preview-height: calc(var(--emoji-preview-size) + 1em + 1px);--emoji-preview-height-full: calc(var(--emoji-preview-height) + var(--emoji-preview-margin));--emoji-preview-size: 2.75em;--emoji-size: 2rem;--emoji-size-multiplier: 1.3;--content-margin: 8px;--category-tabs-height:calc(1.5em + 9px);--category-tabs-offset: 8px;--category-tab-size: 1.2rem;--category-name-height: 2rem;--category-name-padding-y: 6px;--search-height: 2em;--search-margin: .5em;--search-margin-bottom: 4px;--search-height-full: calc(var(--search-height) + var(--search-margin) + var(--search-margin-bottom));--overlay-background-color: rgba(0, 0, 0, .8);--emoji-font: "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "EmojiOne Color", "Android Emoji";--ui-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;--ui-font-size: 16px;--picker-width: calc(var(--emojis-per-row) * var(--emoji-size) * var(--emoji-size-multiplier) + 2.75rem);--preview-background-color: var(--secondary-background-color);background:var(--background-color);border-radius:var(--border-radius);border:1px solid var(--border-color);font-family:var(--ui-font);font-size:var(--ui-font-size);overflow:hidden;position:relative;width:var(--picker-width);display:grid;gap:8px}.picmo__picker.picmo__picker>*{font-family:var(--ui-font)}.picmo__picker.picmo__skeleton{background:var(--background-color);border-radius:var(--border-radius);border:1px solid var(--border-color);font-family:var(--ui-font);width:var(--picker-width);color:var(--secondary-text-color)}.picmo__picker.picmo__skeleton *{box-sizing:border-box}.picmo__picker.picmo__skeleton .picmo__placeholder{background:var(--placeholder-background-color);position:relative;overflow:hidden}.picmo__picker.picmo__skeleton .picmo__placeholder:after{position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background-image:linear-gradient(90deg,rgba(255,255,255,0) 0,rgba(255,255,255,.2) 20%,rgba(255,255,255,.5) 60%,rgba(255,255,255,0) 100%);animation:shine 2s infinite;content:""}.picmo__picker.picmo__skeleton .picmo__headerSkeleton{background-color:var(--secondary-background-color);padding-top:8px;padding-bottom:8px;display:flex;flex-direction:column;overflow:hidden;gap:8px;border-bottom:1px solid var(--border-color);width:var(--picker-width)}.picmo__picker.picmo__skeleton .picmo__searchSkeleton{padding:0 8px;height:var(--search-height)}.picmo__picker.picmo__skeleton .picmo__searchSkeleton .picmo__searchInput{width:100%;height:28px;border-radius:3px}.picmo__picker.picmo__skeleton .picmo__categoryTabsSkeleton{height:var(--category-tabs-height);display:flex;flex-direction:row;align-items:center;justify-self:center;width:calc(2rem * var(--category-count, 1))}.picmo__picker.picmo__skeleton .picmo__categoryTabsSkeleton .picmo__categoryTab{width:25px;height:25px;padding:2px;border-radius:5px;margin:.25em}.picmo__picker.picmo__skeleton .picmo__contentSkeleton{height:var(--content-height);padding-right:8px;opacity:.7}.picmo__picker.picmo__skeleton .picmo__contentSkeleton .picmo__categoryName{width:50%;height:1rem;margin:.5rem;box-sizing:border-box}.picmo__picker.picmo__skeleton .picmo__contentSkeleton .picmo__emojiGrid{display:grid;justify-content:space-between;gap:1px;padding:0 .5em;grid-template-columns:repeat(var(--emojis-per-row),calc(var(--emoji-size) * var(--emoji-size-multiplier)));grid-auto-rows:calc(var(--emoji-size) * var(--emoji-size-multiplier));align-items:center;justify-items:center;width:var(--picker-width)}.picmo__picker.picmo__skeleton .picmo__contentSkeleton .picmo__emojiGrid .picmo__emoji{width:var(--emoji-size);height:var(--emoji-size);border-radius:50%}.picmo__picker.picmo__skeleton .picmo__previewSkeleton{height:var(--emoji-preview-height);border-top:1px solid var(--border-color);display:grid;align-items:center;padding:.5em;gap:6px;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;grid-template-areas:"emoji name" "emoji tags"}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__previewEmoji{grid-area:emoji;border-radius:50%;width:var(--emoji-preview-size);height:var(--emoji-preview-size)}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__previewName{grid-area:name;height:.8em;width:80%}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__tagList{grid-area:tags;list-style-type:none;display:flex;flex-direction:row;padding:0;margin:0}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__tagList .picmo__tag{border-radius:3px;padding:2px 8px;margin-right:.25em;height:1em;width:20%}.picmo__overlay{background:rgba(0,0,0,.75);height:100%;left:0;position:fixed;top:0;width:100%;z-index:1000}.picmo__content{position:relative;overflow:hidden;height:var(--content-height)}.picmo__content.picmo__fullHeight{height:calc(var(--content-height) + var(--category-tabs-height) + var(--category-tabs-offset));overflow-y:auto}.picmo__pluginContainer{margin:.5em;display:flex;flex-direction:row}.picmo__header{background-color:var(--secondary-background-color);padding-top:8px;padding-bottom:8px;display:grid;gap:8px;border-bottom:1px solid var(--border-color)}@media (prefers-reduced-motion: reduce){.picmo__placeholder{background:var(--placeholder-background-color);position:relative;overflow:hidden}.picmo__placeholder:after{display:none}}.picmo__picker .picmo__preview{border-top:1px solid var(--border-color);display:grid;align-items:center;gap:6px;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;grid-template-areas:"emoji name" "emoji tags";height:var(--emoji-preview-height);box-sizing:border-box;padding:.5em;position:relative;background:var(--preview-background-color)}.picmo__picker .picmo__preview .picmo__previewEmoji{grid-area:emoji;font-size:var(--emoji-preview-size);font-family:var(--emoji-font);width:1.25em;display:flex;align-items:center;justify-content:center}.picmo__picker .picmo__preview .picmo__previewName{grid-area:name;color:var(--text-color);font-size:.8em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500}.picmo__picker .picmo__preview .picmo__tagList{grid-area:tags;list-style-type:none;display:flex;flex-direction:row;padding:0;margin:0;font-size:.75em;overflow:hidden}.picmo__picker .picmo__preview .picmo__tag{border-radius:3px;background:var(--tag-background-color);color:var(--text-color);padding:2px 8px;margin-right:.25em;white-space:nowrap}.picmo__picker .picmo__preview .picmo__tag:last-child{margin-right:0}.picmo__picker .picmo__searchContainer{display:flex;height:var(--search-height);box-sizing:border-box;padding:0 8px;position:relative}.picmo__picker .picmo__searchContainer .picmo__searchField{background:var(--search-background-color);border-radius:3px;border:none;box-sizing:border-box;color:var(--text-color);font-size:.9em;outline:none;padding:.5em 2.25em .5em .5em;width:100%}.picmo__picker .picmo__searchContainer .picmo__searchField:focus{background:var(--search-focus-background-color)}.picmo__picker .picmo__searchContainer .picmo__searchField::placeholder{color:var(--search-placeholder-color)}.picmo__picker .picmo__searchContainer .picmo__searchAccessory{color:var(--search-icon-color);height:100%;position:absolute;right:1em;top:0;width:1.25rem;display:flex;align-items:center}.picmo__picker .picmo__searchContainer .picmo__searchAccessory svg{fill:var(--search-icon-color)}.picmo__picker .picmo__searchContainer .picmo__clearButton{border:0;color:var(--search-icon-color);background:transparent;cursor:pointer}.picmo__picker .picmo__searchContainer .picmo__clearSearchButton{cursor:pointer;border:none;background:transparent;color:var(--search-icon-color);font-size:1em;width:100%;height:100%;display:flex;align-items:center;padding:0}.picmo__picker .picmo__searchContainer .picmo__notFound [data-icon]{fill:#f3e265}.picmo__picker .picmo__variantOverlay{background:var(--overlay-background-color);border-radius:5px;display:flex;flex-direction:column;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.picmo__picker .picmo__variantOverlay .picmo__variantPopup{background:var(--variant-popup-background-color);border-radius:5px;margin:.5em;padding:.5em;text-align:center;user-select:none;display:flex;align-items:center;justify-content:center}.picmo__customEmoji{width:1em;height:1em}@keyframes shine{to{transform:translate(100%)}}.picmo__picker .picmo__imagePlaceholder{width:2rem;height:2rem;border-radius:50%}.picmo__placeholder{background:#DDDBDD;position:relative}.picmo__placeholder:after{position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background-image:linear-gradient(90deg,rgba(255,255,255,0) 0,rgba(255,255,255,.2) 20%,rgba(255,255,255,.5) 60%,rgba(255,255,255,0) 100%);animation:shine 2s infinite;content:""}\n');const t=xe(e),o=((null==t?void 0:t.custom)||[]).map((e=>({...e,custom:!0,tags:["custom",...e.tags||[]]}))),i=new ze;$t||($t=function(e){return Y(e.locale,e.dataStore,e.messages,e.emojiData)}(t));const s=new Lt(t.i18n);$t.then((e=>{i.emit("data:ready",e)})).catch((e=>{i.emit("error",e)}));const r=new Pt({events:i,i18n:s,customEmojis:o,renderer:t.renderer,options:t,emojiData:$t,pickerId:`picmo-${Date.now()}-${At++}`}).create(zt);return r.renderSync(),r},e.createStyleInjector=Ft,e.darkTheme=ee,e.debounce=z,e.deleteDatabase=function(e,t){e.deleteDatabase(t)},e.empty=I,e.en=ge,e.getEmojiForEvent=_,e.getOptions=xe,e.getPrefixedClasses=$,e.globalConfig=Se,e.i18n=Tt,e.isLocalStorageAvailable=R,e.isSessionStorageAvailable=V,e.lightTheme=X,e.prefixClassName=A,e.replaceChildren=T,e.shouldAnimate=x,e.throttle=S,e.toElement=L,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));