From 94efb0a672ca0fcef341062c6e12dfbadde53342 Mon Sep 17 00:00:00 2001 From: Karuhut Komol Date: Sat, 8 Jul 2023 22:54:10 +0700 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20upgrade=20jquery=20and=20p?= =?UTF-8?q?icmo=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- th_chat/js/jquery-3.6.3.min.js | 2 - th_chat/js/jquery-3.7.0.min.js | 2 + th_chat/js/picmo-popup.js | 4 +- th_chat/js/picmo.js | 102 ++++++++++++++++----------------- th_chat/template/big.htm | 2 +- th_chat/template/discuz.htm | 2 +- 6 files changed, 56 insertions(+), 58 deletions(-) delete mode 100644 th_chat/js/jquery-3.6.3.min.js create mode 100644 th_chat/js/jquery-3.7.0.min.js diff --git a/th_chat/js/jquery-3.6.3.min.js b/th_chat/js/jquery-3.6.3.min.js deleted file mode 100644 index b5329e9..0000000 --- a/th_chat/js/jquery-3.6.3.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.6.3 | (c) OpenJS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},S=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||S).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.3",E=function(e,t){return new E.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,S)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=E)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{if(d.cssSupportsSelector&&!CSS.supports("selector(:is("+c+"))"))throw new Error;return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===E&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[E]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,S=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.cssSupportsSelector=ce(function(){return CSS.supports("selector(*)")&&C.querySelectorAll(":is(:jqfake)")&&!CSS.supports("selector(:is(*,:jqfake))")}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=E,!C.getElementsByName||!C.getElementsByName(E).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&S){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&S){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&S)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+E+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+E+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),d.cssSupportsSelector||y.push(":has"),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&S&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?E.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?E.grep(e,function(e){return e===n!==r}):"string"!=typeof n?E.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(E.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof E?t[0]:t,E.merge(this,E.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:S,!0)),N.test(r[1])&&E.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=S.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(E):E.makeArray(e,this)}).prototype=E.fn,D=E(S);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}E.fn.extend({has:function(e){var t=E(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=S.createDocumentFragment().appendChild(S.createElement("div")),(fe=S.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",v.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?E.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&E(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),S.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;E.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||E.expando+"_"+Ct.guid++;return this[e]=!0,e}}),E.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||E.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?E(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=S.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),E.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=S.implementation.createHTMLDocument("")).createElement("base")).href=S.location.href,t.head.appendChild(r)):t=S),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&E(o).remove(),E.merge([],i.childNodes)));var r,i,o},E.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(E.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},E.expr.pseudos.animated=function(t){return E.grep(E.timers,function(e){return t===e.elem}).length},E.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=E.css(e,"position"),c=E(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=E.css(e,"top"),u=E.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,E.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},E.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){E.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===E.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===E.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=E(e).offset()).top+=E.css(e,"borderTopWidth",!0),i.left+=E.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-E.css(r,"marginTop",!0),left:t.left-i.left-E.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===E.css(e,"position"))e=e.offsetParent;return e||re})}}),E.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;E.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),E.each(["top","left"],function(e,n){E.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?E(e).position()[n]+"px":t})}),E.each({Height:"height",Width:"width"},function(a,s){E.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){E.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?E.css(e,t,i):E.style(e,t,n,i)},s,n?e:void 0,n)}})}),E.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){E.fn[t]=function(e){return this.on(t,e)}}),E.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),E.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){E.fn[n]=function(e,t){return 0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},R=function(){V()},M=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&z(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function X(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&M(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function U(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function z(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",R),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Me(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return R(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return R(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:l}=n,o=await(l.isRTL==null?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:u}=ot(c,i,o),a=i,p={},m=0;for(let d=0;dRt[e])}function rt(t,e,n){n===void 0&&(n=!1);const i=j(t),r=K(t),s=it(r);let l=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=X(l)),{main:l,cross:X(l)}}const kt={start:"end",end:"start"};function et(t){return t.replace(/start|end/g,e=>kt[e])}const Tt=["top","right","bottom","left"],At=Tt.reduce((t,e)=>t.concat(e,e+"-start",e+"-end"),[]),Ot=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,i,r,s,l;const{x:o,y:c,rects:f,middlewareData:u,placement:a,platform:p,elements:m}=e,{alignment:d=null,allowedPlacements:h=At,autoAlignment:g=!0,...w}=t,v=function(C,z,I){return(C?[...I.filter(k=>j(k)===C),...I.filter(k=>j(k)!==C)]:I.filter(k=>W(k)===k)).filter(k=>!C||j(k)===C||!!z&&et(k)!==k)}(d,g,h),x=await tt(e,w),y=(n=(i=u.autoPlacement)==null?void 0:i.index)!=null?n:0,S=v[y];if(S==null)return{};const{main:U,cross:Z}=rt(S,f,await(p.isRTL==null?void 0:p.isRTL(m.floating)));if(a!==S)return{x:o,y:c,reset:{placement:v[0]}};const E=[x[W(S)],x[U],x[Z]],L=[...(r=(s=u.autoPlacement)==null?void 0:s.overflows)!=null?r:[],{placement:S,overflows:E}],_=v[y+1];if(_)return{data:{index:y+1,overflows:L},reset:{placement:_}};const V=L.slice().sort((C,z)=>C.overflows[0]-z.overflows[0]),F=(l=V.find(C=>{let{overflows:z}=C;return z.every(I=>I<=0)}))==null?void 0:l.placement,H=F??V[0].placement;return H!==a?{data:{index:y+1,overflows:L},reset:{placement:H}}:{}}}},Bt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:o,elements:c}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:a,fallbackStrategy:p="bestFit",flipAlignment:m=!0,...d}=t,h=W(i),g=a||(h===l||!m?[X(l)]:function(E){const L=X(E);return[et(E),L,et(L)]}(l)),w=[l,...g],v=await tt(e,d),x=[];let y=((n=r.flip)==null?void 0:n.overflows)||[];if(f&&x.push(v[h]),u){const{main:E,cross:L}=rt(i,s,await(o.isRTL==null?void 0:o.isRTL(c.floating)));x.push(v[E],v[L])}if(y=[...y,{placement:i,overflows:x}],!x.every(E=>E<=0)){var S,U;const E=((S=(U=r.flip)==null?void 0:U.index)!=null?S:0)+1,L=w[E];if(L)return{data:{index:E,overflows:y},reset:{placement:L}};let _="bottom";switch(p){case"bestFit":{var Z;const V=(Z=y.map(F=>[F,F.overflows.filter(H=>H>0).reduce((H,C)=>H+C,0)]).sort((F,H)=>F[1]-H[1])[0])==null?void 0:Z[0].placement;V&&(_=V);break}case"initialPlacement":_=l}if(i!==_)return{reset:{placement:_}}}return{}}}},lt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:i}=e,r=await async function(s,l){const{placement:o,platform:c,elements:f}=s,u=await(c.isRTL==null?void 0:c.isRTL(f.floating)),a=W(o),p=j(o),m=K(o)==="x",d=["left","top"].includes(a)?-1:1,h=u&&m?-1:1,g=typeof l=="function"?l(s):l;let{mainAxis:w,crossAxis:v,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return p&&typeof x=="number"&&(v=p==="end"?-1*x:x),m?{x:v*h,y:w*d}:{x:w*d,y:v*h}}(e,t);return{x:n+r.x,y:i+r.y,data:r}}}};function $t(t){return t==="x"?"y":"x"}const ct=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:o={fn:g=>{let{x:w,y:v}=g;return{x:w,y:v}}},...c}=t,f={x:n,y:i},u=await tt(e,c),a=K(W(r)),p=$t(a);let m=f[a],d=f[p];if(s){const g=a==="y"?"bottom":"right";m=st(m+u[a==="y"?"top":"left"],m,m-u[g])}if(l){const g=p==="y"?"bottom":"right";d=st(d+u[p==="y"?"top":"left"],d,d-u[g])}const h=o.fn({...e,[a]:m,[p]:d});return{...h,data:{x:h.x-n,y:h.y-i}}}}};function at(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function T(t){if(t==null)return window;if(!at(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function P(t){return T(t).getComputedStyle(t)}function A(t){return at(t)?"":t?(t.nodeName||"").toLowerCase():""}function ut(){const t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function R(t){return t instanceof T(t).HTMLElement}function $(t){return t instanceof T(t).Element}function N(t){return typeof ShadowRoot>"u"?!1:t instanceof T(t).ShadowRoot||t instanceof ShadowRoot}function Y(t){const{overflow:e,overflowX:n,overflowY:i}=P(t);return/auto|scroll|overlay|hidden/.test(e+i+n)}function Dt(t){return["table","td","th"].includes(A(t))}function ft(t){const e=/firefox/i.test(ut()),n=P(t);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||e&&n.willChange==="filter"||e&&!!n.filter&&n.filter!=="none"}function dt(){return!/^((?!chrome|android).)*safari/i.test(ut())}const pt=Math.min,M=Math.max,G=Math.round;function O(t,e,n){var i,r,s,l;e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect();let c=1,f=1;e&&R(t)&&(c=t.offsetWidth>0&&G(o.width)/t.offsetWidth||1,f=t.offsetHeight>0&&G(o.height)/t.offsetHeight||1);const u=$(t)?T(t):window,a=!dt()&&n,p=(o.left+(a&&(i=(r=u.visualViewport)==null?void 0:r.offsetLeft)!=null?i:0))/c,m=(o.top+(a&&(s=(l=u.visualViewport)==null?void 0:l.offsetTop)!=null?s:0))/f,d=o.width/c,h=o.height/f;return{width:d,height:h,top:m,right:p+d,bottom:m+h,left:p,x:p,y:m}}function D(t){return(e=t,(e instanceof T(e).Node?t.ownerDocument:t.document)||window.document).documentElement;var e}function J(t){return $(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ht(t){return O(D(t)).left+J(t).scrollLeft}function St(t,e,n){const i=R(e),r=D(e),s=O(t,i&&function(c){const f=O(c);return G(f.width)!==c.offsetWidth||G(f.height)!==c.offsetHeight}(e),n==="fixed");let l={scrollLeft:0,scrollTop:0};const o={x:0,y:0};if(i||!i&&n!=="fixed")if((A(e)!=="body"||Y(r))&&(l=J(e)),R(e)){const c=O(e,!0);o.x=c.x+e.clientLeft,o.y=c.y+e.clientTop}else r&&(o.x=ht(r));return{x:s.left+l.scrollLeft-o.x,y:s.top+l.scrollTop-o.y,width:s.width,height:s.height}}function mt(t){return A(t)==="html"?t:t.assignedSlot||t.parentNode||(N(t)?t.host:null)||D(t)}function gt(t){return R(t)&&P(t).position!=="fixed"?function(e){let{offsetParent:n}=e,i=e,r=!1;for(;i&&i!==n;){const{assignedSlot:s}=i;if(s){let l=s.offsetParent;if(P(s).display==="contents"){const o=s.hasAttribute("style"),c=s.style.display;s.style.display=P(i).display,l=s.offsetParent,s.style.display=c,o||s.removeAttribute("style")}i=s,n!==l&&(n=l,r=!0)}else if(N(i)&&i.host&&r)break;i=N(i)&&i.host||i.parentNode}return n}(t):null}function nt(t){const e=T(t);let n=gt(t);for(;n&&Dt(n)&&P(n).position==="static";)n=gt(n);return n&&(A(n)==="html"||A(n)==="body"&&P(n).position==="static"&&!ft(n))?e:n||function(i){let r=mt(i);for(N(r)&&(r=r.host);R(r)&&!["html","body"].includes(A(r));){if(ft(r))return r;{const s=r.parentNode;r=N(s)?s.host:s}}return null}(t)||e}function yt(t){if(R(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=O(t);return{width:e.width,height:e.height}}function wt(t){const e=mt(t);return["html","body","#document"].includes(A(e))?t.ownerDocument.body:R(e)&&Y(e)?e:wt(e)}function Q(t,e){var n;e===void 0&&(e=[]);const i=wt(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=T(i),l=r?[s].concat(s.visualViewport||[],Y(i)?i:[]):i,o=e.concat(l);return r?o:o.concat(Q(l))}function vt(t,e,n){return e==="viewport"?q(function(i,r){const s=T(i),l=D(i),o=s.visualViewport;let c=l.clientWidth,f=l.clientHeight,u=0,a=0;if(o){c=o.width,f=o.height;const p=dt();(p||!p&&r==="fixed")&&(u=o.offsetLeft,a=o.offsetTop)}return{width:c,height:f,x:u,y:a}}(t,n)):$(e)?function(i,r){const s=O(i,!1,r==="fixed"),l=s.top+i.clientTop,o=s.left+i.clientLeft;return{top:l,left:o,x:o,y:l,right:o+i.clientWidth,bottom:l+i.clientHeight,width:i.clientWidth,height:i.clientHeight}}(e,n):q(function(i){var r;const s=D(i),l=J(i),o=(r=i.ownerDocument)==null?void 0:r.body,c=M(s.scrollWidth,s.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),f=M(s.scrollHeight,s.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let u=-l.scrollLeft+ht(i);const a=-l.scrollTop;return P(o||s).direction==="rtl"&&(u+=M(s.clientWidth,o?o.clientWidth:0)-c),{width:c,height:f,x:u,y:a}}(D(t)))}function Ht(t){const e=Q(t),n=["absolute","fixed"].includes(P(t).position)&&R(t)?nt(t):t;return $(n)?e.filter(i=>$(i)&&function(r,s){const l=s.getRootNode==null?void 0:s.getRootNode();if(r.contains(s))return!0;if(l&&N(l)){let o=s;do{if(o&&r===o)return!0;o=o.parentNode||o.host}while(o)}return!1}(i,n)&&A(i)!=="body"):[]}const Wt={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const s=[...n==="clippingAncestors"?Ht(e):[].concat(n),i],l=s[0],o=s.reduce((c,f)=>{const u=vt(e,f,r);return c.top=M(u.top,c.top),c.right=pt(u.right,c.right),c.bottom=pt(u.bottom,c.bottom),c.left=M(u.left,c.left),c},vt(e,l,r));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:i}=t;const r=R(n),s=D(n);if(n===s)return e;let l={scrollLeft:0,scrollTop:0};const o={x:0,y:0};if((r||!r&&i!=="fixed")&&((A(n)!=="body"||Y(s))&&(l=J(n)),R(n))){const c=O(n,!0);o.x=c.x+n.clientLeft,o.y=c.y+n.clientTop}return{...e,x:e.x-l.scrollLeft+o.x,y:e.y-l.scrollTop+o.y}},isElement:$,getDimensions:yt,getOffsetParent:nt,getDocumentElement:D,getElementRects:t=>{let{reference:e,floating:n,strategy:i}=t;return{reference:St(e,nt(n),i),floating:{...yt(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>P(t).direction==="rtl"};function _t(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:l=!0,animationFrame:o=!1}=i,c=r&&!o,f=s&&!o,u=c||f?[...$(t)?Q(t):[],...Q(e)]:[];u.forEach(d=>{c&&d.addEventListener("scroll",n,{passive:!0}),f&&d.addEventListener("resize",n)});let a,p=null;if(l){let d=!0;p=new ResizeObserver(()=>{d||n(),d=!1}),$(t)&&!o&&p.observe(t),p.observe(e)}let m=o?O(t):null;return o&&function d(){const h=O(t);!m||h.x===m.x&&h.y===m.y&&h.width===m.width&&h.height===m.height||n(),m=h,a=requestAnimationFrame(d)}(),n(),()=>{var d;u.forEach(h=>{c&&h.removeEventListener("scroll",n),f&&h.removeEventListener("resize",n)}),(d=p)==null||d.disconnect(),p=null,o&&cancelAnimationFrame(a)}}const Ft=(t,e,n)=>Et(t,e,{platform:Wt,...n});async function jt(t,e,n,i){if(!i)throw new Error("Must provide a positioning option");return await(typeof i=="string"?Nt(t,e,n,i):Mt(e,i))}async function Nt(t,e,n,i){if(!n)throw new Error("Reference element is required for relative positioning");let r;return i==="auto"?r={middleware:[Ot(),ct(),lt({mainAxis:5,crossAxis:12})]}:r={placement:i,middleware:[Bt(),ct(),lt(5)]},_t(n,e,async()=>{if((!n.isConnected||!n.offsetParent)&&Vt(t))return;const{x:s,y:l}=await Ft(n,e,r);Object.assign(e.style,{position:"absolute",left:`${s}px`,top:`${l}px`})})}function Mt(t,e){return t.style.position="fixed",Object.entries(e).forEach(([n,i])=>{t.style[n]=i}),()=>{}}function Vt(t){switch(t.options.onPositionLost){case"close":return t.close(),!0;case"destroy":return t.destroy(),!0;case"hold":return!0}}const zt={hideOnClickOutside:!0,hideOnEmojiSelect:!0,hideOnEscape:!0,position:"auto",showCloseButton:!0,onPositionLost:"none"};function It(t={}){return{...zt,rootElement:document.body,...t}}const Kt='',xt=b.getPrefixedClasses("popupContainer","closeButton");class bt{constructor(e,n){this.isOpen=!1,this.externalEvents=new b.Events,this.options={...It(n),...b.getOptions(e)},this.popupEl=document.createElement("div"),this.popupEl.classList.add(xt.popupContainer),this.popupEl.classList.add(this.options.theme),n.className&&this.popupEl.classList.add(n.className),this.options.showCloseButton&&(this.closeButton=document.createElement("button"),this.closeButton.type="button",this.closeButton.classList.add(xt.closeButton),this.closeButton.innerHTML=Kt,this.closeButton.addEventListener("click",()=>{this.close()}),this.popupEl.appendChild(this.closeButton));const i=document.createElement("div");this.popupEl.appendChild(i),this.picker=b.createPicker({...this.options,rootElement:i}),this.focusTrap=new b.FocusTrap,this.picker.addEventListener("data:ready",()=>{this.focusTrap.activate(this.picker.el),this.picker.setInitialFocus()}),this.options.hideOnEmojiSelect&&this.picker.addEventListener("emoji:select",()=>{var r;this.close(),(r=this.triggerElement)==null||r.focus()}),this.options.hideOnClickOutside&&(this.onDocumentClick=this.onDocumentClick.bind(this),document.addEventListener("click",this.onDocumentClick)),this.options.hideOnEscape&&(this.handleKeydown=this.handleKeydown.bind(this),this.popupEl.addEventListener("keydown",this.handleKeydown)),this.referenceElement=this.options.referenceElement,this.triggerElement=this.options.triggerElement}addEventListener(e,n){this.externalEvents.on(e,n),this.picker.addEventListener(e,n)}removeEventListener(e,n){this.externalEvents.off(e,n),this.picker.removeEventListener(e,n)}handleKeydown(e){var n;e.key==="Escape"&&(this.close(),(n=this.triggerElement)==null||n.focus())}async destroy(){this.isOpen&&await this.close(),document.removeEventListener("click",this.onDocumentClick),this.picker.destroy(),this.externalEvents.removeAll()}toggle(e){return this.isOpen?this.close():this.open(e)}async open({triggerElement:e,referenceElement:n}={}){this.isOpen||(e&&(this.triggerElement=e),n&&(this.referenceElement=n),await this.initiateOpenStateChange(!0),this.popupEl.style.opacity="0",this.options.rootElement.appendChild(this.popupEl),await this.setPosition(),this.picker.reset(!1),await this.animatePopup(!0),await this.animateCloseButton(!0),this.picker.setInitialFocus(),this.externalEvents.emit("picker:open"))}async close(){var e;this.isOpen&&(await this.initiateOpenStateChange(!1),await this.animateCloseButton(!1),await this.animatePopup(!1),this.popupEl.remove(),this.picker.reset(),(e=this.positionCleanup)==null||e.call(this),this.focusTrap.deactivate(),this.externalEvents.emit("picker:close"))}getRunningAnimations(){return this.picker.el.getAnimations().filter(e=>e.playState==="running")}async setPosition(){var e;(e=this.positionCleanup)==null||e.call(this),this.positionCleanup=await jt(this,this.popupEl,this.referenceElement,this.options.position)}awaitPendingAnimations(){return Promise.all(this.getRunningAnimations().map(e=>e.finished))}onDocumentClick(e){var r;const n=e.target,i=(r=this.triggerElement)==null?void 0:r.contains(n);this.isOpen&&!this.picker.isPickerClick(e)&&!i&&this.close()}animatePopup(e){return b.animate(this.popupEl,{opacity:[0,1],transform:["scale(0.9)","scale(1)"]},{duration:150,id:e?"show-picker":"hide-picker",easing:"ease-in-out",direction:e?"normal":"reverse",fill:"both"},this.options)}animateCloseButton(e){if(this.closeButton)return b.animate(this.closeButton,{opacity:[0,1]},{duration:25,id:e?"show-close":"hide-close",easing:"ease-in-out",direction:e?"normal":"reverse",fill:"both"},this.options)}async initiateOpenStateChange(e){this.isOpen=e,await this.awaitPendingAnimations()}}const qt=`.picmo__popupContainer{display:flex;flex-direction:column;position:absolute}.picmo__popupContainer .picmo__closeButton{position:absolute;opacity:0;background:transparent;border:none;z-index:1;right:0;top:0;cursor:pointer;padding:4px;align-self:flex-end;transform:translate(50%,-50%);background:#999999;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:50%}.picmo__popupContainer .picmo__closeButton:hover{background:var(--accent-color)}.picmo__popupContainer .picmo__closeButton svg{fill:#fff;width:1.25rem;height:1.25rem} -`,Xt=b.createStyleInjector();function Yt(t,e){return Xt(qt),new bt({autoFocus:"auto",...t},e)}B.PopupPickerController=bt,B.createPopup=Yt,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})}); +(function(T,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("picmo")):typeof define=="function"&&define.amd?define(["exports","picmo"],b):(T=typeof globalThis<"u"?globalThis:T||self,b(T.picmoPopup={},T.picmo))})(this,function(T,b){"use strict";function D(t){return t.split("-")[0]}function j(t){return t.split("-")[1]}function $(t){return["top","bottom"].includes(D(t))?"x":"y"}function et(t){return t==="y"?"height":"width"}function nt(t,e,n){let{reference:i,floating:o}=t;const r=i.x+i.width/2-o.width/2,c=i.y+i.height/2-o.height/2,s=$(e),l=et(s),a=i[l]/2-o[l]/2,h=D(e),f=s==="x";let u;switch(h){case"top":u={x:r,y:i.y-o.height};break;case"bottom":u={x:r,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:c};break;case"left":u={x:i.x-o.width,y:c};break;default:u={x:i.x,y:i.y}}switch(j(e)){case"start":u[s]-=a*(n&&f?-1:1);break;case"end":u[s]+=a*(n&&f?-1:1);break}return u}const xt=async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:c}=n,s=await(c.isRTL==null?void 0:c.isRTL(e));if(process.env.NODE_ENV!=="production"&&(c==null&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),r.filter(p=>{let{name:d}=p;return d==="autoPlacement"||d==="flip"}).length>1))throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement`","middleware detected. This will lead to an infinite loop. Ensure only","one of either has been passed to the `middleware` array."].join(" "));let l=await c.getElementRects({reference:t,floating:e,strategy:o}),{x:a,y:h}=nt(l,i,s),f=i,u={},m=0;for(let p=0;p50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),v&&m<=50){m++,typeof v=="object"&&(v.placement&&(f=v.placement),v.rects&&(l=v.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:o}):v.rects),{x:a,y:h}=nt(l,f,s)),p=-1;continue}}return{x:a,y:h,placement:f,strategy:o,middlewareData:u}};function bt(t){return{top:0,right:0,bottom:0,left:0,...t}}function Et(t){return typeof t!="number"?bt(t):{top:t,right:t,bottom:t,left:t}}function H(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function Q(t,e){var n;e===void 0&&(e={});const{x:i,y:o,platform:r,rects:c,elements:s,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:u=!1,padding:m=0}=e,p=Et(m),w=s[u?f==="floating"?"reference":"floating":f],y=H(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(w)))==null||n?w:w.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:a,rootBoundary:h,strategy:l})),g=H(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:f==="floating"?{...c.floating,x:i,y:o}:c.reference,offsetParent:await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),strategy:l}):c[f]);return{top:y.top-g.top+p.top,bottom:g.bottom-y.bottom+p.bottom,left:y.left-g.left+p.left,right:g.right-y.right+p.right}}const Ct=Math.min,Pt=Math.max;function ot(t,e,n){return Pt(t,Ct(e,n))}const At={left:"right",right:"left",bottom:"top",top:"bottom"};function z(t){return t.replace(/left|right|bottom|top/g,e=>At[e])}function it(t,e,n){n===void 0&&(n=!1);const i=j(t),o=$(t),r=et(o);let c=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(c=z(c)),{main:c,cross:z(c)}}const Ot={start:"end",end:"start"};function Z(t){return t.replace(/start|end/g,e=>Ot[e])}const Lt=["top","right","bottom","left"].reduce((t,e)=>t.concat(e,e+"-start",e+"-end"),[]);function kt(t,e,n){return(t?[...n.filter(o=>j(o)===t),...n.filter(o=>j(o)!==t)]:n.filter(o=>D(o)===o)).filter(o=>t?j(o)===t||(e?Z(o)!==o:!1):!0)}const Rt=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,i,o,r,c;const{x:s,y:l,rects:a,middlewareData:h,placement:f,platform:u,elements:m}=e,{alignment:p=null,allowedPlacements:d=Lt,autoAlignment:w=!0,...y}=t,g=kt(p,w,d),x=await Q(e,y),v=(n=(i=h.autoPlacement)==null?void 0:i.index)!=null?n:0,P=g[v];if(P==null)return{};const{main:q,cross:G}=it(P,a,await(u.isRTL==null?void 0:u.isRTL(m.floating)));if(f!==P)return{x:s,y:l,reset:{placement:g[0]}};const J=[x[D(P)],x[q],x[G]],A=[...(o=(r=h.autoPlacement)==null?void 0:r.overflows)!=null?o:[],{placement:P,overflows:J}],N=g[v+1];if(N)return{data:{index:v+1,overflows:A},reset:{placement:N}};const V=A.slice().sort((R,W)=>R.overflows[0]-W.overflows[0]),_=(c=V.find(R=>{let{overflows:W}=R;return W.every(se=>se<=0)}))==null?void 0:c.placement,F=_!=null?_:V[0].placement;return F!==f?{data:{index:v+1,overflows:A},reset:{placement:F}}:{}}}};function Tt(t){const e=z(t);return[Z(t),e,Z(e)]}const Bt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:i,middlewareData:o,rects:r,initialPlacement:c,platform:s,elements:l}=e,{mainAxis:a=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:u="bestFit",flipAlignment:m=!0,...p}=t,d=D(i),y=f||(d===c||!m?[z(c)]:Tt(c)),g=[c,...y],x=await Q(e,p),v=[];let P=((n=o.flip)==null?void 0:n.overflows)||[];if(a&&v.push(x[d]),h){const{main:A,cross:N}=it(i,r,await(s.isRTL==null?void 0:s.isRTL(l.floating)));v.push(x[A],x[N])}if(P=[...P,{placement:i,overflows:v}],!v.every(A=>A<=0)){var q,G;const A=((q=(G=o.flip)==null?void 0:G.index)!=null?q:0)+1,N=g[A];if(N)return{data:{index:A,overflows:P},reset:{placement:N}};let V="bottom";switch(u){case"bestFit":{var J;const _=(J=P.map(F=>[F,F.overflows.filter(R=>R>0).reduce((R,W)=>R+W,0)]).sort((F,R)=>F[1]-R[1])[0])==null?void 0:J[0].placement;_&&(V=_);break}case"initialPlacement":V=c;break}if(i!==V)return{reset:{placement:V}}}return{}}}};async function St(t,e){const{placement:n,platform:i,elements:o}=t,r=await(i.isRTL==null?void 0:i.isRTL(o.floating)),c=D(n),s=j(n),l=$(n)==="x",a=["left","top"].includes(c)?-1:1,h=r&&l?-1:1,f=typeof e=="function"?e(t):e;let{mainAxis:u,crossAxis:m,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof p=="number"&&(m=s==="end"?p*-1:p),l?{x:m*h,y:u*a}:{x:u*a,y:m*h}}const st=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:i}=e,o=await St(e,t);return{x:n+o.x,y:i+o.y,data:o}}}};function Dt(t){return t==="x"?"y":"x"}const rt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:r=!0,crossAxis:c=!1,limiter:s={fn:w=>{let{x:y,y:g}=w;return{x:y,y:g}}},...l}=t,a={x:n,y:i},h=await Q(e,l),f=$(D(o)),u=Dt(f);let m=a[f],p=a[u];if(r){const w=f==="y"?"top":"left",y=f==="y"?"bottom":"right",g=m+h[w],x=m-h[y];m=ot(g,m,x)}if(c){const w=u==="y"?"top":"left",y=u==="y"?"bottom":"right",g=p+h[w],x=p-h[y];p=ot(g,p,x)}const d=s.fn({...e,[f]:m,[u]:p});return{...d,data:{x:d.x-n,y:d.y-i}}}}};function ct(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function O(t){if(t==null)return window;if(!ct(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function E(t){return O(t).getComputedStyle(t)}function L(t){return ct(t)?"":t?(t.nodeName||"").toLowerCase():""}function lt(){const t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function C(t){return t instanceof O(t).HTMLElement}function B(t){return t instanceof O(t).Element}function Nt(t){return t instanceof O(t).Node}function I(t){if(typeof ShadowRoot>"u")return!1;const e=O(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function U(t){const{overflow:e,overflowX:n,overflowY:i}=E(t);return/auto|scroll|overlay|hidden/.test(e+i+n)}function Vt(t){return["table","td","th"].includes(L(t))}function at(t){const e=/firefox/i.test(lt()),n=E(t);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||e&&n.willChange==="filter"||e&&(n.filter?n.filter!=="none":!1)}function ft(){return!/^((?!chrome|android).)*safari/i.test(lt())}const ut=Math.min,M=Math.max,X=Math.round;function k(t,e,n){var i,o,r,c;e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect();let l=1,a=1;e&&C(t)&&(l=t.offsetWidth>0&&X(s.width)/t.offsetWidth||1,a=t.offsetHeight>0&&X(s.height)/t.offsetHeight||1);const h=B(t)?O(t):window,f=!ft()&&n,u=(s.left+(f&&(i=(o=h.visualViewport)==null?void 0:o.offsetLeft)!=null?i:0))/l,m=(s.top+(f&&(r=(c=h.visualViewport)==null?void 0:c.offsetTop)!=null?r:0))/a,p=s.width/l,d=s.height/a;return{width:p,height:d,top:m,right:u+p,bottom:m+d,left:u,x:u,y:m}}function S(t){return((Nt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Y(t){return B(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function dt(t){return k(S(t)).left+Y(t).scrollLeft}function Ft(t){const e=k(t);return X(e.width)!==t.offsetWidth||X(e.height)!==t.offsetHeight}function jt(t,e,n){const i=C(e),o=S(e),r=k(t,i&&Ft(e),n==="fixed");let c={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(i||!i&&n!=="fixed")if((L(e)!=="body"||U(o))&&(c=Y(e)),C(e)){const l=k(e,!0);s.x=l.x+e.clientLeft,s.y=l.y+e.clientTop}else o&&(s.x=dt(o));return{x:r.left+c.scrollLeft-s.x,y:r.top+c.scrollTop-s.y,width:r.width,height:r.height}}function pt(t){return L(t)==="html"?t:t.assignedSlot||t.parentNode||(I(t)?t.host:null)||S(t)}function ht(t){return!C(t)||E(t).position==="fixed"?null:It(t)}function It(t){let{offsetParent:e}=t,n=t,i=!1;for(;n&&n!==e;){const{assignedSlot:o}=n;if(o){let r=o.offsetParent;if(E(o).display==="contents"){const c=o.hasAttribute("style"),s=o.style.display;o.style.display=E(n).display,r=o.offsetParent,o.style.display=s,c||o.removeAttribute("style")}n=o,e!==r&&(e=r,i=!0)}else if(I(n)&&n.host&&i)break;n=I(n)&&n.host||n.parentNode}return e}function Mt(t){let e=pt(t);for(I(e)&&(e=e.host);C(e)&&!["html","body"].includes(L(e));){if(at(e))return e;{const n=e.parentNode;e=I(n)?n.host:n}}return null}function tt(t){const e=O(t);let n=ht(t);for(;n&&Vt(n)&&E(n).position==="static";)n=ht(n);return n&&(L(n)==="html"||L(n)==="body"&&E(n).position==="static"&&!at(n))?e:n||Mt(t)||e}function mt(t){if(C(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=k(t);return{width:e.width,height:e.height}}function _t(t){let{rect:e,offsetParent:n,strategy:i}=t;const o=C(n),r=S(n);if(n===r)return e;let c={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((o||!o&&i!=="fixed")&&((L(n)!=="body"||U(r))&&(c=Y(n)),C(n))){const l=k(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...e,x:e.x-c.scrollLeft+s.x,y:e.y-c.scrollTop+s.y}}function Wt(t,e){const n=O(t),i=S(t),o=n.visualViewport;let r=i.clientWidth,c=i.clientHeight,s=0,l=0;if(o){r=o.width,c=o.height;const a=ft();(a||!a&&e==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:r,height:c,x:s,y:l}}function $t(t){var e;const n=S(t),i=Y(t),o=(e=t.ownerDocument)==null?void 0:e.body,r=M(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),c=M(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let s=-i.scrollLeft+dt(t);const l=-i.scrollTop;return E(o||n).direction==="rtl"&&(s+=M(n.clientWidth,o?o.clientWidth:0)-r),{width:r,height:c,x:s,y:l}}function gt(t){const e=pt(t);return["html","body","#document"].includes(L(e))?t.ownerDocument.body:C(e)&&U(e)?e:gt(e)}function K(t,e){var n;e===void 0&&(e=[]);const i=gt(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),r=O(i),c=o?[r].concat(r.visualViewport||[],U(i)?i:[]):i,s=e.concat(c);return o?s:s.concat(K(c))}function Ht(t,e){const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&I(n)){let i=e;do{if(i&&t===i)return!0;i=i.parentNode||i.host}while(i)}return!1}function zt(t,e){const n=k(t,!1,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft;return{top:i,left:o,x:o,y:i,right:o+t.clientWidth,bottom:i+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}function wt(t,e,n){return e==="viewport"?H(Wt(t,n)):B(e)?zt(e,n):H($t(S(t)))}function Ut(t){const e=K(t),i=["absolute","fixed"].includes(E(t).position)&&C(t)?tt(t):t;return B(i)?e.filter(o=>B(o)&&Ht(o,i)&&L(o)!=="body"):[]}function Xt(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const c=[...n==="clippingAncestors"?Ut(e):[].concat(n),i],s=c[0],l=c.reduce((a,h)=>{const f=wt(e,h,o);return a.top=M(f.top,a.top),a.right=ut(f.right,a.right),a.bottom=ut(f.bottom,a.bottom),a.left=M(f.left,a.left),a},wt(e,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const Yt={getClippingRect:Xt,convertOffsetParentRelativeRectToViewportRelativeRect:_t,isElement:B,getDimensions:mt,getOffsetParent:tt,getDocumentElement:S,getElementRects:t=>{let{reference:e,floating:n,strategy:i}=t;return{reference:jt(e,tt(n),i),floating:{...mt(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>E(t).direction==="rtl"};function Kt(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:c=!0,animationFrame:s=!1}=i,l=o&&!s,a=r&&!s,h=l||a?[...B(t)?K(t):[],...K(e)]:[];h.forEach(d=>{l&&d.addEventListener("scroll",n,{passive:!0}),a&&d.addEventListener("resize",n)});let f=null;if(c){let d=!0;f=new ResizeObserver(()=>{d||n(),d=!1}),B(t)&&!s&&f.observe(t),f.observe(e)}let u,m=s?k(t):null;s&&p();function p(){const d=k(t);m&&(d.x!==m.x||d.y!==m.y||d.width!==m.width||d.height!==m.height)&&n(),m=d,u=requestAnimationFrame(p)}return n(),()=>{var d;h.forEach(w=>{l&&w.removeEventListener("scroll",n),a&&w.removeEventListener("resize",n)}),(d=f)==null||d.disconnect(),f=null,s&&cancelAnimationFrame(u)}}const qt=(t,e,n)=>xt(t,e,{platform:Yt,...n});async function Gt(t,e,n){if(!n)throw new Error("Must provide a positioning option");return await(typeof n=="string"?Jt(t,e,n):Qt(t,n))}async function Jt(t,e,n){if(!e)throw new Error("Reference element is required for relative positioning");let i;return n==="auto"?i={middleware:[Rt(),rt(),st({mainAxis:5,crossAxis:12})]}:i={placement:n,middleware:[Bt(),rt(),st(5)]},Kt(e,t,async()=>{const{x:o,y:r}=await qt(e,t,i);Object.assign(t.style,{position:"absolute",left:`${o}px`,top:`${r}px`})})}function Qt(t,e){return t.style.position="fixed",Object.entries(e).forEach(([n,i])=>{t.style[n]=i}),()=>{}}const Zt={hideOnClickOutside:!0,hideOnEmojiSelect:!0,hideOnEscape:!0,position:"auto",showCloseButton:!0};function te(t={}){return{...Zt,rootElement:document.body,...t}}const ee='',yt={popupContainer:"popupContainer",closeButton:"closeButton"};class vt{constructor(e,n){this.isOpen=!1,this.externalEvents=new b.Events,this.options={...te(n),...b.getOptions(e)},this.popupEl=document.createElement("div"),this.popupEl.classList.add(yt.popupContainer),this.popupEl.classList.add(this.options.theme),n.className&&this.popupEl.classList.add(n.className),this.options.showCloseButton&&(this.closeButton=document.createElement("button"),this.closeButton.type="button",this.closeButton.classList.add(yt.closeButton),this.closeButton.innerHTML=ee,this.popupEl.appendChild(this.closeButton));const i=document.createElement("div");this.popupEl.appendChild(i),this.picker=b.createPicker({...this.options,rootElement:i}),this.focusTrap=new b.FocusTrap,this.picker.addEventListener("data:ready",()=>{this.focusTrap.activate(this.picker.el),this.picker.setInitialFocus()}),this.options.hideOnEmojiSelect&&this.picker.addEventListener("emoji:select",()=>{var o;this.close(),(o=this.options.triggerElement)==null||o.focus()}),this.options.hideOnClickOutside&&(this.onDocumentClick=this.onDocumentClick.bind(this),document.addEventListener("click",this.onDocumentClick)),this.options.hideOnEscape&&(this.handleKeydown=this.handleKeydown.bind(this),this.popupEl.addEventListener("keydown",this.handleKeydown))}addEventListener(e,n){this.externalEvents.on(e,n),this.picker.addEventListener(e,n)}removeEventListener(e,n){this.externalEvents.off(e,n),this.picker.removeEventListener(e,n)}handleKeydown(e){var n;e.key==="Escape"&&(this.close(),(n=this.options.triggerElement)==null||n.focus())}async destroy(){this.isOpen&&await this.close(),document.removeEventListener("click",this.onDocumentClick),this.picker.destroy(),this.externalEvents.removeAll()}toggle(){return this.isOpen?this.close():this.open()}async open(){this.isOpen||(await this.initiateOpenStateChange(!0),this.options.rootElement.appendChild(this.popupEl),await this.setPosition(),this.picker.reset(),await this.animatePopup(!0),await this.animateCloseButton(!0),this.picker.setInitialFocus(),this.externalEvents.emit("picker:open"))}async close(){var e;!this.isOpen||(await this.initiateOpenStateChange(!1),await this.animateCloseButton(!1),await this.animatePopup(!1),this.popupEl.remove(),this.picker.reset(),(e=this.positionCleanup)==null||e.call(this),this.focusTrap.deactivate(),this.externalEvents.emit("picker:close"))}getRunningAnimations(){return this.picker.el.getAnimations().filter(e=>e.playState==="running")}async setPosition(){var e;(e=this.positionCleanup)==null||e.call(this),this.positionCleanup=await Gt(this.popupEl,this.options.referenceElement,this.options.position)}awaitPendingAnimations(){return Promise.all(this.getRunningAnimations().map(e=>e.finished))}onDocumentClick(e){var o;const n=e.target,i=(o=this.options.triggerElement)==null?void 0:o.contains(n);this.isOpen&&!this.picker.isPickerClick(e)&&!i&&this.close()}animatePopup(e){return b.animate(this.picker.el,{opacity:[0,1],transform:["scale(0.9)","scale(1)"]},{duration:150,id:e?"show-picker":"hide-picker",easing:"ease-in-out",direction:e?"normal":"reverse",fill:"both"},this.options)}animateCloseButton(e){if(this.closeButton)return b.animate(this.closeButton,{opacity:[0,1]},{duration:25,id:e?"show-close":"hide-close",easing:"ease-in-out",direction:e?"normal":"reverse",fill:"both"},this.options)}async initiateOpenStateChange(e){this.isOpen=e,await this.awaitPendingAnimations()}}const ne=`.popupContainer{display:flex;flex-direction:column;position:absolute}.popupContainer .closeButton{position:absolute;opacity:0;background:transparent;border:none;z-index:1;right:0;top:0;cursor:pointer;padding:4px;align-self:flex-end;transform:translate(50%,-50%);background:#999999;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:50%}.popupContainer .closeButton:hover{background:var(--accent-color)}.popupContainer .closeButton svg{fill:#fff;width:1.25rem;height:1.25rem} +`,oe=b.createStyleInjector();function ie(t,e){return oe(ne),new vt({autoFocus:"auto",...t},e)}T.PopupPickerController=vt,T.createPopup=ie,Object.defineProperties(T,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); diff --git a/th_chat/js/picmo.js b/th_chat/js/picmo.js index 0dc7916..69df8f2 100644 --- a/th_chat/js/picmo.js +++ b/th_chat/js/picmo.js @@ -1,4 +1,4 @@ -(function(n,m){typeof exports=="object"&&typeof module<"u"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):(n=typeof globalThis<"u"?globalThis:n||self,m(n.picmo={}))})(this,function(n){var k,A,I,ge,T,ye,R,fe,C,E,J,M,ve,V;"use strict";var pe=(n,m,f)=>{if(!m.has(n))throw TypeError("Cannot "+f)};var w=(n,m,f)=>(pe(n,m,"read from private field"),f?f.call(n):m.get(n)),b=(n,m,f)=>{if(m.has(n))throw TypeError("Cannot add the same private member more than once");m instanceof WeakSet?m.add(n):m.set(n,f)},W=(n,m,f,_)=>(pe(n,m,"write to private field"),_?_.call(n,f):m.set(n,f),f);var v=(n,m,f)=>(pe(n,m,"access private method"),f);const m="14.0";function f(o,e,t){let i=`https://cdn.jsdelivr.net/npm/emojibase-data@${e}/${o}`;return typeof t=="function"?i=t(o,e):typeof t=="string"&&(i=`${t}/${o}`),i}async function _(o,e={}){const{local:t=!1,version:i="latest",cdnUrl:s,...r}=e,a=f(o,i,s),c=t?localStorage:sessionStorage,h=`emojibase/${i}/${o}`,u=c.getItem(h);if(u)return Promise.resolve(JSON.parse(u));const g=await fetch(a,{credentials:"omit",mode:"cors",redirect:"error",...r});if(!g.ok)throw new Error("Failed to load Emojibase dataset.");const d=await g.json();try{c.setItem(h,JSON.stringify(d))}catch{}return d}const Qe={discord:"joypixels",slack:"iamcal"};async function we(o,e,t){var i;return _(`${o}/shortcodes/${(i=Qe[e])!==null&&i!==void 0?i:e}.json`,t)}function S(o,e){if(e.length===0)return o;const t=new Set(o.shortcodes);return e.forEach(i=>{const s=i[o.hexcode];Array.isArray(s)?s.forEach(r=>t.add(r)):s&&t.add(s)}),o.shortcodes=[...t],o.skins&&o.skins.forEach(i=>{S(i,e)}),o}function Xe(o,e=[]){const t=[];return o.forEach(i=>{if(i.skins){const{skins:s,...r}=i;t.push(S(r,e)),s.forEach(a=>{const c={...a};r.tags&&(c.tags=[...r.tags]),t.push(S(c,e))})}else t.push(S(i,e))}),t}function et(o,e){return e.length===0||o.forEach(t=>{S(t,e)}),o}async function be(o,e={}){const{compact:t=!1,flat:i=!1,shortcodes:s=[],...r}=e,a=await _(`${o}/${t?"compact":"data"}.json`,r);let c=[];return s.length>0&&(c=await Promise.all(s.map(h=>{let u;if(h.includes("/")){const[g,d]=h.split("/");u=we(g,d,r)}else u=we(o,h,r);return u.catch(()=>({}))}))),i?Xe(a,c):et(a,c)}async function Ce(o,e){return _(`${o}/messages.json`,e)}function D(o,e){const i=o.target.closest("[data-emoji]");if(i){const s=e.find(r=>r.emoji===i.dataset.emoji);if(s)return s}return null}function Z(o){var t;const e=(t=window.matchMedia)==null?void 0:t.call(window,"(prefers-reduced-motion: reduce)");return o.animate&&!(e!=null&&e.matches)}function Y(o,e){return o.toLowerCase().includes(e.toLowerCase())}function je(o,e){let t=null;return()=>{t||(t=window.setTimeout(()=>{o(),t=null},e))}}function _e(o,e){let t=null;return(...i)=>{t&&window.clearTimeout(t),t=window.setTimeout(()=>{o(...i),t=null},e)}}function x(o,e,t,i){if(Z(i)&&o.animate)return o.animate(e,t).finished;const s=t.direction==="normal"?1:0,r=Object.entries(e).reduce((a,[c,h])=>({...a,[c]:h[s]}),{});return Object.assign(o.style,r),Promise.resolve()}function B(o){var t;const e=document.createElement("template");return e.innerHTML=o,(t=e.content)==null?void 0:t.firstElementChild}async function ke(o){const e=new TextEncoder().encode(o),t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map(s=>s.toString(16).padStart(2,"0")).join("")}function y(...o){return o.reduce((e,t)=>({...e,[t]:N(t)}),{})}function N(o){return`picmo__${o}`}function P(o){for(;o.firstChild;)o.removeChild(o.firstChild);return o}function j(o,...e){P(o).append(...e)}function Ee(o){try{return window[o].length,!0}catch{return!1}}function Se(){return Ee("sessionStorage")}function xe(){return Ee("localStorage")}function Pe(){let o={};return{getItem:e=>o[e],setItem:(e,t)=>o[e]=t,length:Object.keys(o).length,clear:()=>o={},key:e=>Object.keys(o)[e],removeItem:e=>delete o[e]}}function z(o){var e;return{emoji:o.emoji,label:o.label,tags:o.tags,skins:(e=o.skins)==null?void 0:e.map(t=>z(t)),order:o.order,custom:!1,hexcode:o.hexcode,version:o.version}}function O(o,e,t){var i;return t&&!t.some(s=>s.order===o.group)?!1:Y(o.label,e)||((i=o.tags)==null?void 0:i.some(s=>Y(s,e)))}class ze{constructor(e="en"){this.locale=e}}const tt=[(o,e)=>(o.hexcode==="1F91D"&&e<14&&(o.skins=[]),o),(o,e)=>(o.skins&&(o.skins=o.skins.filter(t=>!t.version||t.version<=e)),o)];function ot(o,e){return tt.some(t=>t(o,e)===null)?null:o}function H(o,e){return o.filter(t=>ot(t,e)!==null)}const Q={};function X(o){return Q[o]||(Q[o]=new it(o)),Q[o]}X.deleteDatabase=o=>{};class it extends ze{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 i;let t=this.categories.filter(s=>s.key!=="component");if(e.showRecents&&t.unshift({key:"recents",order:-1}),(i=e.custom)!=null&&i.length&&t.push({key:"custom",order:10}),e.categories){const s=e.categories;t=t.filter(r=>s.includes(r.key)),t.sort((r,a)=>s.indexOf(r.key)-s.indexOf(a.key))}else t.sort((s,r)=>s.order-r.order);return Promise.resolve(t)}getEmojis(e,t){const i=this.emojis.filter(s=>s.group===e.order).filter(s=>s.version<=t).sort((s,r)=>s.order!=null&&r.order!=null?s.order-r.order:0).map(z);return Promise.resolve(H(i,t))}searchEmojis(e,t,i,s){const r=this.emojis.filter(h=>O(h,e,s)&&h.version<=i).map(z),a=t.filter(h=>O(h,e,s)),c=[...H(r,i),...a];return Promise.resolve(c)}setMeta(e){this.meta=e}}!Se()&&typeof window<"u"&&(console.warn("[picmo] sessionStorage not available, falling back to simple in-memory storage"),Object.defineProperty(window,"sessionStorage",{value:Pe()}));function st(o,e){const t=`https://cdn.jsdelivr.net/npm/emojibase-data@${o}/${e}`;return{emojisUrl:`${t}/data.json`,messagesUrl:`${t}/messages.json`}}async function Fe(o){try{return(await fetch(o,{method:"HEAD"})).headers.get("etag")}catch{return null}}function rt(o){const{emojisUrl:e,messagesUrl:t}=st("latest",o);try{return Promise.all([Fe(e),Fe(t)])}catch{return Promise.all([null,null])}}async function at(o,e,t){let i;try{i=await o.getEtags()}catch{i={}}const{storedEmojisEtag:s,storedMessagesEtag:r}=i;if(t!==r||e!==s){const[a,c]=await Promise.all([Ce(o.locale),be(o.locale)]);await o.populate({groups:a.groups,emojis:c,emojisEtag:e,messagesEtag:t})}}async function nt(o,e){const t=await o.getHash();return e!==t}async function Le(o,e,t){let i=t||e(o);try{await i.open()}catch{console.warn("[picmo] IndexedDB not available, falling back to InMemoryStoreFactory"),i=X(o)}return i}async function ct(o,e,t){const i=await Le(o,e,t),[s,r]=await rt(o);if(await i.isPopulated())s&&r&&await at(i,s,r);else{const[a,c]=await Promise.all([Ce(o),be(o)]);await i.populate({groups:a.groups,emojis:c,emojisEtag:s,messagesEtag:r})}return i}async function lt(o,e,t,i,s){const r=await Le(o,e,s),a=await ke(i);return(!await r.isPopulated()||await nt(r,a))&&await r.populate({groups:t.groups,emojis:i,hash:a}),r}async function ee(o,e,t,i,s){return t&&i?lt(o,e,t,i,s):ct(o,e,s)}function ht(o,e){o.deleteDatabase(e)}class $e{constructor(){this.handleKeyDown=this.handleKeyDown.bind(this)}activate(e){this.rootElement=e,this.rootElement.addEventListener("keydown",this.handleKeyDown)}deactivate(){var e;(e=this.rootElement)==null||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,i){e.target===t&&(i.focus(),e.preventDefault())}handleKeyDown(e){e.key==="Tab"&&this.checkFocus(e,e.shiftKey?this.firstFocusableElement:this.lastFocusableElement,e.shiftKey?this.lastFocusableElement:this.firstFocusableElement)}}const{light:Ae,dark:dt,auto:mt}=y("light","dark","auto");class l{constructor({template:e,classes:t,parent:i}){this.isDestroyed=!1,this.appEvents={},this.uiEvents=[],this.uiElements={},this.ui={},this.template=e,this.classes=t,this.parent=i,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(t=>{this.emojiData=t})}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[i]=t;i.type==="childList"&&i.addedNodes[0]===this.el&&(Z(this.options)&&this.animateShow&&this.animateShow(),e.disconnect)});e.observe(this.parent,{childList:!0})}}static childEvent(e,t,i,s={}){return{target:e,event:t,handler:i,options:s}}static uiEvent(e,t,i={}){return{event:e,handler:t,options:i}}static byClass(e){return`.${e}`}}const ut='',pt='',gt='',yt='',ft='',vt='',wt='',bt='',Ct=` +var le=(n,u,f)=>{if(!u.has(n))throw TypeError("Cannot "+f)};var v=(n,u,f)=>(le(n,u,"read from private field"),f?f.call(n):u.get(n)),w=(n,u,f)=>{if(u.has(n))throw TypeError("Cannot add the same private member more than once");u instanceof WeakSet?u.add(n):u.set(n,f)},G=(n,u,f,j)=>(le(n,u,"write to private field"),j?j.call(n,f):u.set(n,f),f);var y=(n,u,f)=>(le(n,u,"access private method"),f);(function(n,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(n=typeof globalThis<"u"?globalThis:n||self,u(n.picmo={}))})(this,function(n){var k,L,A,he,I,de,T,me,b,E,_,R,ue,V;"use strict";const u="14.0";function f(o,e,t){let s=`https://cdn.jsdelivr.net/npm/emojibase-data@${e}/${o}`;return typeof t=="function"?s=t(o,e):typeof t=="string"&&(s=`${t}/${o}`),s}async function j(o,e={}){const{local:t=!1,version:s="latest",cdnUrl:i,...r}=e,a=f(o,s,i),c=t?localStorage:sessionStorage,h=`emojibase/${s}/${o}`,m=c.getItem(h);if(m)return Promise.resolve(JSON.parse(m));const d=await fetch(a,{credentials:"omit",mode:"cors",redirect:"error",...r});if(!d.ok)throw new Error("Failed to load Emojibase dataset.");const C=await d.json();try{c.setItem(h,JSON.stringify(C))}catch{}return C}const Ge={discord:"joypixels",slack:"iamcal"};async function ge(o,e,t){var s;return j(`${o}/shortcodes/${(s=Ge[e])!==null&&s!==void 0?s:e}.json`,t)}function x(o,e){if(e.length===0)return o;const t=new Set(o.shortcodes);return e.forEach(s=>{const i=s[o.hexcode];Array.isArray(i)?i.forEach(r=>t.add(r)):i&&t.add(i)}),o.shortcodes=[...t],o.skins&&o.skins.forEach(s=>{x(s,e)}),o}function _e(o,e=[]){const t=[];return o.forEach(s=>{if(s.skins){const{skins:i,...r}=s;t.push(x(r,e)),i.forEach(a=>{const c={...a};r.tags&&(c.tags=[...r.tags]),t.push(x(c,e))})}else t.push(x(s,e))}),t}function We(o,e){return e.length===0||o.forEach(t=>{x(t,e)}),o}async function pe(o,e={}){const{compact:t=!1,flat:s=!1,shortcodes:i=[],...r}=e,a=await j(`${o}/${t?"compact":"data"}.json`,r);let c=[];return i.length>0&&(c=await Promise.all(i.map(h=>{let m;if(h.includes("/")){const[d,C]=h.split("/");m=ge(d,C,r)}else m=ge(o,h,r);return m.catch(()=>({}))}))),s?_e(a,c):We(a,c)}async function fe(o,e){return j(`${o}/messages.json`,e)}function M(o,e){const s=o.target.closest("[data-emoji]");if(s){const i=e.find(r=>r.emoji===s.dataset.emoji);if(i)return i}return null}function W(o){var t;const e=(t=window.matchMedia)==null?void 0:t.call(window,"(prefers-reduced-motion: reduce)");return o.animate&&!(e!=null&&e.matches)}function J(o,e){return o.toLowerCase().includes(e.toLowerCase())}function ye(o,e){let t=null;return()=>{t||(t=window.setTimeout(()=>{o(),t=null},e))}}function ve(o,e){let t=null;return(...s)=>{t&&window.clearTimeout(t),t=window.setTimeout(()=>{o(...s),t=null},e)}}function S(o,e,t,s){return W(s)&&o.animate?o.animate(e,t).finished:Promise.resolve()}function D(o){var t;const e=document.createElement("template");return e.innerHTML=o,(t=e.content)==null?void 0:t.firstElementChild}async function we(o){const e=new TextEncoder().encode(o),t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map(i=>i.toString(16).padStart(2,"0")).join("")}function p(...o){return o.reduce((e,t)=>({...e,[t]:B(t)}),{})}function B(o){return`${o}`}function Je(o,e){const t=`https://cdn.jsdelivr.net/npm/emojibase-data@${o}/${e}`;return{emojisUrl:`${t}/data.json`,messagesUrl:`${t}/messages.json`}}async function be(o){try{return(await fetch(o,{method:"HEAD"})).headers.get("etag")}catch{return null}}function Ye(o){const{emojisUrl:e,messagesUrl:t}=Je("latest",o);try{return Promise.all([be(e),be(t)])}catch{return Promise.all([null,null])}}async function Qe(o,e,t){let s;try{s=await o.getEtags()}catch{s={}}const{storedEmojisEtag:i,storedMessagesEtag:r}=s;if(t!==r||e!==i){const[a,c]=await Promise.all([fe(o.locale),pe(o.locale)]);await o.populate({groups:a.groups,emojis:c,emojisEtag:e,messagesEtag:t})}}async function Xe(o,e){const t=await o.getHash();return e!==t}async function Ce(o,e,t){const s=t||e(o);return await s.open(),s}async function Ze(o,e,t){const s=await Ce(o,e,t),[i,r]=await Ye(o);if(await s.isPopulated())i&&r&&await Qe(s,i,r);else{const[a,c]=await Promise.all([fe(o),pe(o)]);await s.populate({groups:a.groups,emojis:c,emojisEtag:i,messagesEtag:r})}return s}async function et(o,e,t,s,i){const r=await Ce(o,e,i),a=await we(s);return(!await r.isPopulated()||await Xe(r,a))&&await r.populate({groups:t.groups,emojis:s,hash:a}),r}async function Y(o,e,t,s,i){return t&&s?et(o,e,t,s,i):Ze(o,e,i)}function tt(o,e){o.deleteDatabase(e)}class je{constructor(){this.handleKeyDown=this.handleKeyDown.bind(this)}activate(e){this.rootElement=e,this.rootElement.addEventListener("keydown",this.handleKeyDown)}deactivate(){var e;(e=this.rootElement)==null||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,s){e.target===t&&(s.focus(),e.preventDefault())}handleKeyDown(e){e.key==="Tab"&&this.checkFocus(e,e.shiftKey?this.firstFocusableElement:this.lastFocusableElement,e.shiftKey?this.lastFocusableElement:this.firstFocusableElement)}}const{light:ke,dark:st,auto:ot}=p("light","dark","auto");class l{constructor({template:e,classes:t,parent:s}){this.isDestroyed=!1,this.appEvents={},this.uiEvents=[],this.uiElements={},this.ui={},this.template=e,this.classes=t,this.parent=s,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(t=>{this.emojiData=t})}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[s]=t;s.type==="childList"&&s.addedNodes[0]===this.el&&(W(this.options)&&this.animateShow&&this.animateShow(),e.disconnect)});e.observe(this.parent,{childList:!0})}}static childEvent(e,t,s,i={}){return{target:e,event:t,handler:s,options:i}}static uiEvent(e,t,s={}){return{event:e,handler:t,options:s}}static byClass(e){return`.${e}`}}const it='',rt='',at='',nt='',ct='',lt='',ht='',dt='',mt=` @@ -11,7 +11,7 @@ -`,jt='',_t='',kt='',Et='',St='',xt=` +`,ut='',gt='',pt='',ft='',yt='',vt=` @@ -20,9 +20,9 @@ -`,Pt='';function zt(o,e){const t=B(e);return t.dataset.icon=o,t.classList.add(N("icon")),t}const Ie={clock:ut,flag:pt,frown:gt,gamepad:yt,lightbulb:ft,mug:vt,plane:wt,robot:bt,sad:Ct,search:jt,smiley:_t,symbols:kt,tree:Et,users:St,warning:xt,xmark:Pt},K={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 Te(o,e){if(!(o in Ie))return console.warn(`Unknown icon: "${o}"`),document.createElement("div");const t=zt(o,Ie[o]);return e&&t.classList.add(N(`icon-${e}`)),t}const Ft={mode:"sync"};class p{constructor(e,t={}){b(this,I);b(this,T);b(this,R);b(this,k,void 0);b(this,A,void 0);W(this,k,e),W(this,A,t.mode||Ft.mode)}renderSync(e={}){const t=B(w(this,k).call(this,e));return v(this,R,fe).call(this,t,e),v(this,T,ye).call(this,t),v(this,I,ge).call(this,t,e),t}async renderAsync(e={}){const t=B(w(this,k).call(this,e));return v(this,R,fe).call(this,t,e),v(this,T,ye).call(this,t),await v(this,I,ge).call(this,t,e),t}render(e){return w(this,A)==="sync"?this.renderSync(e):this.renderAsync(e)}}k=new WeakMap,A=new WeakMap,I=new WeakSet,ge=async function(e,t){const i=e.querySelectorAll("[data-view]"),s=[];for(const r of i){const a=t[r.dataset.view];a?r.dataset.render!=="sync"?s.push(a.render().then(c=>(r.replaceWith(c),c))):r.replaceWith(a.renderSync()):r.remove()}return Promise.all(s)},T=new WeakSet,ye=function(e){e.querySelectorAll("i[data-icon]").forEach(i=>{const{icon:s,size:r}=i.dataset;i.replaceWith(Te(s,r))})},R=new WeakSet,fe=function(e,t){return e.querySelectorAll("[data-placeholder]").forEach(s=>{const r=s.dataset.placeholder;if(r&&t[r]){const a=t[r];s.replaceWith(...[a].flat())}else console.warn(`Missing placeholder element for key "${r}"`)}),e};const Lt=y("imagePlaceholder","placeholder"),$t=new p(({classes:o})=>` +`,wt='';function bt(o,e){const t=D(e);return t.dataset.icon=o,t.classList.add(B("icon")),t}const Ee={clock:it,flag:rt,frown:at,gamepad:nt,lightbulb:ct,mug:lt,plane:ht,robot:dt,sad:mt,search:ut,smiley:gt,symbols:pt,tree:ft,users:yt,warning:vt,xmark:wt},H={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 xe(o,e){if(!(o in Ee))return console.warn(`Unknown icon: "${o}"`),document.createElement("div");const t=bt(o,Ee[o]);return e&&t.classList.add(B(`icon-${e}`)),t}const Ct={mode:"sync"};class g{constructor(e,t={}){w(this,A);w(this,I);w(this,T);w(this,k,void 0);w(this,L,void 0);G(this,k,e),G(this,L,t.mode||Ct.mode)}renderSync(e={}){const t=D(v(this,k).call(this,e));return y(this,T,me).call(this,t,e),y(this,I,de).call(this,t),y(this,A,he).call(this,t,e),t}async renderAsync(e={}){const t=D(v(this,k).call(this,e));return y(this,T,me).call(this,t,e),y(this,I,de).call(this,t),await y(this,A,he).call(this,t,e),t}render(e){return v(this,L)==="sync"?this.renderSync(e):this.renderAsync(e)}}k=new WeakMap,L=new WeakMap,A=new WeakSet,he=async function(e,t){const s=e.querySelectorAll("[data-view]"),i=[];for(const r of s){const a=t[r.dataset.view];a?r.dataset.render!=="sync"?i.push(a.render().then(c=>(r.replaceWith(c),c))):r.replaceWith(a.renderSync()):r.remove()}return Promise.all(i)},I=new WeakSet,de=function(e){e.querySelectorAll("i[data-icon]").forEach(s=>{const{icon:i,size:r}=s.dataset;s.replaceWith(xe(i,r))})},T=new WeakSet,me=function(e,t){return e.querySelectorAll("[data-placeholder]").forEach(i=>{const r=i.dataset.placeholder;if(r&&t[r]){const a=t[r];i.replaceWith(...[a].flat())}else console.warn(`Missing placeholder element for key "${r}"`)}),e};const jt=p("imagePlaceholder","placeholder"),kt=new g(({classes:o})=>`
-`);class At extends l{constructor({classNames:e}={}){super({template:$t,classes:Lt}),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(i=>t.src=i)}renderSync(){return super.renderSync(),this.classNames&&this.classNames.split(" ").forEach(t=>this.el.classList.add(t)),this.el}}const It=y("customEmoji");class Re{renderElement(e){return{content:e}}renderImage(e="",t){const i=new At({classNames:e});return i.renderSync(),{content:i,resolver:()=>(i.load(t()),i.el)}}doRender(e,t,i){if(e.custom)return this.renderCustom(e,t,i);const{content:s,resolver:r}=this.render(e,i),a=s instanceof Element?s:s.el;return r&&r(),a}doEmit(e){return e.custom?this.emitCustom(e):this.emit(e)}emitCustom({url:e,label:t,emoji:i,data:s}){return{url:e,label:t,emoji:i,data:s}}renderCustom(e,t,i=""){const s=[It.customEmoji,i].join(" ").trim(),{content:r,resolver:a}=this.renderImage(s,()=>e.url),c=r instanceof Element?r:r.el;return a&&a(),c}}const Tt=new p(({emoji:o})=>`${o}`);class Me extends Re{render(e){return this.renderElement(Tt.renderSync({emoji:e.emoji}))}emit({emoji:e,hexcode:t,label:i}){return{emoji:e,hexcode:t,label:i}}}const te={"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..."},oe="PicMo";function ie(o){return new Rt(o)}ie.deleteDatabase=o=>new Promise((e,t)=>{const i=indexedDB.deleteDatabase(`${oe}-${o}`);i.addEventListener("success",e),i.addEventListener("error",t)});class Rt extends ze{async open(){const e=indexedDB.open(`${oe}-${this.locale}`);return new Promise((t,i)=>{e.addEventListener("success",s=>{var r;this.db=(r=s.target)==null?void 0:r.result,t()}),e.addEventListener("error",i),e.addEventListener("upgradeneeded",async s=>{var a;this.db=(a=s.target)==null?void 0:a.result,this.db.createObjectStore("category",{keyPath:"order"});const r=this.db.createObjectStore("emoji",{keyPath:"emoji"});r.createIndex("category","group"),r.createIndex("version","version"),this.db.createObjectStore("meta")})})}async delete(){this.close();const e=indexedDB.deleteDatabase(`${oe}-${this.locale}`);await this.waitForRequest(e)}close(){this.db.close()}async getEmojiCount(){const t=this.db.transaction("emoji","readonly").objectStore("emoji");return(await this.waitForRequest(t.count())).target.result}async getEtags(){const t=this.db.transaction("meta","readonly").objectStore("meta"),[i,s]=await Promise.all([this.waitForRequest(t.get("emojisEtag")),this.waitForRequest(t.get("messagesEtag"))]);return{storedEmojisEtag:i.target.result,storedMessagesEtag:s.target.result}}async setMeta(e){const t=this.db.transaction("meta","readwrite"),i=t.objectStore("meta");return new Promise(s=>{t.oncomplete=s,Object.keys(e).filter(Boolean).forEach(a=>{i.put(e[a],a)})})}async getHash(){const t=this.db.transaction("meta","readonly").objectStore("meta");return(await this.waitForRequest(t.get("hash"))).target.result}async isPopulated(){const t=this.db.transaction("category","readonly").objectStore("category");return(await this.waitForRequest(t.count())).target.result>0}async populate({groups:e,emojis:t,emojisEtag:i,messagesEtag:s,hash:r}){await this.removeAllObjects("category","emoji");const a=[this.addObjects("category",e),this.addObjects("emoji",t),this.setMeta({emojisEtag:i,messagesEtag:s,hash:r})];await Promise.all(a)}async getCategories(e){var a;const i=this.db.transaction("category","readonly").objectStore("category");let r=(await this.waitForRequest(i.getAll())).target.result.filter(c=>c.key!=="component");if(e.showRecents&&r.unshift({key:"recents",order:-1}),(a=e.custom)!=null&&a.length&&r.push({key:"custom",order:10}),e.categories){const c=e.categories;r=r.filter(h=>c.includes(h.key)),r.sort((h,u)=>c.indexOf(h.key)-c.indexOf(u.key))}else r.sort((c,h)=>c.order-h.order);return r}async getEmojis(e,t){const r=this.db.transaction("emoji","readonly").objectStore("emoji").index("category"),h=(await this.waitForRequest(r.getAll(e.order))).target.result.filter(u=>u.version<=t).sort((u,g)=>u.order!=null&&g.order!=null?u.order-g.order:0).map(z);return H(h,t)}async searchEmojis(e,t,i,s){const r=[];return new Promise((a,c)=>{const g=this.db.transaction("emoji","readonly").objectStore("emoji").openCursor();g.addEventListener("success",d=>{var Ye;const me=(Ye=d.target)==null?void 0:Ye.result;if(!me)return a([...H(r,i),...t.filter(No=>O(No,e))]);const ue=me.value;O(ue,e,s)&&ue.version<=i&&r.push(z(ue)),me.continue()}),g.addEventListener("error",d=>{c(d)})})}async waitForRequest(e){return new Promise((t,i)=>{e.onsuccess=t,e.onerror=i})}withTransaction(e,t="readwrite",i){return new Promise((s,r)=>{const a=this.db.transaction(e,t);a.oncomplete=s,a.onerror=r,i(a)})}async removeAllObjects(...e){const t=this.db.transaction(e,"readwrite"),i=e.map(s=>t.objectStore(s));await Promise.all(i.map(s=>this.waitForRequest(s.clear())))}async addObjects(e,t){return this.withTransaction(e,"readwrite",i=>{const s=i.objectStore(e);t.forEach(r=>{s.add(r)})})}}class se{}const re="PicMo:recents";class Ve extends se{constructor(e){super(),this.storage=e}clear(){this.storage.removeItem(re)}getRecents(e){try{return JSON.parse(this.storage.getItem(re)??"[]").slice(0,e)}catch{return[]}}addOrUpdateRecent(e,t){const i=[e,...this.getRecents(t).filter(s=>s.hexcode!==e.hexcode)].slice(0,t);try{this.storage.setItem(re,JSON.stringify(i))}catch{console.warn("storage is not available, recent emojis will not be saved")}}}class De extends Ve{constructor(){super(localStorage)}}const Mt={dataStore:ie,theme:Ae,animate:!0,showCategoryTabs:!0,showPreview:!0,showRecents:!0,showSearch:!0,showVariants:!0,emojisPerRow:8,visibleRows:6,emojiVersion:"auto",i18n:te,locale:"en",maxRecents:50,custom:[]};!xe()&&typeof window<"u"&&(console.warn("[picmo] localStorage not available, falling back to simple in-memory storage"),Object.defineProperty(window,"localStorage",{value:Pe()}));function Be(o={}){return{...Mt,...o,renderer:o.renderer||new Me,recentsProvider:o.recentsProvider||new De}}class U{constructor(){b(this,E);b(this,M);b(this,C,new Map)}on(e,t,i){v(this,M,ve).call(this,e,t,i)}once(e,t,i){v(this,M,ve).call(this,e,t,i,!0)}off(e,t){const i=v(this,E,J).call(this,e);w(this,C).set(e,i.filter(s=>s.handler!==t))}emit(e,...t){v(this,E,J).call(this,e).forEach(s=>{s.handler.apply(s.context,t),s.once&&this.off(e,s.handler)})}removeAll(){w(this,C).clear()}}C=new WeakMap,E=new WeakSet,J=function(e){return w(this,C).has(e)||w(this,C).set(e,[]),w(this,C).get(e)},M=new WeakSet,ve=function(e,t,i,s=!1){v(this,E,J).call(this,e).push({context:i,handler:t,once:s})};const Ne={injectStyles:!0};class Vt extends U{}class Dt extends U{}const ae=y("emojiCategory","categoryName","noRecents","recentEmojis");class ne extends l{constructor({template:e,category:t,showVariants:i,lazyLoader:s}){super({template:e,classes:ae}),this.baseUIElements={categoryName:l.byClass(ae.categoryName)},this.category=t,this.showVariants=i,this.lazyLoader=s}setActive(e,t,i){this.emojiContainer.setActive(e,t,i)}}const Bt=new p(({classes:o,emoji:e})=>` +`);class Et extends l{constructor({classNames:e}={}){super({template:kt,classes:jt}),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(s=>t.src=s)}renderSync(){return super.renderSync(),this.classNames&&this.classNames.split(" ").forEach(t=>this.el.classList.add(t)),this.el}}const xt=p("customEmoji");class Se{renderElement(e){return{content:e}}renderImage(e="",t){const s=new Et({classNames:e});return s.renderSync(),{content:s,resolver:()=>(s.load(t()),s.el)}}doRender(e,t,s){if(e.custom)return this.renderCustom(e,t,s);const{content:i,resolver:r}=this.render(e,s),a=i instanceof Element?i:i.el;return r&&r(),a}doEmit(e){return e.custom?this.emitCustom(e):this.emit(e)}emitCustom({url:e,label:t,emoji:s,data:i}){return{url:e,label:t,emoji:s,data:i}}renderCustom(e,t,s=""){const i=[xt.customEmoji,s].join(" ").trim(),{content:r,resolver:a}=this.renderImage(i,()=>e.url),c=r instanceof Element?r:r.el;return a&&a(),c}}const St=new g(({emoji:o})=>`${o}`);class Pe extends Se{render(e){return this.renderElement(St.renderSync({emoji:e.emoji}))}emit({emoji:e,hexcode:t,label:s}){return{emoji:e,hexcode:t,label:s}}}const ze={"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..."},Pt=[(o,e)=>(o.hexcode==="1F91D"&&e<14&&(o.skins=[]),o),(o,e)=>(o.skins&&(o.skins=o.skins.filter(t=>!t.version||t.version<=e)),o)];function zt(o,e){return Pt.some(t=>t(o,e)===null)?null:o}function N(o,e){return o.filter(t=>zt(t,e)!==null)}function P(o){var e;return{emoji:o.emoji,label:o.label,tags:o.tags,skins:(e=o.skins)==null?void 0:e.map(t=>P(t)),order:o.order,custom:!1,hexcode:o.hexcode,version:o.version}}function O(o,e,t){var s;return t&&!t.some(i=>i.order===o.group)?!1:J(o.label,e)||((s=o.tags)==null?void 0:s.some(i=>J(i,e)))}class $e{constructor(e="en"){this.locale=e}}const Q="PicMo";function X(o){return new $t(o)}X.deleteDatabase=o=>new Promise((e,t)=>{const s=indexedDB.deleteDatabase(`${Q}-${o}`);s.addEventListener("success",e),s.addEventListener("error",t)});class $t extends $e{async open(){const e=indexedDB.open(`${Q}-${this.locale}`);return new Promise((t,s)=>{e.addEventListener("success",i=>{var r;this.db=(r=i.target)==null?void 0:r.result,t()}),e.addEventListener("error",s),e.addEventListener("upgradeneeded",async i=>{var a;this.db=(a=i.target)==null?void 0:a.result,this.db.createObjectStore("category",{keyPath:"order"});const r=this.db.createObjectStore("emoji",{keyPath:"emoji"});r.createIndex("category","group"),r.createIndex("version","version"),this.db.createObjectStore("meta")})})}async delete(){this.close();const e=indexedDB.deleteDatabase(`${Q}-${this.locale}`);await this.waitForRequest(e)}close(){this.db.close()}async getEmojiCount(){const t=this.db.transaction("emoji","readonly").objectStore("emoji");return(await this.waitForRequest(t.count())).target.result}async getEtags(){const t=this.db.transaction("meta","readonly").objectStore("meta"),[s,i]=await Promise.all([this.waitForRequest(t.get("emojisEtag")),this.waitForRequest(t.get("messagesEtag"))]);return{storedEmojisEtag:s.target.result,storedMessagesEtag:i.target.result}}async setMeta(e){const t=this.db.transaction("meta","readwrite"),s=t.objectStore("meta");return new Promise(i=>{t.oncomplete=i,Object.keys(e).filter(Boolean).forEach(a=>{s.put(e[a],a)})})}async getHash(){const t=this.db.transaction("meta","readonly").objectStore("meta");return(await this.waitForRequest(t.get("hash"))).target.result}async isPopulated(){const t=this.db.transaction("category","readonly").objectStore("category");return(await this.waitForRequest(t.count())).target.result>0}async populate({groups:e,emojis:t,emojisEtag:s,messagesEtag:i,hash:r}){await this.removeAllObjects("category","emoji");const a=[this.addObjects("category",e),this.addObjects("emoji",t),this.setMeta({emojisEtag:s,messagesEtag:i,hash:r})];await Promise.all(a)}async getCategories(e){var a;const s=this.db.transaction("category","readonly").objectStore("category");let r=(await this.waitForRequest(s.getAll())).target.result.filter(c=>c.key!=="component");if(e.showRecents&&r.unshift({key:"recents",order:-1}),(a=e.custom)!=null&&a.length&&r.push({key:"custom",order:10}),e.categories){const c=e.categories;r=r.filter(h=>c.includes(h.key)),r.sort((h,m)=>c.indexOf(h.key)-c.indexOf(m.key))}else r.sort((c,h)=>c.order-h.order);return r}async getEmojis(e,t){const r=this.db.transaction("emoji","readonly").objectStore("emoji").index("category"),h=(await this.waitForRequest(r.getAll(e.order))).target.result.filter(m=>m.version<=t).sort((m,d)=>m.order!=null&&d.order!=null?m.order-d.order:0).map(P);return N(h,t)}async searchEmojis(e,t,s,i){const r=[];return new Promise((a,c)=>{const d=this.db.transaction("emoji","readonly").objectStore("emoji").openCursor();d.addEventListener("success",C=>{var qe;const ne=(qe=C.target)==null?void 0:qe.result;if(!ne)return a([...N(r,s),...t.filter(As=>O(As,e))]);const ce=ne.value;O(ce,e,i)&&ce.version<=s&&r.push(P(ce)),ne.continue()}),d.addEventListener("error",C=>{c(C)})})}async waitForRequest(e){return new Promise((t,s)=>{e.onsuccess=t,e.onerror=s})}withTransaction(e,t="readwrite",s){return new Promise((i,r)=>{const a=this.db.transaction(e,t);a.oncomplete=i,a.onerror=r,s(a)})}async removeAllObjects(...e){const t=this.db.transaction(e,"readwrite"),s=e.map(i=>t.objectStore(i));await Promise.all(s.map(i=>this.waitForRequest(i.clear())))}async addObjects(e,t){return this.withTransaction(e,"readwrite",s=>{const i=s.objectStore(e);t.forEach(r=>{i.add(r)})})}}class Fe{}const Z="PicMo:recents";class Le extends Fe{constructor(e){super(),this.storage=e}clear(){this.storage.removeItem(Z)}getRecents(e){var t;try{return JSON.parse((t=this.storage.getItem(Z))!=null?t:"[]").slice(0,e)}catch{return[]}}addOrUpdateRecent(e,t){const s=[e,...this.getRecents(t).filter(i=>i.hexcode!==e.hexcode)].slice(0,t);try{this.storage.setItem(Z,JSON.stringify(s))}catch{console.warn("storage is not available, recent emojis will not be saved")}}}class Ae extends Le{constructor(){super(localStorage)}}const Ft={dataStore:X,theme:ke,animate:!0,showCategoryTabs:!0,showPreview:!0,showRecents:!0,showSearch:!0,showVariants:!0,emojisPerRow:8,visibleRows:6,emojiVersion:"auto",i18n:ze,locale:"en",maxRecents:50,custom:[]};function Ie(o={}){return{...Ft,...o,renderer:o.renderer||new Pe,recentsProvider:o.recentsProvider||new Ae}}class U{constructor(){w(this,E);w(this,R);w(this,b,new Map)}on(e,t,s){y(this,R,ue).call(this,e,t,s)}once(e,t,s){y(this,R,ue).call(this,e,t,s,!0)}off(e,t){const s=y(this,E,_).call(this,e);v(this,b).set(e,s.filter(i=>i.handler!==t))}emit(e,...t){y(this,E,_).call(this,e).forEach(i=>{i.handler.apply(i.context,t),i.once&&this.off(e,i.handler)})}removeAll(){v(this,b).clear()}}b=new WeakMap,E=new WeakSet,_=function(e){return v(this,b).has(e)||v(this,b).set(e,[]),v(this,b).get(e)},R=new WeakSet,ue=function(e,t,s,i=!1){y(this,E,_).call(this,e).push({context:s,handler:t,once:i})};const Te={injectStyles:!0};class Lt extends U{}class At extends U{}const ee=p("emojiCategory","categoryName","noRecents","recentEmojis");class te extends l{constructor({template:e,category:t,showVariants:s,lazyLoader:i}){super({template:e,classes:ee}),this.baseUIElements={categoryName:l.byClass(ee.categoryName)},this.category=t,this.showVariants=s,this.lazyLoader=i}setActive(e,t,s){this.emojiContainer.setActive(e,t,s)}}const It=new g(({classes:o,emoji:e})=>` -`),Nt=y("emojiButton");class Oe extends l{constructor({emoji:e,lazyLoader:t,category:i}){super({template:Bt,classes:Nt}),this.emoji=e,this.lazyLoader=t,this.category=i}initialize(){this.uiEvents=[l.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 Ot{constructor(e,t,i=0,s=0,r=!1){this.events=new U,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=i,this.focusedColumn=s,this.emojiCount=t,this.wrap=r,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,i=!0){const s=this.getIndex();this.focusedRow=e,t!==void 0&&(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:s,to:this.getIndex(),performFocus:i})}setFocusedIndex(e,t=!0){const i=Math.floor(e/this.columnCount),s=e%this.columnCount;this.setCell(i,s,t)}focusNext(){this.focusedColumn0?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` +`),Tt=p("emojiButton");class Re extends l{constructor({emoji:e,lazyLoader:t,category:s}){super({template:It,classes:Tt}),this.emoji=e,this.lazyLoader=t,this.category=s}initialize(){this.uiEvents=[l.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 Rt{constructor(e,t,s=0,i=0,r=!1){this.events=new U,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=s,this.focusedColumn=i,this.emojiCount=t,this.wrap=r,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,s=!0){const i=this.getIndex();this.focusedRow=e,t!==void 0&&(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:s})}setFocusedIndex(e,t=!0){const s=Math.floor(e/this.columnCount),i=e%this.columnCount;this.setCell(s,i,t)}focusNext(){this.focusedColumn0?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`
-`),Kt=y("emojiContainer");class F extends l{constructor({emojis:e,showVariants:t,preview:i=!0,lazyLoader:s,category:r,fullHeight:a=!1}){super({template:Ht,classes:Kt}),this.fullHeight=!1,this.showVariants=t,this.lazyLoader=s,this.preview=i,this.emojis=e,this.category=r,this.fullHeight=a,this.setFocus=this.setFocus.bind(this),this.triggerNextCategory=this.triggerNextCategory.bind(this),this.triggerPreviousCategory=this.triggerPreviousCategory.bind(this)}initialize(){this.grid=new Ot(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=[l.uiEvent("click",this.selectEmoji),l.uiEvent("keydown",this.grid.handleKeyDown)],this.preview&&this.uiEvents.push(l.uiEvent("mouseover",this.showPreview),l.uiEvent("mouseout",this.hidePreview),l.uiEvent("focus",this.showPreview,{capture:!0}),l.uiEvent("blur",this.hidePreview,{capture:!0})),super.initialize()}setFocusedView(e,t){if(e)if(typeof e=="string"){const i=this.emojis.findIndex(s=>s.emoji===e);this.grid.setFocusedIndex(i,!1),setTimeout(()=>{var c,h,u;const s=this.emojiViews[i].el;s.scrollIntoView();const r=(c=s.parentElement)==null?void 0:c.previousElementSibling,a=(u=(h=s.parentElement)==null?void 0:h.parentElement)==null?void 0:u.parentElement;a.scrollTop-=(r==null?void 0:r.offsetHeight)??0})}else e.row==="first"||e.row===0?this.grid.setCell(0,e.offset,t):e.row==="last"&&this.grid.setCell(this.grid.getRowCount()-1,e.offset,t)}setActive(e,t,i){var s;e?this.setFocusedView(t,i):(s=this.emojiViews[this.grid.getIndex()])==null||s.deactivateFocus()}renderSync(){return this.emojiViews=this.emojis.map(e=>this.viewFactory.create(Oe,{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:i}){var s,r;(s=this.emojiViews[e])==null||s.deactivateFocus(),(r=this.emojiViews[t])==null||r.activateFocus(i)}selectEmoji(e){e.stopPropagation();const t=D(e,this.emojis);t&&this.events.emit("emoji:select",{emoji:t,showVariants:this.showVariants})}showPreview(e){const i=e.target.closest("button"),s=i==null?void 0:i.firstElementChild,r=D(e,this.emojis);r&&this.events.emit("preview:show",r,s==null?void 0:s.cloneNode(!0))}hidePreview(e){D(e,this.emojis)&&this.events.emit("preview:hide")}get emojiCount(){return this.emojis.length}}const Ut=new p(({classes:o,category:e,pickerId:t,icon:i,i18n:s})=>` +`),Mt=p("emojiContainer");class z extends l{constructor({emojis:e,showVariants:t,preview:s=!0,lazyLoader:i,category:r,fullHeight:a=!1}){super({template:Vt,classes:Mt}),this.fullHeight=!1,this.showVariants=t,this.lazyLoader=i,this.preview=s,this.emojis=e,this.category=r,this.fullHeight=a,this.setFocus=this.setFocus.bind(this),this.triggerNextCategory=this.triggerNextCategory.bind(this),this.triggerPreviousCategory=this.triggerPreviousCategory.bind(this)}initialize(){this.grid=new Rt(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=[l.uiEvent("click",this.selectEmoji),l.uiEvent("keydown",this.grid.handleKeyDown)],this.preview&&this.uiEvents.push(l.uiEvent("mouseover",this.showPreview),l.uiEvent("mouseout",this.hidePreview),l.uiEvent("focus",this.showPreview,{capture:!0}),l.uiEvent("blur",this.hidePreview,{capture:!0})),super.initialize()}setFocusedView(e,t){if(!!e)if(typeof e=="string"){const s=this.emojis.findIndex(i=>i.emoji===e);this.grid.setFocusedIndex(s,!1),setTimeout(()=>{var c,h,m,d;const i=this.emojiViews[s].el;i.scrollIntoView();const r=(c=i.parentElement)==null?void 0:c.previousElementSibling,a=(m=(h=i.parentElement)==null?void 0:h.parentElement)==null?void 0:m.parentElement;a.scrollTop-=(d=r==null?void 0:r.offsetHeight)!=null?d:0})}else e.row==="first"||e.row===0?this.grid.setCell(0,e.offset,t):e.row==="last"&&this.grid.setCell(this.grid.getRowCount()-1,e.offset,t)}setActive(e,t,s){var i;e?this.setFocusedView(t,s):(i=this.emojiViews[this.grid.getIndex()])==null||i.deactivateFocus()}renderSync(){return this.emojiViews=this.emojis.map(e=>this.viewFactory.create(Re,{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:s}){var i,r;(i=this.emojiViews[e])==null||i.deactivateFocus(),(r=this.emojiViews[t])==null||r.activateFocus(s)}selectEmoji(e){const t=M(e,this.emojis);t&&this.events.emit("emoji:select",{emoji:t,showVariants:this.showVariants})}showPreview(e){const s=e.target.closest("button"),i=s==null?void 0:s.firstElementChild,r=M(e,this.emojis);r&&this.events.emit("preview:show",r,i==null?void 0:i.cloneNode(!0))}hidePreview(e){M(e,this.emojis)&&this.events.emit("preview:hide")}get emojiCount(){return this.emojis.length}}const Dt=new g(({classes:o,category:e,pickerId:t,icon:s,i18n:i})=>`

- - ${s.get(`categories.${e.key}`,e.message||e.key)} + + ${i.get(`categories.${e.key}`,e.message||e.key)}

-`);class qt extends ne{constructor({category:e,showVariants:t,lazyLoader:i,emojiVersion:s}){super({category:e,showVariants:t,lazyLoader:i,template:Ut}),this.showVariants=t,this.lazyLoader=i,this.emojiVersion=s}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(F,{emojis:e,showVariants:this.showVariants,lazyLoader:this.lazyLoader,category:this.category.key}),super.render({category:this.category,emojis:this.emojiContainer,emojiCount:e.length,icon:K[this.category.key]})}}class Gt extends F{constructor({category:e,emojis:t,preview:i=!0,lazyLoader:s}){super({category:e,emojis:t,showVariants:!1,preview:i,lazyLoader:s})}async addOrUpdate(e){const t=this.el.querySelector(`[data-emoji="${e.emoji}"]`);t&&(this.el.removeChild(t),this.emojis=this.emojis.filter(s=>s!==e));const i=this.viewFactory.create(Oe,{emoji:e});if(this.el.insertBefore(i.renderSync(),this.el.firstChild),this.emojis=[e,...this.emojis.filter(s=>s!==e)],this.emojis.length>this.options.maxRecents){this.emojis=this.emojis.slice(0,this.options.maxRecents);const s=this.el.childElementCount-this.options.maxRecents;for(let r=0;r` -
+`);class Bt extends te{constructor({category:e,showVariants:t,lazyLoader:s,emojiVersion:i}){super({category:e,showVariants:t,lazyLoader:s,template:Dt}),this.showVariants=t,this.lazyLoader=s,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(z,{emojis:e,showVariants:this.showVariants,lazyLoader:this.lazyLoader,category:this.category.key}),super.render({category:this.category,emojis:this.emojiContainer,emojiCount:e.length,icon:H[this.category.key]})}}class Ht extends z{constructor({category:e,emojis:t,preview:s=!0,lazyLoader:i}){super({category:e,emojis:t,showVariants:!1,preview:s,lazyLoader:i})}async addOrUpdate(e){const t=this.el.querySelector(`[data-emoji="${e.emoji}"]`);t&&(this.el.removeChild(t),this.emojis=this.emojis.filter(i=>i!==e));const s=this.viewFactory.create(Re,{emoji:e});if(this.el.insertBefore(s.renderSync(),this.el.firstChild),this.emojis=[e,...this.emojis.filter(i=>i!==e)],this.emojis.length>this.options.maxRecents){this.emojis=this.emojis.slice(0,this.options.maxRecents);const i=this.el.childElementCount-this.options.maxRecents;for(let r=0;r` +

- + ${r.get(`categories.${t.key}`,t.message||t.key)}

@@ -56,53 +56,53 @@ ${r.get("recents.none")}
-`,{mode:"async"});class Jt extends ne{constructor({category:e,lazyLoader:t,provider:i}){super({category:e,showVariants:!1,lazyLoader:t,template:Wt}),this.provider=i}initialize(){this.uiElements={...this.baseUIElements,recents:l.byClass(ae.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 t;const e=(t=this.provider)==null?void 0:t.getRecents(this.options.maxRecents);return this.emojiContainer=this.viewFactory.create(Gt,{emojis:e,showVariants:!1,lazyLoader:this.lazyLoader,category:this.category.key}),await super.render({category:this.category,emojis:this.emojiContainer,emojiCount:e.length,icon:K[this.category.key]}),this.el}}const Zt=new p(({classes:o,category:e,pickerId:t,icon:i,i18n:s})=>` +`,{mode:"async"});class Ot extends te{constructor({category:e,lazyLoader:t,provider:s}){super({category:e,showVariants:!1,lazyLoader:t,template:Nt}),this.provider=s}initialize(){this.uiElements={...this.baseUIElements,recents:l.byClass(ee.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 t;const e=(t=this.provider)==null?void 0:t.getRecents(this.options.maxRecents);return this.emojiContainer=this.viewFactory.create(Ht,{emojis:e,showVariants:!1,lazyLoader:this.lazyLoader,category:this.category.key}),await super.render({category:this.category,emojis:this.emojiContainer,emojiCount:e.length,icon:H[this.category.key]}),this.el}}const Ut=new g(({classes:o,category:e,pickerId:t,icon:s,i18n:i})=>`

- - ${s.get(`categories.${e.key}`,e.message||e.key)} + + ${i.get(`categories.${e.key}`,e.message||e.key)}

-`);class Yt extends ne{constructor({category:e,lazyLoader:t}){super({template:Zt,showVariants:!1,lazyLoader:t,category:e})}initialize(){this.uiElements={...this.baseUIElements},super.initialize()}async render(){return this.emojiContainer=this.viewFactory.create(F,{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:K[this.category.key]})}}class He{constructor(){this.elements=new Map}lazyLoad(e,t){return this.elements.set(e,t),e}observe(e){if(window.IntersectionObserver){const t=new IntersectionObserver(i=>{i.filter(s=>s.intersectionRatio>0).map(s=>s.target).forEach(s=>{const r=this.elements.get(s);r==null||r(),t.unobserve(s)})},{root:e});this.elements.forEach((i,s)=>{t.observe(s)})}else this.elements.forEach(t=>{t()})}}const Ke=y("emojiArea"),Qt=new p(({classes:o})=>` +`);class Kt extends te{constructor({category:e,lazyLoader:t}){super({template:Ut,showVariants:!1,lazyLoader:t,category:e})}initialize(){this.uiElements={...this.baseUIElements},super.initialize()}async render(){return this.emojiContainer=this.viewFactory.create(z,{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:H[this.category.key]})}}class Ve{constructor(){this.elements=new Map}lazyLoad(e,t){return this.elements.set(e,t),e}observe(e){if(window.IntersectionObserver){const t=new IntersectionObserver(s=>{s.filter(i=>i.intersectionRatio>0).map(i=>i.target).forEach(i=>{const r=this.elements.get(i);r==null||r(),t.unobserve(i)})},{root:e});this.elements.forEach((s,i)=>{t.observe(i)})}else this.elements.forEach(t=>{t()})}}const Me=p("emojiArea"),qt=new g(({classes:o})=>`
-`,{mode:"async"}),Xt={recents:Jt,custom:Yt};function eo(o){return Xt[o.key]||qt}function to(o){return!o||o==="button"?{row:"first",offset:0}:o}class oo extends l{constructor({categoryTabs:e,categories:t,emojiVersion:i}){super({template:Qt,classes:Ke}),this.selectedCategory=0,this.scrollListenerState="active",this.lazyLoader=new He,this.categoryTabs=e,this.categories=t,this.emojiVersion=i,this.handleScroll=je(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:l.byClass(Ke.emojiArea)},this.uiEvents=[l.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,i)=>{e[`emojis-${t.key}`]=this.emojiCategories[i]}),await super.render({emojis:await Promise.all(this.emojiCategories.map(t=>t.render()))}),this.lazyLoader.observe(this.el),this.el}destroy(){super.destroy(),this.emojiCategories.forEach(e=>{var t;(t=this.observer)==null||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=eo(e);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(t=>t.key===this.options.initialCategory)?this.options.initialCategory:(e=this.categories.find(t=>t.key!=="recents"))==null?void 0:e.key}determineFocusTarget(e){const t=this.emojiCategories.find(i=>i.category.key===e);return this.options.initialEmoji&&(t!=null&&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:e??this.options.emojisPerRow})}focusNextCategory(e){this.selectedCategory{var c;return e<((c=this.emojiCategories[a+1])==null?void 0:c.el.offsetTop)}),s={changeFocusable:!1,performFocus:!1,scroll:!1};e===0?this.categoryTabs.setActiveTab(0,s):Math.floor(e)===Math.floor(t)||i<0?this.categoryTabs.setActiveTab(this.categories.length-1,s):this.categoryTabs.setActiveTab(i,s)}}const io=new p(({classList:o,classes:e,icon:t,message:i})=>` +`,{mode:"async"}),Gt={recents:Ot,custom:Kt};function _t(o){return Gt[o.key]||Bt}function Wt(o){return!o||o==="button"?{row:"first",offset:0}:o}class Jt extends l{constructor({categoryTabs:e,categories:t,emojiVersion:s}){super({template:qt,classes:Me}),this.selectedCategory=0,this.scrollListenerState="active",this.lazyLoader=new Ve,this.categoryTabs=e,this.categories=t,this.emojiVersion=s,this.handleScroll=ye(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:l.byClass(Me.emojiArea)},this.uiEvents=[l.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,s)=>{e[`emojis-${t.key}`]=this.emojiCategories[s]}),await super.render({emojis:await Promise.all(this.emojiCategories.map(t=>t.render()))}),this.lazyLoader.observe(this.el),window.ResizeObserver&&(this.observer=new ResizeObserver(()=>{const t=this.el.scrollHeight-this.scrollHeight;this.el.scrollTop-this.scrollTop===0&&t>0&&(this.el.scrollTop+=t),this.scrollHeight=this.el.scrollHeight,this.scrollTop=this.el.scrollTop}),this.emojiCategories.forEach(t=>{this.observer.observe(t.el)})),this.el}destroy(){super.destroy(),this.emojiCategories.forEach(e=>{var t;(t=this.observer)==null||t.unobserve(e.el),e.destroy()})}handleCategorySelect(e,t){this.selectCategory(e,t)}createCategory(e){const t=_t(e);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(t=>t.key===this.options.initialCategory)?this.options.initialCategory:(e=this.categories.find(t=>t.key!=="recents"))==null?void 0:e.key}determineFocusTarget(e){const t=this.emojiCategories.find(s=>s.category.key===e);return this.options.initialEmoji&&(t==null?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:e!=null?e:this.options.emojisPerRow})}focusNextCategory(e){this.selectedCategory{var c;return e<((c=this.emojiCategories[a+1])==null?void 0:c.el.offsetTop)}),i={changeFocusable:!1,performFocus:!1,scroll:!1};e===0?this.categoryTabs.setActiveTab(0,i):Math.floor(e)===Math.floor(t)||s<0?this.categoryTabs.setActiveTab(this.categories.length-1,i):this.categoryTabs.setActiveTab(s,i)}}const Yt=new g(({classList:o,classes:e,icon:t,message:s})=>` -`),Ue=y("error","iconContainer","title");class ce extends l{constructor({message:e,icon:t="warning",template:i=io,className:s}){super({template:i,classes:Ue}),this.message=e,this.icon=t,this.className=s}renderSync(){const e=[Ue.error,this.className].join(" ").trim();return super.renderSync({message:this.message,icon:this.icon,classList:e})}}const so=new p(({classList:o,classes:e,icon:t,i18n:i,message:s})=>` +`),De=p("error","iconContainer","title");class se extends l{constructor({message:e,icon:t="warning",template:s=Yt,className:i}){super({template:s,classes:De}),this.message=e,this.icon=t,this.className=i}renderSync(){const e=[De.error,this.className].join(" ").trim();return super.renderSync({message:this.message,icon:this.icon,classList:e})}}const Qt=new g(({classList:o,classes:e,icon:t,i18n:s,message:i})=>` -`),ro=y("dataError");class ao extends ce{constructor({message:e}){super({message:e,template:so,className:ro.dataError})}initialize(){this.uiElements={retryButton:"button"},this.uiEvents=[l.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 ee(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 L=y("preview","previewEmoji","previewName","tagList","tag"),no=new p(({classes:o,tag:e})=>` +`),Xt=p("dataError");class Zt extends se{constructor({message:e}){super({message:e,template:Qt,className:Xt.dataError})}initialize(){this.uiElements={retryButton:"button"},this.uiEvents=[l.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 $=p("preview","previewEmoji","previewName","tagList","tag"),es=new g(({classes:o,tag:e})=>`
  • ${e}
  • -`),co=new p(({classes:o})=>` +`),ts=new g(({classes:o})=>`
      -`);class lo extends l{constructor(){super({template:co,classes:L})}initialize(){this.uiElements={emoji:l.byClass(L.previewEmoji),name:l.byClass(L.previewName),tagList:l.byClass(L.tagList)},this.appEvents={"preview:show":this.showPreview,"preview:hide":this.hidePreview},super.initialize()}showPreview(e,t){if(j(this.ui.emoji,t),this.ui.name.textContent=e.label,e.tags){this.ui.tagList.style.display="flex";const i=e.tags.map(s=>no.renderSync({tag:s,classes:L}));j(this.ui.tagList,...i)}}hidePreview(){P(this.ui.emoji),P(this.ui.name),P(this.ui.tagList)}}const ho=new p(({classes:o,i18n:e})=>` +`);class ss extends l{constructor(){super({template:ts,classes:$})}initialize(){this.uiElements={emoji:l.byClass($.previewEmoji),name:l.byClass($.previewName),tagList:l.byClass($.tagList)},this.appEvents={"preview:show":this.showPreview,"preview:hide":this.hidePreview},super.initialize()}showPreview(e,t){if(this.ui.emoji.replaceChildren(t),this.ui.name.textContent=e.label,e.tags){this.ui.tagList.style.display="flex";const s=e.tags.map(i=>es.renderSync({tag:i,classes:$}));this.ui.tagList.replaceChildren(...s)}}hidePreview(){this.ui.emoji.replaceChildren(),this.ui.name.textContent="",this.ui.tagList.replaceChildren()}}const os=new g(({classes:o,i18n:e})=>` -`),mo=new p(({classes:o,i18n:e})=>` +`),is=new g(({classes:o,i18n:e})=>`
      -`,{mode:"async"}),$=y("searchContainer","searchField","clearButton","searchAccessory","clearSearchButton","notFound");class uo extends l{constructor({categories:e,emojiVersion:t}){super({template:mo,classes:$}),this.categories=e.filter(i=>i.key!=="recents"),this.emojiVersion=t,this.search=_e(this.search.bind(this),100)}initialize(){this.uiElements={searchField:l.byClass($.searchField),searchAccessory:l.byClass($.searchAccessory)},this.uiEvents=[l.childEvent("searchField","keydown",this.onKeyDown),l.childEvent("searchField","input",this.onSearchInput)],super.initialize()}async render(){return await super.render(),this.searchIcon=Te("search"),this.notFoundMessage=this.viewFactory.create(ce,{message:this.i18n.get("search.notFound"),className:$.notFound,icon:"sad"}),this.notFoundMessage.renderSync(),this.errorMessage=this.viewFactory.create(ce,{message:this.i18n.get("search.error")}),this.errorMessage.renderSync(),this.clearSearchButton=ho.render({classes:$,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){j(this.ui.searchAccessory,e)}clear(){this.searchField.value="",this.showSearchIcon()}focus(){this.searchField.focus()}onClearSearch(e){var t;e.stopPropagation(),this.searchField.value="",(t=this.resultsContainer)==null||t.destroy(),this.resultsContainer=null,this.showSearchIcon(),this.events.emit("content:show"),this.searchField.focus()}handleResultsKeydown(e){this.resultsContainer&&e.key==="Escape"&&this.onClearSearch(e)}onKeyDown(e){var t;e.key==="Escape"&&this.searchField.value?this.onClearSearch(e):(e.key==="Enter"||e.key==="ArrowDown")&&this.resultsContainer&&(e.preventDefault(),(t=this.resultsContainer.el.querySelector('[tabindex="0"]'))==null||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 i=new He;this.resultsContainer=this.viewFactory.create(F,{emojis:t,fullHeight:!0,showVariants:!0,lazyLoader:i}),this.resultsContainer.renderSync(),(e=this.resultsContainer)!=null&&e.el&&(i.observe(this.resultsContainer.el),this.resultsContainer.setActive(!0,{row:0,offset:0},!1),this.resultsContainer.el.addEventListener("keydown",s=>this.handleResultsKeydown(s)),this.events.emit("content:show",this.resultsContainer))}else this.events.emit("content:show",this.notFoundMessage)}catch{this.events.emit("content:show",this.errorMessage)}}}const po=new p(({classes:o})=>` +`,{mode:"async"}),F=p("searchContainer","searchField","clearButton","searchAccessory","clearSearchButton","notFound");class rs extends l{constructor({categories:e,emojiVersion:t}){super({template:is,classes:F}),this.categories=e.filter(s=>s.key!=="recents"),this.emojiVersion=t,this.search=ve(this.search.bind(this),100)}initialize(){this.uiElements={searchField:l.byClass(F.searchField),searchAccessory:l.byClass(F.searchAccessory)},this.uiEvents=[l.childEvent("searchField","keydown",this.onKeyDown),l.childEvent("searchField","input",this.onSearchInput)],super.initialize()}async render(){return await super.render(),this.searchIcon=xe("search"),this.notFoundMessage=this.viewFactory.create(se,{message:this.i18n.get("search.notFound"),className:F.notFound,icon:"sad"}),this.notFoundMessage.renderSync(),this.errorMessage=this.viewFactory.create(se,{message:this.i18n.get("search.error")}),this.errorMessage.renderSync(),this.clearSearchButton=os.render({classes:F,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){this.ui.searchAccessory.replaceChildren(e)}clear(){this.searchField.value="",this.showSearchIcon()}focus(){this.searchField.focus()}onClearSearch(e){var t;e.stopPropagation(),this.searchField.value="",(t=this.resultsContainer)==null||t.destroy(),this.resultsContainer=null,this.showSearchIcon(),this.events.emit("content:show"),this.searchField.focus()}handleResultsKeydown(e){this.resultsContainer&&e.key==="Escape"&&this.onClearSearch(e)}onKeyDown(e){var t;e.key==="Escape"&&this.searchField.value?this.onClearSearch(e):(e.key==="Enter"||e.key==="ArrowDown")&&this.resultsContainer&&(e.preventDefault(),(t=this.resultsContainer.el.querySelector('[tabindex="0"]'))==null||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 s=new Ve;this.resultsContainer=this.viewFactory.create(z,{emojis:t,fullHeight:!0,showVariants:!0,lazyLoader:s}),this.resultsContainer.renderSync(),(e=this.resultsContainer)!=null&&e.el&&(s.observe(this.resultsContainer.el),this.resultsContainer.setActive(!0,{row:0,offset:0},!1),this.resultsContainer.el.addEventListener("keydown",i=>this.handleResultsKeydown(i)),this.events.emit("content:show",this.resultsContainer))}else this.events.emit("content:show",this.notFoundMessage)}catch{this.events.emit("content:show",this.errorMessage)}}}const as=new g(({classes:o})=>`
      -`),qe=y("variantOverlay","variantPopup"),le={easing:"ease-in-out",duration:250,fill:"both"},Ge={opacity:[0,1]},We={opacity:[0,1],transform:["scale3d(0.8, 0.8, 0.8)","scale3d(1, 1, 1)"]};class go extends l{constructor({emoji:e,parent:t}){super({template:po,classes:qe,parent:t}),this.focusedEmojiIndex=0,this.focusTrap=new $e,this.animateShow=()=>Promise.all([x(this.el,Ge,le,this.options),x(this.ui.popup,We,le,this.options)]),this.emoji=e}initialize(){this.uiElements={popup:l.byClass(qe.variantPopup)},this.uiEvents=[l.uiEvent("click",this.handleClick),l.uiEvent("keydown",this.handleKeydown)],super.initialize()}animateHide(){const e={...le,direction:"reverse"};return Promise.all([x(this.el,Ge,e,this.options),x(this.ui.popup,We,e,this.options)])}async hide(){await this.animateHide(),this.events.emit("variantPopup:hide")}handleKeydown(e){e.key==="Escape"&&(this.hide(),e.stopPropagation())}handleClick(e){this.ui.popup.contains(e.target)||this.hide()}getEmoji(e){return this.renderedEmojis[e]}setFocusedEmoji(e){const t=this.getEmoji(this.focusedEmojiIndex);t.tabIndex=-1,this.focusedEmojiIndex=e;const i=this.getEmoji(this.focusedEmojiIndex);i.tabIndex=0,i.focus()}destroy(){this.emojiContainer.destroy(),this.focusTrap.deactivate(),super.destroy()}renderSync(){const e={...this.emoji,skins:null},t=(this.emoji.skins||[]).map(s=>({...s,label:this.emoji.label,tags:this.emoji.tags})),i=[e,...t];return this.emojiContainer=this.viewFactory.create(F,{emojis:i,preview:!1}),super.renderSync({emojis:this.emojiContainer}),i.length` +`),Be=p("variantOverlay","variantPopup"),oe={easing:"ease-in-out",duration:250,fill:"both"},He={opacity:[0,1]},Ne={opacity:[0,1],transform:["scale3d(0.8, 0.8, 0.8)","scale3d(1, 1, 1)"]};class ns extends l{constructor({emoji:e,parent:t}){super({template:as,classes:Be,parent:t}),this.focusedEmojiIndex=0,this.focusTrap=new je,this.animateShow=()=>Promise.all([S(this.el,He,oe,this.options),S(this.ui.popup,Ne,oe,this.options)]),this.emoji=e}initialize(){this.uiElements={popup:l.byClass(Be.variantPopup)},this.uiEvents=[l.uiEvent("click",this.handleClick),l.uiEvent("keydown",this.handleKeydown)],super.initialize()}animateHide(){const e={...oe,direction:"reverse"};return Promise.all([S(this.el,He,e,this.options),S(this.ui.popup,Ne,e,this.options)])}async hide(){await this.animateHide(),this.events.emit("variantPopup:hide")}handleKeydown(e){e.key==="Escape"&&(this.hide(),e.stopPropagation())}handleClick(e){this.ui.popup.contains(e.target)||this.hide()}getEmoji(e){return this.renderedEmojis[e]}setFocusedEmoji(e){const t=this.getEmoji(this.focusedEmojiIndex);t.tabIndex=-1,this.focusedEmojiIndex=e;const s=this.getEmoji(this.focusedEmojiIndex);s.tabIndex=0,s.focus()}destroy(){this.emojiContainer.destroy(),this.focusTrap.deactivate(),super.destroy()}renderSync(){const e={...this.emoji,skins:null},t=(this.emoji.skins||[]).map(i=>({...i,label:this.emoji.label,tags:this.emoji.tags})),s=[e,...t];return this.emojiContainer=this.viewFactory.create(z,{emojis:s,preview:!1}),super.renderSync({emojis:this.emojiContainer}),s.length`
    • -`),he=y("categoryTab","categoryTabActive","categoryButton");class fo extends l{constructor({category:e,icon:t}){super({template:yo,classes:he}),this.isActive=!1,this.category=e,this.icon=t}initialize(){this.uiElements={button:l.byClass(he.categoryButton)},this.uiEvents=[l.childEvent("button","click",this.selectCategory),l.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:i,performFocus:s,scroll:r}={changeFocusable:!0,performFocus:!0,scroll:!0,...t};this.el.classList.toggle(he.categoryTabActive,e),i&&(this.ui.button.tabIndex=e?0:-1,this.ui.button.ariaSelected=e.toString()),e&&s&&(this.ui.button.focus(),r&&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 vo=new p(({classes:o})=>` -
      -
        -
        -
      -
      -`),wo=y("categoryButtons","categoryButtonsContainer");class bo extends l{constructor({categories:e}){super({template:vo,classes:wo}),this.activeCategoryIndex=0,this.categories=e}initialize(){this.keyBindings={ArrowLeft:this.stepSelectedTab(-1),ArrowRight:this.stepSelectedTab(1)},this.uiEvents=[l.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(fo,{category:e,icon:K[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 i=this.currentTabView,s=this.tabViews[e];i.setActive(!1,t),s.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})}}}function Oo(o){}const Co=[{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 jo(){const o=Co.find(e=>_o(e.emoji));return(o==null?void 0:o.version)??1}function _o(o){const e=document.createElement("canvas").getContext("2d");if(e)return e.textBaseline="top",e.font="32px Arial",e.fillText(o,0,0),e.getImageData(16,16,1,1).data[0]!==0}function de(o,e){return Array.from({length:o},()=>e).join("")}function ko({showHeader:o,classes:e}){return o?` +`),ie=p("categoryTab","categoryTabActive","categoryButton");class ls extends l{constructor({category:e,icon:t}){super({template:cs,classes:ie}),this.isActive=!1,this.category=e,this.icon=t}initialize(){this.uiElements={button:l.byClass(ie.categoryButton)},this.uiEvents=[l.childEvent("button","click",this.selectCategory),l.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:s,performFocus:i,scroll:r}={changeFocusable:!0,performFocus:!0,scroll:!0,...t};this.el.classList.toggle(ie.categoryTabActive,e),s&&(this.ui.button.tabIndex=e?0:-1,this.ui.button.ariaSelected=e.toString()),e&&i&&(this.ui.button.focus(),r&&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 hs=new g(({classes:o})=>` +
        +
        +
      +`),ds=p("categoryButtons");class ms extends l{constructor({categories:e}){super({template:hs,classes:ds}),this.activeCategoryIndex=0,this.categories=e}initialize(){this.keyBindings={ArrowLeft:this.stepSelectedTab(-1),ArrowRight:this.stepSelectedTab(1)},super.initialize()}renderSync(){return this.tabViews=this.categories.map(e=>this.viewFactory.create(ls,{category:e,icon:H[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={}){if(e===this.activeCategoryIndex)return;const s=this.currentTabView,i=this.tabViews[e];s.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})}}}function Is(o){}const us=[{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 gs(){var e;const o=us.find(t=>ps(t.emoji));return(e=o==null?void 0:o.version)!=null?e:1}function ps(o){const e=document.createElement("canvas").getContext("2d");if(e)return e.textBaseline="top",e.font="32px Arial",e.fillText(o,0,0),e.getImageData(16,16,1,1).data[0]!==0}function re(o,e){return Array.from({length:o},()=>e).join("")}function fs({showHeader:o,classes:e}){return o?`
      - `:""}function Eo(o){const{classes:e,theme:t,className:i=""}=o;return` -
      - ${ko(o)} + `:""}function ys(o){const{classes:e,theme:t,className:s=""}=o;return` +
      + ${fs(o)}
      - `}function So(o){const{emojiCount:e,classes:t,theme:i,className:s,categoryCount:r}=o,a=({showSearch:g,classes:d})=>g?` + `}function vs(o){const{emojiCount:e,classes:t,theme:s,className:i}=o,r=({showSearch:m,classes:d})=>m?`
      - `:"",c=({showCategoryTabs:g,classes:d})=>g?` + `:"",a=({showCategoryTabs:m,classes:d})=>m?`
      - ${de(r,`
      `)} + ${re(10,`
      `)}
      - `:"",h=({showHeader:g,classes:d})=>g?` -
      + `:"",c=({showHeader:m,classes:d})=>m?` +
      + ${r(o)} ${a(o)} - ${c(o)}
      - `:"",u=({showPreview:g,classes:d})=>g?` + `:"",h=({showPreview:m,classes:d})=>m?`
        - ${de(3,`
      • `)} + ${re(3,`
      • `)}
      `:"";return` -
      - ${h(o)} +
      + ${c(o)}
      - ${de(e,`
      `)} + ${re(e,`
      `)}
      - ${u(o)} + ${h(o)}
      - `}const xo=new p(o=>o.isLoaded?Eo(o):So(o)),q=y("picker","skeleton","placeholder","searchSkeleton","searchInput","categoryTabsSkeleton","headerSkeleton","categoryTab","contentSkeleton","categoryName","emojiGrid","emoji","previewSkeleton","previewEmoji","previewName","tagList","tag","overlay","content","fullHeight","pluginContainer","header"),G={emojisPerRow:"--emojis-per-row",visibleRows:"--row-count",emojiSize:"--emoji-size"};class Je extends l{constructor(){super({template:xo,classes:q}),this.pickerReady=!1,this.externalEvents=new Dt,this.updaters={styleProperty:e=>t=>this.el.style.setProperty(G[e],t.toString()),theme:e=>{const t=this.options.theme,i=this.el.closest(`.${t}`);this.el.classList.remove(t),i==null||i.classList.remove(t),this.el.classList.add(e),i==null||i.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:l.byClass(q.content),header:l.byClass(q.header)},this.uiEvents=[l.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(),(e=this.search)==null||e.destroy(),this.emojiArea.destroy(),(t=this.categoryTabs)==null||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;e.key==="s"&&t&&this.search&&(e.preventDefault(),this.search.focus())}buildChildViews(){return this.options.showPreview&&(this.preview=this.viewFactory.create(lo)),this.options.showSearch&&(this.search=this.viewFactory.create(uo,{categories:this.categories,emojiVersion:this.emojiVersion})),this.options.showCategoryTabs&&(this.categoryTabs=this.viewFactory.create(bo,{categories:this.categories})),this.currentView=this.emojiArea=this.viewFactory.create(oo,{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(G).forEach(e=>{this.options[e]&&this.el.style.setProperty(G[e],this.options[e].toString())})}updateStyleProperty(e,t){this.el.style.setProperty(G[e],t.toString())}reinitialize(){this.renderSync()}onError(e){const t=this.viewFactory.create(ao,{message:this.i18n.get("error.load")}),i=this.el.offsetHeight||375;throw this.el.style.height=`${i}px`,j(this.el,t.renderSync()),e}async onDataReady(e){const t=this.el;try{e?this.emojiData=e:await this.emojiDataPromise,this.options.emojiVersion==="auto"?this.emojiVersion=jo()||parseFloat(m):this.emojiVersion=this.options.emojiVersion,this.categories=await this.emojiData.getCategories(this.options);const[i,s,r,a]=this.buildChildViews();await super.render({isLoaded:!0,search:s,categoryTabs:a,emojiArea:r,preview:i,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(i){this.events.emit("error",i)}}renderSync(){var t;let e=((t=this.options.categories)==null?void 0:t.length)||10;if(this.options.showRecents&&(e+=1),super.renderSync({isLoaded:!1,theme:this.options.theme,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:e}),this.el.style.setProperty("--category-count",e.toString()),!this.options.rootElement)throw new Error("Picker must be given a root element via the rootElement option");return j(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(this.options.autoFocusSearch===!0)return console.warn("options.autoFocusSearch is deprecated, please use options.focusTarget instead"),this.search}setInitialFocus(){var e;this.pickerReady&&((e=this.getInitialFocusTarget())==null||e.focus())}reset(e=!0){var t;this.pickerReady&&(this.emojiArea.reset(e),this.showContent(this.emojiArea)),(t=this.search)==null||t.clear(),this.hideVariantPopup()}showContent(e=this.emojiArea){var t,i;e!==this.currentView&&(this.currentView!==this.emojiArea&&((t=this.currentView)==null||t.destroy()),this.ui.pickerContent.classList.toggle(q.fullHeight,e!==this.emojiArea),j(this.ui.pickerContent,e.el),this.currentView=e,e===this.emojiArea?(this.emojiArea.reset(),this.categoryTabs&&this.ui.header.appendChild(this.categoryTabs.el)):(i=this.categoryTabs)==null||i.el.remove())}hideVariantPopup(){var e;(e=this.variantPopup)==null||e.destroy()}isPickerClick(e){var r,a;const t=e.target,i=this.el.contains(t),s=(a=(r=this.variantPopup)==null?void 0:r.el)==null?void 0:a.contains(t);return i||s}async selectEmoji({emoji:e}){var t,i;(t=e.skins)!=null&&t.length&&this.options.showVariants&&!this.isVariantPopupOpen?this.showVariantPopup(e):(await((i=this.variantPopup)==null?void 0:i.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",()=>{t==null||t.focus()}),this.variantPopup=this.viewFactory.create(go,{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 Po{constructor({events:e,i18n:t,renderer:i,emojiData:s,options:r,customEmojis:a=[],pickerId:c}){this.events=e,this.i18n=t,this.renderer=i,this.emojiData=s,this.options=r,this.customEmojis=a,this.pickerId=c}setEmojiData(e){this.emojiData=Promise.resolve(e)}create(e,...t){const i=new e(...t);return i.setPickerId(this.pickerId),i.setEvents(this.events),i.setI18n(this.i18n),i.setRenderer(this.renderer),i.setEmojiData(this.emojiData),i.setOptions(this.options),i.setCustomEmojis(this.customEmojis),i.viewFactory=this,i.initialize(),i}}class zo{constructor(e={}){b(this,V,void 0);W(this,V,new Map(Object.entries(e)))}get(e,t=e){return w(this,V).get(e)||t}}V=new WeakMap;function Fo(o,e){e===void 0&&(e={});var t=e.insertAt;if(!(!o||typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=o:s.appendChild(document.createTextNode(o))}}function Ze(){let o=!1;return function(t){Ne.injectStyles&&!o&&(Fo(t),o=!0)}}const Lo=`.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:""} -`;function $o(o){return ee(o.locale,o.dataStore,o.messages,o.emojiData)}let Ao=0;function Io(){return`picmo-${Date.now()}-${Ao++}`}const To=Ze();function Ro(o){To(Lo);const e=Be(o),t=((e==null?void 0:e.custom)||[]).map(h=>({...h,custom:!0,tags:["custom",...h.tags||[]]})),i=new Vt,s=$o(e),r=new zo(e.i18n);s.then(h=>{i.emit("data:ready",h)}).catch(h=>{i.emit("error",h)});const c=new Po({events:i,i18n:r,customEmojis:t,renderer:e.renderer,options:e,emojiData:s,pickerId:Io()}).create(Je);return c.renderSync(),c}const Mo=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:te,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"}));class Vo extends Ve{constructor(){super(sessionStorage)}}class Do extends se{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(i=>i.hexcode!==e.hexcode)].slice(0,t)}}async function Bo(o,e,t,i){(await ee(o,e,t,i)).close()}n.EmojiPicker=Je,n.Events=U,n.FocusTrap=$e,n.InMemoryProvider=Do,n.InMemoryStoreFactory=X,n.IndexedDbStoreFactory=ie,n.LocalStorageProvider=De,n.NativeRenderer=Me,n.RecentsProvider=se,n.Renderer=Re,n.SessionStorageProvider=Vo,n.animate=x,n.autoTheme=mt,n.caseInsensitiveIncludes=Y,n.computeHash=ke,n.createDatabase=Bo,n.createPicker=Ro,n.createStyleInjector=Ze,n.darkTheme=dt,n.debounce=_e,n.deleteDatabase=ht,n.empty=P,n.en=te,n.getEmojiForEvent=D,n.getOptions=Be,n.getPrefixedClasses=y,n.globalConfig=Ne,n.i18n=Mo,n.isLocalStorageAvailable=xe,n.isSessionStorageAvailable=Se,n.lightTheme=Ae,n.prefixClassName=N,n.replaceChildren=j,n.shouldAnimate=Z,n.throttle=je,n.toElement=B,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}); + `}const ws=new g(o=>o.isLoaded?ys(o):vs(o)),K=p("picker","skeleton","placeholder","searchSkeleton","searchInput","categoryTabsSkeleton","categoryTab","contentSkeleton","categoryName","emojiGrid","emoji","previewSkeleton","previewEmoji","previewName","tagList","tag","overlay","content","fullHeight","pluginContainer","header"),q={emojisPerRow:"--emojis-per-row",visibleRows:"--row-count",emojiSize:"--emoji-size"};class Oe extends l{constructor(){super({template:ws,classes:K}),this.pickerReady=!1,this.externalEvents=new At,this.updaters={styleProperty:e=>t=>this.el.style.setProperty(q[e],t.toString()),theme:e=>{this.el.classList.remove(this.options.theme),this.el.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:l.byClass(K.content),header:l.byClass(K.header)},this.uiEvents=[l.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(),(e=this.search)==null||e.destroy(),this.emojiArea.destroy(),(t=this.categoryTabs)==null||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;e.key==="s"&&t&&this.search&&(e.preventDefault(),this.search.focus())}buildChildViews(){return this.options.showPreview&&(this.preview=this.viewFactory.create(ss)),this.options.showSearch&&(this.search=this.viewFactory.create(rs,{categories:this.categories,emojiVersion:this.emojiVersion})),this.options.showCategoryTabs&&(this.categoryTabs=this.viewFactory.create(ms,{categories:this.categories})),this.currentView=this.emojiArea=this.viewFactory.create(Jt,{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(q).forEach(e=>{this.options[e]&&this.el.style.setProperty(q[e],this.options[e].toString())})}updateStyleProperty(e,t){this.el.style.setProperty(q[e],t.toString())}reinitialize(){this.renderSync()}onError(e){const t=this.viewFactory.create(Zt,{message:this.i18n.get("error.load")}),s=this.el.offsetHeight||375;throw this.el.style.height=`${s}px`,this.el.replaceChildren(t.renderSync()),e}async onDataReady(e){const t=this.el;try{e?this.emojiData=e:await this.emojiDataPromise,this.options.emojiVersion==="auto"?this.emojiVersion=gs()||parseFloat(u):this.emojiVersion=this.options.emojiVersion,this.categories=await this.emojiData.getCategories(this.options);const[s,i,r,a]=this.buildChildViews();await super.render({isLoaded:!0,search:i,categoryTabs:a,emojiArea:r,preview:s,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(s){this.events.emit("error",s)}}renderSync(){if(super.renderSync({isLoaded:!1,theme:this.options.theme,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}),!this.options.rootElement)throw new Error("Picker must be given a root element via the rootElement option");return this.options.rootElement.replaceChildren(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(this.options.autoFocusSearch===!0)return console.warn("options.autoFocusSearch is deprecated, please use options.focusTarget instead"),this.search}setInitialFocus(){var e;!this.pickerReady||(e=this.getInitialFocusTarget())==null||e.focus()}reset(){var e;this.pickerReady&&(this.emojiArea.reset(),this.showContent(this.emojiArea)),(e=this.search)==null||e.clear(),this.hideVariantPopup()}showContent(e=this.emojiArea){var t,s;e!==this.currentView&&(this.currentView!==this.emojiArea&&((t=this.currentView)==null||t.destroy()),this.ui.pickerContent.classList.toggle(K.fullHeight,e!==this.emojiArea),this.ui.pickerContent.replaceChildren(e.el),this.currentView=e,e===this.emojiArea?(this.emojiArea.reset(),this.categoryTabs&&this.ui.header.appendChild(this.categoryTabs.el)):(s=this.categoryTabs)==null||s.el.remove())}hideVariantPopup(){var e;(e=this.variantPopup)==null||e.destroy()}isPickerClick(e){var r,a;const t=e.target,s=this.el.contains(t),i=(a=(r=this.variantPopup)==null?void 0:r.el)==null?void 0:a.contains(t);return s||i}async selectEmoji({emoji:e}){var t,s;((t=e.skins)==null?void 0:t.length)&&this.options.showVariants&&!this.isVariantPopupOpen?this.showVariantPopup(e):(await((s=this.variantPopup)==null?void 0:s.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",()=>{t==null||t.focus()}),this.variantPopup=this.viewFactory.create(ns,{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 bs{constructor({events:e,i18n:t,renderer:s,emojiData:i,options:r,customEmojis:a=[],pickerId:c}){this.events=e,this.i18n=t,this.renderer=s,this.emojiData=i,this.options=r,this.customEmojis=a,this.pickerId=c}setEmojiData(e){this.emojiData=Promise.resolve(e)}create(e,...t){const s=new e(...t);return s.setPickerId(this.pickerId),s.setEvents(this.events),s.setI18n(this.i18n),s.setRenderer(this.renderer),s.setEmojiData(this.emojiData),s.setOptions(this.options),s.setCustomEmojis(this.customEmojis),s.viewFactory=this,s.initialize(),s}}class Cs{constructor(e={}){w(this,V,void 0);G(this,V,new Map(Object.entries(e)))}get(e,t=e){return v(this,V).get(e)||t}}V=new WeakMap;function js(o,e){e===void 0&&(e={});var t=e.insertAt;if(!(!o||typeof document>"u")){var s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t==="top"&&s.firstChild?s.insertBefore(i,s.firstChild):s.appendChild(i),i.styleSheet?i.styleSheet.cssText=o:i.appendChild(document.createTextNode(o))}}function Ue(){let o=!1;return function(t){Te.injectStyles&&!o&&(js(t),o=!0)}}const ks=`.picmo-picker .icon{width:1.25em;height:1em;fill:currentColor}.icon-small{font-size:.8em}.icon-medium{font-size:1em}.icon-large{font-size:1.25em}.icon-2x{font-size:2em}.icon-3x{font-size:3em}.icon-4x{font-size:4em}.icon-5x{font-size:5em}.icon-8x{font-size:8em}.icon-10x{font-size:10em}.light,.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;--preview-background-color: var(--secondary-background-color);--scrollbar-background-color: var(--background-color);--scrollbar-color: rgba(0, 0, 0, .75);--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}.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){.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 .categoryButtons{--tab-size-ratio: 1.55;--tab-padding: .5em;--tab-area-width: calc(var(--picker-width) - (var(--tab-padding) * 2));--tab-size: calc((var(--tab-area-width) / var(--category-count))) / var(--tab-size-ratio);display:grid;grid-auto-columns:1fr;grid-auto-flow:column;gap:var(--tab-gap);justify-content:center;margin:0;padding:0 var(--tab-padding);align-items:center;height:var(--category-tabs-height);box-sizing:border-box;position:relative;list-style-type:none}.picmo-picker .categoryButtons .categoryTab{display:flex;align-items:center;justify-content:stretch;transition:all .1s}.picmo-picker .categoryButtons .categoryTab.categoryTabActive .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 .categoryButtons .categoryTab.categoryTabActive .categoryButton:hover{background-color:var(--category-tab-active-background-color)}.picmo-picker .categoryButtons .categoryTab button.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;font-size:min(var(--tab-size),1.2rem);width:1.6em;height:1.6em;transition:all .1s}.picmo-picker .categoryButtons .categoryTab button.categoryButton:is(img){width:var(--category-tab-size);height:var(--category-tab-size)}.picmo-picker .categoryButtons .categoryTab button.categoryButton:hover{background:var(--category-tab-highlight-background-color)}.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 .error{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--secondary-text-color)}.picmo-picker .error .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 .error .title{animation:appear .25s;animation-delay:50ms;animation-fill-mode:both}.picmo-picker .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 .error button:hover{background:var(--text-color);color:var(--background-color)}.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%}.emojiButton:hover{background:var(--hover-background-color)}.emojiButton:focus{border-radius:0;background:var(--focus-indicator-background-color);outline:1px soldi var(--focus-indicator-color)}.picmo-picker .emojiArea{height:var(--emoji-area-height);overflow-y:auto;position:relative;scrollbar-color:var(--scrollbar-color) var(--scrollbar-background-color);scrollbar-width:thin}.picmo-picker .emojiArea::-webkit-scrollbar{background:var(--scrollbar-background-color);width:1.1em}.picmo-picker .emojiArea::-webkit-scrollbar-thumb{background:var(--scrollbar-color);border-left:4px solid transparent;border-right:4px solid transparent;background-clip:padding-box;height:1em;border-radius:1em}.picmo-picker .emojiCategory{position:relative}.picmo-picker .emojiCategory .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 .emojiCategory .categoryName button{background:transparent;border:none;display:flex;align-items:center;cursor:pointer;color:var(--category-name-button-color)}.picmo-picker .emojiCategory .categoryName button:hover{opacity:1}.picmo-picker .emojiCategory .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 .emojiCategory .recentEmojis[data-empty=true]{display:none}:is(.picmo-picker .emojiCategory) .recentEmojis[data-empty=false]+div{display:none}.picmo-picker .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.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);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.picker>*{font-family:var(--ui-font)}.picmo-picker.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.skeleton *{box-sizing:border-box}.picmo-picker.skeleton .placeholder{background:var(--placeholder-background-color);position:relative;overflow:hidden}.picmo-picker.skeleton .placeholder:after{position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background-image:linear-gradient(90deg,rgba(#fff,0) 0,rgba(#fff,.2) 20%,rgba(#fff,.5) 60%,rgba(#fff,0));animation:shine 2s infinite;content:""}.picmo-picker.skeleton .searchSkeleton{padding:0 8px;height:var(--search-height)}.picmo-picker.skeleton .searchSkeleton .searchInput{width:100%;height:28px;border-radius:3px}.picmo-picker.skeleton .categoryTabsSkeleton{height:var(--category-tabs-height);display:flex;flex-direction:row;justify-content:space-around;align-items:center}.picmo-picker.skeleton .categoryTabsSkeleton .categoryTab{width:25px;height:25px;padding:2px;border-radius:5px}.picmo-picker.skeleton .contentSkeleton{height:var(--content-height);padding-right:8px;opacity:.7}.picmo-picker.skeleton .contentSkeleton .categoryName{width:50%;height:1rem;margin:.5rem;box-sizing:border-box}.picmo-picker.skeleton .contentSkeleton .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}.picmo-picker.skeleton .contentSkeleton .emojiGrid .emoji{width:var(--emoji-size);height:var(--emoji-size);border-radius:50%}.picmo-picker.skeleton .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.skeleton .previewSkeleton .previewEmoji{grid-area:emoji;border-radius:50%;width:var(--emoji-preview-size);height:var(--emoji-preview-size)}.picmo-picker.skeleton .previewSkeleton .previewName{grid-area:name;width:12em;height:.8em}.picmo-picker.skeleton .previewSkeleton .tagList{grid-area:tags;list-style-type:none;display:flex;flex-direction:row;padding:0;margin:0}.picmo-picker.skeleton .previewSkeleton .tagList .tag{border-radius:3px;padding:2px 8px;margin-right:.25em;height:1em;width:3em}.overlay{background:rgba(0,0,0,.75);height:100%;left:0;position:fixed;top:0;width:100%;z-index:1000}.content{position:relative;overflow:hidden;height:var(--content-height)}.content.fullHeight{height:calc(var(--content-height) + var(--category-tabs-height) + var(--category-tabs-offset));overflow-y:auto;scrollbar-color:var(--scrollbar-color) var(--scrollbar-background-color);scrollbar-width:thin}.content.fullHeight::-webkit-scrollbar{background:var(--scrollbar-background-color);width:1.1em}.content.fullHeight::-webkit-scrollbar-thumb{background:var(--scrollbar-color);border-left:4px solid transparent;border-right:4px solid transparent;background-clip:padding-box;height:1em;border-radius:1em}.pluginContainer{margin:.5em;display:flex;flex-direction:row}.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){.placeholder{background:var(--placeholder-background-color);position:relative;overflow:hidden}.placeholder:after{display:none}}.picmo-picker .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 .preview .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 .preview .previewName{grid-area:name;color:var(--text-color);font-size:.8em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500}.picmo-picker .preview .tagList{grid-area:tags;list-style-type:none;display:flex;flex-direction:row;padding:0;margin:0;font-size:.75em;overflow:hidden}.picmo-picker .preview .tag{border-radius:3px;background:var(--tag-background-color);color:var(--text-color);padding:2px 8px;margin-right:.25em;white-space:nowrap}.picmo-picker .preview .tag:last-child{margin-right:0}.picmo-picker .searchContainer{display:flex;height:var(--search-height);box-sizing:border-box;padding:0 8px;position:relative}.picmo-picker .searchContainer .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 .searchContainer .searchField:focus{background:var(--search-focus-background-color)}.picmo-picker .searchContainer .searchField::placeholder{color:var(--search-placeholder-color)}.picmo-picker .searchContainer .searchAccessory{color:var(--search-icon-color);height:100%;position:absolute;right:1em;top:0;width:1.25rem;display:flex;align-items:center}.picmo-picker .searchContainer .searchAccessory svg{fill:var(--search-icon-color)}.picmo-picker .searchContainer .clearButton{border:0;color:var(--search-icon-color);background:transparent;cursor:pointer}.picmo-picker .searchContainer .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 .searchContainer .notFound [data-icon]{fill:#f3e265}.picmo-picker .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 .variantOverlay .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}.customEmoji{width:1em;height:1em}@keyframes shine{to{transform:translate(100%)}}.picmo-picker .imagePlaceholder{width:2rem;height:2rem;border-radius:50%}.placeholder{background:#DDDBDD;position:relative}.placeholder:after{position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background-image:linear-gradient(90deg,rgba(#fff,0) 0,rgba(#fff,.2) 20%,rgba(#fff,.5) 60%,rgba(#fff,0));animation:shine 2s infinite;content:""} +`;function Es(o){return Y(o.locale,o.dataStore,o.messages,o.emojiData)}let xs=0;function Ss(){return`picmo-${Date.now()}-${xs++}`}const Ps=Ue();function zs(o){Ps(ks);const e=Ie(o),t=((e==null?void 0:e.custom)||[]).map(h=>({...h,custom:!0,tags:["custom",...h.tags||[]]})),s=new Lt,i=Es(e),r=new Cs(e.i18n);i.then(h=>{s.emit("data:ready",h)}).catch(h=>{s.emit("error",h)});const c=new bs({events:s,i18n:r,customEmojis:t,renderer:e.renderer,options:e,emojiData:i,pickerId:Ss()}).create(Oe);return c.renderSync(),c}const ae={};function Ke(o){return ae[o]||(ae[o]=new $s(o)),ae[o]}Ke.deleteDatabase=o=>{};class $s extends $e{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 s;let t=this.categories.filter(i=>i.key!=="component");if(e.showRecents&&t.unshift({key:"recents",order:-1}),(s=e.custom)!=null&&s.length&&t.push({key:"custom",order:10}),e.categories){const i=e.categories;t=t.filter(r=>i.includes(r.key)),t.sort((r,a)=>i.indexOf(r.key)-i.indexOf(a.key))}else t.sort((i,r)=>i.order-r.order);return Promise.resolve(t)}getEmojis(e,t){const s=this.emojis.filter(i=>i.group===e.order).filter(i=>i.version<=t).sort((i,r)=>i.order!=null&&r.order!=null?i.order-r.order:0).map(P);return Promise.resolve(N(s,t))}searchEmojis(e,t,s,i){const r=this.emojis.filter(h=>O(h,e,i)).map(P),a=t.filter(h=>O(h,e,i)),c=[...N(r,s),...a];return Promise.resolve(c)}setMeta(e){this.meta=e}}class Fs extends Le{constructor(){super(sessionStorage)}}async function Ls(o,e,t,s){(await Y(o,e,t,s)).close()}n.EmojiPicker=Oe,n.Events=U,n.FocusTrap=je,n.InMemoryStoreFactory=Ke,n.IndexedDbStoreFactory=X,n.LocalStorageProvider=Ae,n.NativeRenderer=Pe,n.RecentsProvider=Fe,n.Renderer=Se,n.SessionStorageProvider=Fs,n.animate=S,n.autoTheme=ot,n.caseInsensitiveIncludes=J,n.computeHash=we,n.createDatabase=Ls,n.createPicker=zs,n.createStyleInjector=Ue,n.darkTheme=st,n.debounce=ve,n.deleteDatabase=tt,n.en=ze,n.getEmojiForEvent=M,n.getOptions=Ie,n.getPrefixedClasses=p,n.globalConfig=Te,n.lightTheme=ke,n.prefixClassName=B,n.shouldAnimate=W,n.throttle=ye,n.toElement=D,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); diff --git a/th_chat/template/big.htm b/th_chat/template/big.htm index da26e42..279ea9f 100644 --- a/th_chat/template/big.htm +++ b/th_chat/template/big.htm @@ -5,7 +5,7 @@ © 2th Chat
      - + diff --git a/th_chat/template/discuz.htm b/th_chat/template/discuz.htm index 656284e..4a66580 100644 --- a/th_chat/template/discuz.htm +++ b/th_chat/template/discuz.htm @@ -5,7 +5,7 @@ © 2th Chat
      - +