diff --git a/dist/emoji-mart.js b/dist/emoji-mart.js index cf17fbb..635c0ca 100644 --- a/dist/emoji-mart.js +++ b/dist/emoji-mart.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.EmojiMart=t():e.EmojiMart=t()}("undefined"!=typeof self?self:this,(function(){return function(){var e={661:function(){"undefined"!=typeof window&&function(){for(var e=0,t=["ms","moz","webkit","o"],i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}(Object.getOwnPropertyNames(e));try{for(i.s();!(t=i.n()).done;){var n=t.value,r=e[n];e[n]=r&&"object"===u(r)?d(r):r}}catch(e){i.e(e)}finally{i.f()}return Object.freeze(e)}var f,p,v=function(e){if(!e.compressed)return e;for(var t in e.compressed=!1,e.emojis){var i=e.emojis[t];for(var n in h)i[n]=i[h[n]],delete i[h[n]];i.short_names||(i.short_names=[]),i.short_names.unshift(t),i.sheet_x=i.sheet[0],i.sheet_y=i.sheet[1],delete i.sheet,i.text||(i.text=""),i.added_in||(i.added_in=6),i.added_in=i.added_in.toFixed(1),i.search=m(i)}return d(e)},j=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","hankey"],y={};function g(){p=!0,f=c.get("frequently")}var w={add:function(e){p||g();var t=e.id;f||(f=y),f[t]||(f[t]=0),f[t]+=1,c.set("last",t),c.set("frequently",f)},get:function(e){if(p||g(),!f){y={};for(var t=[],i=Math.min(e,j.length),n=0;n',custom:'',flags:'',foods:'',nature:'',objects:'',smileys:'',people:' ',places:'',recent:'',symbols:''};function C(e,t,i,n,r,o,s,a){var c,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=i,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},u._ssrRegister=c):r&&(c=a?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(e,t){return c.call(t),l(e,t)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,c):[c]}return{exports:e,options:u}}var b=C({props:{i18n:{type:Object,required:!0},color:{type:String},categories:{type:Array,required:!0},activeCategory:{type:Object,default:function(){return{}}}},created:function(){this.svgs=_}},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"emoji-mart-anchors",attrs:{role:"tablist"}},e._l(e.categories,(function(t){return i("button",{key:t.id,class:{"emoji-mart-anchor":!0,"emoji-mart-anchor-selected":t.id==e.activeCategory.id},style:{color:t.id==e.activeCategory.id?e.color:""},attrs:{role:"tab",type:"button","aria-label":t.name,"aria-selected":t.id==e.activeCategory.id,"data-title":e.i18n.categories[t.id]},on:{click:function(i){return e.$emit("click",t)}}},[i("div",{attrs:{"aria-hidden":"true"},domProps:{innerHTML:e._s(e.svgs[t.id])}}),e._v(" "),i("span",{staticClass:"emoji-mart-anchor-bar",style:{backgroundColor:e.color},attrs:{"aria-hidden":"true"}})])})),0)}),[],!1,null,null,null),k=b.exports;function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){for(var i=0;i1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?i.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,i.push(e,t)),(n+1===r||i.length>16384)&&(o+=String.fromCharCode.apply(null,i),i.length=0)}return o};function P(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return O.apply(null,t)}function A(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function M(e,t){var i=A(e),n=A(t);return i.filter((function(e){return n.indexOf(e)>=0}))}function I(e,t){var i={};for(var n in e){var r=e[n],o=r;t.hasOwnProperty(n)&&(o=t[n]),"object"===u(o)&&(o=I(r,o)),i[n]=o}return i}function F(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return z(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?z(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i1&&void 0!==arguments[1]?arguments[1]:{},n=i.emojisToShowFilter,r=i.include,o=i.exclude,s=i.custom,a=i.recent,c=i.recentLength,u=void 0===c?20:c;E(this,e),this._data=v(t),this._emojisFilter=n||null,this._include=r||null,this._exclude=o||null,this._custom=s||[],this._recent=a||w.get(u),this._emojis={},this._nativeEmojis={},this._emoticons={},this._categories=[],this._recentCategory={id:"recent",name:"Recent",emojis:[]},this._customCategory={id:"custom",name:"Custom",emojis:[]},this._searchIndex={},this.buildIndex(),Object.freeze(this)}return x(e,[{key:"buildIndex",value:function(){var e=this,t=this._data.categories;if(this._include&&(t=(t=t.filter((function(t){return e._include.includes(t.id)}))).sort((function(t,i){var n=e._include.indexOf(t.id),r=e._include.indexOf(i.id);return nr?1:0}))),t.forEach((function(t){if(e.isCategoryNeeded(t.id)){var i={id:t.id,name:t.name,emojis:[]};t.emojis.forEach((function(t){var n=e.addEmoji(t);n&&i.emojis.push(n)})),i.emojis.length&&e._categories.push(i)}})),this.isCategoryNeeded("custom")){if(this._custom.length>0){var i,n=F(this._custom);try{for(n.s();!(i=n.n()).done;){var r=i.value;this.addCustomEmoji(r)}}catch(e){n.e(e)}finally{n.f()}}this._customCategory.emojis.length&&this._categories.push(this._customCategory)}this.isCategoryNeeded("recent")&&(this._recent.length&&this._recent.map((function(t){var i,n=F(e._customCategory.emojis);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(r.id===t)return void e._recentCategory.emojis.push(r)}}catch(e){n.e(e)}finally{n.f()}e.hasEmoji(t)&&e._recentCategory.emojis.push(e.emoji(t))})),this._recentCategory.emojis.length&&this._categories.unshift(this._recentCategory))}},{key:"findEmoji",value:function(e,t){var i=e.match(L);if(i&&(e=i[1],i[2]&&(t=parseInt(i[2],10))),this._data.aliases.hasOwnProperty(e)&&(e=this._data.aliases[e]),this._emojis.hasOwnProperty(e)){var n=this._emojis[e];return t?n.getSkin(t):n}return this._nativeEmojis.hasOwnProperty(e)?this._nativeEmojis[e]:null}},{key:"categories",value:function(){return this._categories}},{key:"emoji",value:function(e){this._data.aliases.hasOwnProperty(e)&&(e=this._data.aliases[e]);var t=this._emojis[e];if(!t)throw new Error("Can not find emoji by id: "+e);return t}},{key:"firstEmoji",value:function(){var e=this._emojis[Object.keys(this._emojis)[0]];if(!e)throw new Error("Can not get first emoji");return e}},{key:"hasEmoji",value:function(e){return this._data.aliases.hasOwnProperty(e)&&(e=this._data.aliases[e]),!!this._emojis[e]}},{key:"nativeEmoji",value:function(e){return this._nativeEmojis.hasOwnProperty(e)?this._nativeEmojis[e]:null}},{key:"search",value:function(e,t){var i=this;if(t||(t=75),!e.length)return null;if("-"==e||"-1"==e)return[this.emoji("-1")];var n,r=e.toLowerCase().split(/[\s|,|\-|_]+/);r.length>2&&(r=[r[0],r[1]]),n=r.map((function(e){for(var t=i._emojis,n=i._searchIndex,r=0,o=0;o1?M.apply(null,n):n.length?n[0]:[])&&o.length>t&&(o=o.slice(0,t)),o}},{key:"addCustomEmoji",value:function(e){var t=Object.assign({},e,{id:e.short_names[0],custom:!0});t.search||(t.search=m(t));var i=new $(t);return this._emojis[i.id]=i,this._customCategory.emojis.push(i),i}},{key:"addEmoji",value:function(e){var t=this,i=this._data.emojis[e];if(!this.isEmojiNeeded(i))return!1;var n=new $(i);if(this._emojis[e]=n,n.native&&(this._nativeEmojis[n.native]=n),n._skins)for(var r in n._skins){var o=n._skins[r];o.native&&(this._nativeEmojis[o.native]=o)}return n.emoticons&&n.emoticons.forEach((function(i){t._emoticons[i]||(t._emoticons[i]=e)})),n}},{key:"isCategoryNeeded",value:function(e){var t=!this._include||!this._include.length||this._include.indexOf(e)>-1,i=!(!this._exclude||!this._exclude.length)&&this._exclude.indexOf(e)>-1;return!(!t||i)}},{key:"isEmojiNeeded",value:function(e){return!this._emojisFilter||this._emojisFilter(e)}}]),e}(),$=function(){function e(t){if(E(this,e),this._data=Object.assign({},t),this._skins=null,this._data.skin_variations)for(var i in this._skins=[],T){var n=T[i],r=this._data.skin_variations[n],o=Object.assign({},t);for(var s in r)o[s]=r[s];delete o.skin_variations,o.skin_tone=parseInt(i)+1,this._skins.push(new e(o))}for(var a in this._sanitized=N(this._data),this._sanitized)this[a]=this._sanitized[a];this.short_names=this._data.short_names,this.short_name=this._data.short_names[0],Object.freeze(this)}return x(e,[{key:"getSkin",value:function(e){return e&&"native"!=e&&this._skins?this._skins[e-1]:this}},{key:"getPosition",value:function(){var e=+(100/60*this._data.sheet_x).toFixed(2),t=+(100/60*this._data.sheet_y).toFixed(2);return"".concat(e,"% ").concat(t,"%")}},{key:"ariaLabel",value:function(){return[this.native].concat(this.short_names).filter(Boolean).join(", ")}}]),e}(),R=function(){function e(t,i,n,r,o,s,a){E(this,e),this._emoji=t,this._native=r,this._skin=i,this._set=n,this._fallback=o,this.canRender=this._canRender(),this.cssClass=this._cssClass(),this.cssStyle=this._cssStyle(a),this.content=this._content(),this.title=!0===s?t.short_name:null,this.ariaLabel=t.ariaLabel(),Object.freeze(this)}return x(e,[{key:"getEmoji",value:function(){return this._emoji.getSkin(this._skin)}},{key:"_canRender",value:function(){return this._isCustom()||this._isNative()||this._hasEmoji()||this._fallback}},{key:"_cssClass",value:function(){return["emoji-set-"+this._set,"emoji-type-"+this._emojiType()]}},{key:"_cssStyle",value:function(e){var t={};return this._isCustom()?t={backgroundImage:"url("+this.getEmoji()._data.imageUrl+")",backgroundSize:"100%",width:e+"px",height:e+"px"}:this._hasEmoji()&&!this._isNative()&&(t={backgroundPosition:this.getEmoji().getPosition()}),e&&(t=this._isNative()?Object.assign(t,{fontSize:Math.round(.95*e*10)/10+"px"}):Object.assign(t,{width:e+"px",height:e+"px"})),t}},{key:"_content",value:function(){return this._isCustom()?"":this._isNative()?this.getEmoji().native:this._hasEmoji()?"":this._fallback?this._fallback(this.getEmoji()):null}},{key:"_isNative",value:function(){return this._native}},{key:"_isCustom",value:function(){return this.getEmoji().custom}},{key:"_hasEmoji",value:function(){if(!this.getEmoji()._data)return!1;var e=this.getEmoji()._data["has_img_"+this._set];return void 0===e||e}},{key:"_emojiType",value:function(){return this._isCustom()?"custom":this._isNative()?"native":this._hasEmoji()?"image":"fallback"}}]),e}();function N(e){var t=e.name,i=e.short_names,n=e.skin_tone,r=e.skin_variations,o=e.emoticons,s=e.unified,a=e.custom,c=e.imageUrl,u=e.id||i[0],l=":".concat(u,":");return a?{id:u,name:t,colons:l,emoticons:o,custom:a,imageUrl:c}:(n&&(l+=":skin-tone-".concat(n,":")),{id:u,name:t,colons:l,emoticons:o,unified:s.toLowerCase(),skin:n||(r?1:null),native:P(s)})}function D(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var B={native:{type:Boolean,default:!1},tooltip:{type:Boolean,default:!1},fallback:{type:Function},skin:{type:Number,default:1},set:{type:String,default:"apple"},emoji:{type:[String,Object],required:!0},size:{type:Number,default:null},tag:{type:String,default:"span"}},H={perLine:{type:Number,default:9},maxSearchResults:{type:Number,default:75},emojiSize:{type:Number,default:24},title:{type:String,default:"Emoji Martâ„¢"},emoji:{type:String,default:"department_store"},color:{type:String,default:"#ae65c5"},set:{type:String,default:"apple"},skin:{type:Number,default:null},defaultSkin:{type:Number,default:1},native:{type:Boolean,default:!1},emojiTooltip:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},i18n:{type:Object,default:function(){return{}}},showPreview:{type:Boolean,default:!0},showSearch:{type:Boolean,default:!0},showCategories:{type:Boolean,default:!0},showSkinTones:{type:Boolean,default:!0},infiniteScroll:{type:Boolean,default:!0},pickerStyles:{type:Object,default:function(){return{}}}};function U(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function V(e){for(var t=1;t0},emojiObjects:function(){var e=this;return this.emojis.map((function(t){return{emojiObject:t,emojiView:new R(t,e.emojiProps.skin,e.emojiProps.set,e.emojiProps.native,e.emojiProps.fallback,e.emojiProps.emojiTooltip,e.emojiProps.emojiSize)}}))}},components:{Emoji:W}},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.isVisible&&(e.isSearch||e.hasResults)?i("section",{class:{"emoji-mart-category":!0,"emoji-mart-no-results":!e.hasResults},attrs:{"aria-label":e.i18n.categories[e.id]}},[i("div",{staticClass:"emoji-mart-category-label"},[i("h3",{staticClass:"emoji-mart-category-label"},[e._v(e._s(e.i18n.categories[e.id]))])]),e._v(" "),e._l(e.emojiObjects,(function(t){var n=t.emojiObject,r=t.emojiView;return[r.canRender?i("button",{key:n.id,staticClass:"emoji-mart-emoji",class:e.activeClass(n),attrs:{"aria-label":r.ariaLabel,role:"option","aria-selected":"false","aria-posinset":"1","aria-setsize":"1812",type:"button","data-title":n.short_name,title:r.title},on:{mouseenter:function(t){e.emojiProps.onEnter(r.getEmoji())},mouseleave:function(t){e.emojiProps.onLeave(r.getEmoji())},click:function(t){e.emojiProps.onClick(r.getEmoji())}}},[i("span",{class:r.cssClass,style:r.cssStyle},[e._v(e._s(r.content))])]):e._e()]})),e._v(" "),e.hasResults?e._e():i("div",[i("emoji",{attrs:{data:e.data,emoji:"sleuth_or_spy",native:e.emojiProps.native,skin:e.emojiProps.skin,set:e.emojiProps.set}}),e._v(" "),i("div",{staticClass:"emoji-mart-no-results-label"},[e._v(e._s(e.i18n.notfound))])],1)],2):e._e()}),[],!1,null,null,null).exports,X=C({props:{skin:{type:Number,required:!0}},data:function(){return{opened:!1}},methods:{onClick:function(e){this.opened&&e!=this.skin&&this.$emit("change",e),this.opened=!this.opened}}},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:{"emoji-mart-skin-swatches":!0,"emoji-mart-skin-swatches-opened":e.opened}},e._l(6,(function(t){return i("span",{key:t,class:{"emoji-mart-skin-swatch":!0,"emoji-mart-skin-swatch-selected":e.skin==t}},[i("span",{class:"emoji-mart-skin emoji-mart-skin-tone-"+t,on:{click:function(i){return e.onClick(t)}}})])})),0)}),[],!1,null,null,null).exports,Z=C({props:{data:{type:Object,required:!0},title:{type:String,required:!0},emoji:{type:[String,Object]},idleEmoji:{type:[String,Object],required:!0},showSkinTones:{type:Boolean,default:!0},emojiProps:{type:Object,required:!0},skinProps:{type:Object,required:!0},onSkinChange:{type:Function,required:!0}},computed:{emojiData:function(){return this.emoji?this.emoji:{}},emojiShortNames:function(){return this.emojiData.short_names},emojiEmoticons:function(){return this.emojiData.emoticons}},components:{Emoji:W,Skins:X}},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"emoji-mart-preview"},[e.emoji?[i("div",{staticClass:"emoji-mart-preview-emoji"},[i("emoji",{attrs:{data:e.data,emoji:e.emoji,native:e.emojiProps.native,skin:e.emojiProps.skin,set:e.emojiProps.set}})],1),e._v(" "),i("div",{staticClass:"emoji-mart-preview-data"},[i("div",{staticClass:"emoji-mart-preview-name"},[e._v(e._s(e.emoji.name))]),e._v(" "),i("div",{staticClass:"emoji-mart-preview-shortnames"},e._l(e.emojiShortNames,(function(t){return i("span",{key:t,staticClass:"emoji-mart-preview-shortname"},[e._v(":"+e._s(t)+":")])})),0),e._v(" "),i("div",{staticClass:"emoji-mart-preview-emoticons"},e._l(e.emojiEmoticons,(function(t){return i("span",{key:t,staticClass:"emoji-mart-preview-emoticon"},[e._v(e._s(t))])})),0)])]:[i("div",{staticClass:"emoji-mart-preview-emoji"},[i("emoji",{attrs:{data:e.data,emoji:e.idleEmoji,native:e.emojiProps.native,skin:e.emojiProps.skin,set:e.emojiProps.set}})],1),e._v(" "),i("div",{staticClass:"emoji-mart-preview-data"},[i("span",{staticClass:"emoji-mart-title-label"},[e._v(e._s(e.title))])]),e._v(" "),e.showSkinTones?i("div",{staticClass:"emoji-mart-preview-skins"},[i("skins",{attrs:{skin:e.skinProps.skin},on:{change:function(t){return e.onSkinChange(t)}}})],1):e._e()]],2)}),[],!1,null,null,null).exports,G=C({props:{data:{type:Object,required:!0},i18n:{type:Object,required:!0},autoFocus:{type:Boolean,default:!1},onSearch:{type:Function,required:!0},onArrowLeft:{type:Function,required:!1},onArrowRight:{type:Function,required:!1},onArrowDown:{type:Function,required:!1},onArrowUp:{type:Function,required:!1},onEnter:{type:Function,required:!1}},data:function(){return{value:""}},computed:{emojiIndex:function(){return this.data}},watch:{value:function(){this.$emit("search",this.value)}},methods:{clear:function(){this.value=""}},mounted:function(){var e=this.$el.querySelector("input");this.autoFocus&&e.focus()}},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"emoji-mart-search"},[i("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],attrs:{type:"text",placeholder:e.i18n.search,role:"textbox","aria-autocomplete":"list","aria-owns":"emoji-mart-list","aria-label":"Search for an emoji","aria-describedby":"emoji-mart-search-description"},domProps:{value:e.value},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:function(t){return e.$emit("arrowLeft",t)}.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"right",39,t.key,["Right","ArrowRight"])||"button"in t&&2!==t.button?null:function(){return e.$emit("arrowRight")}.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:function(){return e.$emit("arrowDown")}.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:function(t){return e.$emit("arrowUp",t)}.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:function(){return e.$emit("enter")}.apply(null,arguments)}],input:function(t){t.target.composing||(e.value=t.target.value)}}}),e._v(" "),i("span",{staticClass:"hidden",attrs:{id:"emoji-picker-search-description"}},[e._v("Use the left, right, up and down arrow keys to navigate the emoji search\n results.")])])}),[],!1,null,null,null),K=G.exports;function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i0})),this._categories[0].first=!0,Object.freeze(this._categories),this.activeCategory=this._categories[0],this.searchEmojis=null,this.previewEmoji=null,this.previewEmojiCategoryIdx=0,this.previewEmojiIdx=-1}return x(e,[{key:"onScroll",value:function(){for(var e=this._vm.$refs.scroll.scrollTop,t=this.filteredCategories[0],i=0,n=this.filteredCategories.length;ie)break;t=r}this.activeCategory=t}},{key:"allCategories",get:function(){return this._categories}},{key:"filteredCategories",get:function(){return this.searchEmojis?[{id:"search",name:"Search",emojis:this.searchEmojis}]:this._categories.filter((function(e){return e.emojis.length>0}))}},{key:"previewEmojiCategory",get:function(){return this.previewEmojiCategoryIdx>=0?this.filteredCategories[this.previewEmojiCategoryIdx]:null}},{key:"onAnchorClick",value:function(e){var t=this;if(!this.searchEmojis){var i=this.filteredCategories.indexOf(e),n=this._vm.getCategoryComponent(i);this._vm.infiniteScroll?function(){if(n){var i=n.$el.offsetTop;e.first&&(i=0),t._vm.$refs.scroll.scrollTop=i}}():this.activeCategory=this.filteredCategories[i]}}},{key:"onSearch",value:function(e){var t=this._data.search(e,this.maxSearchResults);this.searchEmojis=t,this.previewEmojiCategoryIdx=0,this.previewEmojiIdx=0,this.updatePreviewEmoji()}},{key:"onEmojiEnter",value:function(e){this.previewEmoji=e,this.previewEmojiIdx=-1,this.previewEmojiCategoryIdx=-1}},{key:"onEmojiLeave",value:function(e){this.previewEmoji=null}},{key:"onArrowLeft",value:function(){this.previewEmojiIdx>0?this.previewEmojiIdx-=1:(this.previewEmojiCategoryIdx-=1,this.previewEmojiCategoryIdx<0?this.previewEmojiCategoryIdx=0:this.previewEmojiIdx=this.filteredCategories[this.previewEmojiCategoryIdx].emojis.length-1),this.updatePreviewEmoji()}},{key:"onArrowRight",value:function(){this.previewEmojiIdx=this.filteredCategories.length?this.previewEmojiCategoryIdx=this.filteredCategories.length-1:this.previewEmojiIdx=0),this.updatePreviewEmoji()}},{key:"onArrowDown",value:function(){if(-1==this.previewEmojiIdx)return this.onArrowRight();var e=this.filteredCategories[this.previewEmojiCategoryIdx].emojis.length,t=this._perLine;this.previewEmojiIdx+t>e&&(t=e%this._perLine);for(var i=0;i0?this.filteredCategories[this.previewEmojiCategoryIdx-1].emojis.length%this._perLine:0);for(var t=0;tn+t.scrollTop&&(t.scrollTop+=i.offsetHeight),i&&i.offsetTope.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}(Object.getOwnPropertyNames(e));try{for(i.s();!(t=i.n()).done;){var n=t.value,o=e[n];e[n]=o&&"object"===u(o)?d(o):o}}catch(e){i.e(e)}finally{i.f()}return Object.freeze(e)}var f,p,v=function(e){if(!e.compressed)return e;for(var t in e.compressed=!1,e.emojis){var i=e.emojis[t];for(var n in h)i[n]=i[h[n]],delete i[h[n]];i.short_names||(i.short_names=[]),i.short_names.unshift(t),i.sheet_x=i.sheet[0],i.sheet_y=i.sheet[1],delete i.sheet,i.text||(i.text=""),i.added_in||(i.added_in=6),i.added_in=i.added_in.toFixed(1),i.search=m(i)}return d(e)},j=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","hankey"],y={};function g(){p=!0,f=c.get("frequently")}var w={add:function(e){p||g();var t=e.id;f||(f=y),f[t]||(f[t]=0),f[t]+=1,c.set("last",t),c.set("frequently",f)},get:function(e){if(p||g(),!f){y={};for(var t=[],i=Math.min(e,j.length),n=0;n',custom:'',flags:'',foods:'',nature:'',objects:'',smileys:'',people:' ',places:'',recent:'',symbols:''};function C(e,t,i,n,o,r,s,a){var c,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=i,u._compiled=!0),n&&(u.functional=!0),r&&(u._scopeId="data-v-"+r),s?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},u._ssrRegister=c):o&&(c=a?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(e,t){return c.call(t),l(e,t)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,c):[c]}return{exports:e,options:u}}var b=C({props:{i18n:{type:Object,required:!0},color:{type:String},categories:{type:Array,required:!0},activeCategory:{type:Object,default:function(){return{}}}},created:function(){this.svgs=_}},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"emoji-mart-anchors",attrs:{role:"tablist"}},e._l(e.categories,(function(t){return i("button",{key:t.id,class:{"emoji-mart-anchor":!0,"emoji-mart-anchor-selected":t.id==e.activeCategory.id},style:{color:t.id==e.activeCategory.id?e.color:""},attrs:{role:"tab",type:"button","aria-label":t.name,"aria-selected":t.id==e.activeCategory.id,"data-title":e.i18n.categories[t.id]},on:{click:function(i){return e.$emit("click",t)}}},[i("div",{attrs:{"aria-hidden":"true"},domProps:{innerHTML:e._s(e.svgs[t.id])}}),e._v(" "),i("span",{staticClass:"emoji-mart-anchor-bar",style:{backgroundColor:e.color},attrs:{"aria-hidden":"true"}})])})),0)}),[],!1,null,null,null),k=b.exports;function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){for(var i=0;i1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?i.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,i.push(e,t)),(n+1===o||i.length>16384)&&(r+=String.fromCharCode.apply(null,i),i.length=0)}return r};function P(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return O.apply(null,t)}function A(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function M(e,t){var i=A(e),n=A(t);return i.filter((function(e){return n.indexOf(e)>=0}))}function I(e,t){var i={};for(var n in e){var o=e[n],r=o;t.hasOwnProperty(n)&&(r=t[n]),"object"===u(r)&&(r=I(o,r)),i[n]=r}return i}function F(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return z(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?z(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i1&&void 0!==arguments[1]?arguments[1]:{},n=i.emojisToShowFilter,o=i.include,r=i.exclude,s=i.custom,a=i.recent,c=i.recentLength,u=void 0===c?20:c;E(this,e),this._data=v(t),this._emojisFilter=n||null,this._include=o||null,this._exclude=r||null,this._custom=s||[],this._recent=a||w.get(u),this._emojis={},this._nativeEmojis={},this._emoticons={},this._categories=[],this._recentCategory={id:"recent",name:"Recent",emojis:[]},this._customCategory={id:"custom",name:"Custom",emojis:[]},this._searchIndex={},this.buildIndex(),Object.freeze(this)}return x(e,[{key:"buildIndex",value:function(){var e=this,t=this._data.categories;if(this._include&&(t=(t=t.filter((function(t){return e._include.includes(t.id)}))).sort((function(t,i){var n=e._include.indexOf(t.id),o=e._include.indexOf(i.id);return no?1:0}))),t.forEach((function(t){if(e.isCategoryNeeded(t.id)){var i={id:t.id,name:t.name,emojis:[]};t.emojis.forEach((function(t){var n=e.addEmoji(t);n&&i.emojis.push(n)})),i.emojis.length&&e._categories.push(i)}})),this.isCategoryNeeded("custom")){if(this._custom.length>0){var i,n=F(this._custom);try{for(n.s();!(i=n.n()).done;){var o=i.value;this.addCustomEmoji(o)}}catch(e){n.e(e)}finally{n.f()}}this._customCategory.emojis.length&&this._categories.push(this._customCategory)}this.isCategoryNeeded("recent")&&(this._recent.length&&this._recent.map((function(t){var i,n=F(e._customCategory.emojis);try{for(n.s();!(i=n.n()).done;){var o=i.value;if(o.id===t)return void e._recentCategory.emojis.push(o)}}catch(e){n.e(e)}finally{n.f()}e.hasEmoji(t)&&e._recentCategory.emojis.push(e.emoji(t))})),this._recentCategory.emojis.length&&this._categories.unshift(this._recentCategory))}},{key:"findEmoji",value:function(e,t){var i=e.match(L);if(i&&(e=i[1],i[2]&&(t=parseInt(i[2],10))),this._data.aliases.hasOwnProperty(e)&&(e=this._data.aliases[e]),this._emojis.hasOwnProperty(e)){var n=this._emojis[e];return t?n.getSkin(t):n}return this._nativeEmojis.hasOwnProperty(e)?this._nativeEmojis[e]:null}},{key:"categories",value:function(){return this._categories}},{key:"emoji",value:function(e){this._data.aliases.hasOwnProperty(e)&&(e=this._data.aliases[e]);var t=this._emojis[e];if(!t)throw new Error("Can not find emoji by id: "+e);return t}},{key:"firstEmoji",value:function(){var e=this._emojis[Object.keys(this._emojis)[0]];if(!e)throw new Error("Can not get first emoji");return e}},{key:"hasEmoji",value:function(e){return this._data.aliases.hasOwnProperty(e)&&(e=this._data.aliases[e]),!!this._emojis[e]}},{key:"nativeEmoji",value:function(e){return this._nativeEmojis.hasOwnProperty(e)?this._nativeEmojis[e]:null}},{key:"search",value:function(e,t){var i=this;if(t||(t=75),!e.length)return null;if("-"==e||"-1"==e)return[this.emoji("-1")];var n,o=e.toLowerCase().split(/[\s|,|\-|_]+/);o.length>2&&(o=[o[0],o[1]]),n=o.map((function(e){for(var t=i._emojis,n=i._searchIndex,o=0,r=0;r1?M.apply(null,n):n.length?n[0]:[])&&r.length>t&&(r=r.slice(0,t)),r}},{key:"addCustomEmoji",value:function(e){var t=Object.assign({},e,{id:e.short_names[0],custom:!0});t.search||(t.search=m(t));var i=new $(t);return this._emojis[i.id]=i,this._customCategory.emojis.push(i),i}},{key:"addEmoji",value:function(e){var t=this,i=this._data.emojis[e];if(!this.isEmojiNeeded(i))return!1;var n=new $(i);if(this._emojis[e]=n,n.native&&(this._nativeEmojis[n.native]=n),n._skins)for(var o in n._skins){var r=n._skins[o];r.native&&(this._nativeEmojis[r.native]=r)}return n.emoticons&&n.emoticons.forEach((function(i){t._emoticons[i]||(t._emoticons[i]=e)})),n}},{key:"isCategoryNeeded",value:function(e){var t=!this._include||!this._include.length||this._include.indexOf(e)>-1,i=!(!this._exclude||!this._exclude.length)&&this._exclude.indexOf(e)>-1;return!(!t||i)}},{key:"isEmojiNeeded",value:function(e){return!this._emojisFilter||this._emojisFilter(e)}}]),e}(),$=function(){function e(t){if(E(this,e),this._data=Object.assign({},t),this._skins=null,this._data.skin_variations)for(var i in this._skins=[],T){var n=T[i],o=this._data.skin_variations[n],r=Object.assign({},t);for(var s in o)r[s]=o[s];delete r.skin_variations,r.skin_tone=parseInt(i)+1,this._skins.push(new e(r))}for(var a in this._sanitized=N(this._data),this._sanitized)this[a]=this._sanitized[a];this.short_names=this._data.short_names,this.short_name=this._data.short_names[0],Object.freeze(this)}return x(e,[{key:"getSkin",value:function(e){return e&&"native"!=e&&this._skins?this._skins[e-1]:this}},{key:"getPosition",value:function(){var e=+(100/60*this._data.sheet_x).toFixed(2),t=+(100/60*this._data.sheet_y).toFixed(2);return"".concat(e,"% ").concat(t,"%")}},{key:"ariaLabel",value:function(){return[this.native].concat(this.short_names).filter(Boolean).join(", ")}}]),e}(),R=function(){function e(t,i,n,o,r,s,a){E(this,e),this._emoji=t,this._native=o,this._skin=i,this._set=n,this._fallback=r,this.canRender=this._canRender(),this.cssClass=this._cssClass(),this.cssStyle=this._cssStyle(a),this.content=this._content(),this.title=!0===s?t.short_name:null,this.ariaLabel=t.ariaLabel(),Object.freeze(this)}return x(e,[{key:"getEmoji",value:function(){return this._emoji.getSkin(this._skin)}},{key:"_canRender",value:function(){return this._isCustom()||this._isNative()||this._hasEmoji()||this._fallback}},{key:"_cssClass",value:function(){return["emoji-set-"+this._set,"emoji-type-"+this._emojiType()]}},{key:"_cssStyle",value:function(e){var t={};return this._isCustom()?t={backgroundImage:"url("+this.getEmoji()._data.imageUrl+")",backgroundSize:"100%",width:e+"px",height:e+"px"}:this._hasEmoji()&&!this._isNative()&&(t={backgroundPosition:this.getEmoji().getPosition()}),e&&(t=this._isNative()?Object.assign(t,{fontSize:Math.round(.95*e*10)/10+"px"}):Object.assign(t,{width:e+"px",height:e+"px"})),t}},{key:"_content",value:function(){return this._isCustom()?"":this._isNative()?this.getEmoji().native:this._hasEmoji()?"":this._fallback?this._fallback(this.getEmoji()):null}},{key:"_isNative",value:function(){return this._native}},{key:"_isCustom",value:function(){return this.getEmoji().custom}},{key:"_hasEmoji",value:function(){if(!this.getEmoji()._data)return!1;var e=this.getEmoji()._data["has_img_"+this._set];return void 0===e||e}},{key:"_emojiType",value:function(){return this._isCustom()?"custom":this._isNative()?"native":this._hasEmoji()?"image":"fallback"}}]),e}();function N(e){var t=e.name,i=e.short_names,n=e.skin_tone,o=e.skin_variations,r=e.emoticons,s=e.unified,a=e.custom,c=e.imageUrl,u=e.id||i[0],l=":".concat(u,":");return a?{id:u,name:t,colons:l,emoticons:r,custom:a,imageUrl:c}:(n&&(l+=":skin-tone-".concat(n,":")),{id:u,name:t,colons:l,emoticons:r,unified:s.toLowerCase(),skin:n||(o?1:null),native:P(s)})}function D(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var B={native:{type:Boolean,default:!1},tooltip:{type:Boolean,default:!1},fallback:{type:Function},skin:{type:Number,default:1},set:{type:String,default:"apple"},emoji:{type:[String,Object],required:!0},size:{type:Number,default:null},tag:{type:String,default:"span"}},H={perLine:{type:Number,default:9},maxSearchResults:{type:Number,default:75},emojiSize:{type:Number,default:24},title:{type:String,default:"Emoji Martâ„¢"},emoji:{type:String,default:"department_store"},color:{type:String,default:"#ae65c5"},set:{type:String,default:"apple"},skin:{type:Number,default:null},defaultSkin:{type:Number,default:1},native:{type:Boolean,default:!1},emojiTooltip:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},i18n:{type:Object,default:function(){return{}}},showPreview:{type:Boolean,default:!0},showSearch:{type:Boolean,default:!0},showCategories:{type:Boolean,default:!0},showSkinTones:{type:Boolean,default:!0},infiniteScroll:{type:Boolean,default:!0},pickerStyles:{type:Object,default:function(){return{}}}};function U(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function V(e){for(var t=1;t0},emojiObjects:function(){var e=this;return this.emojis.map((function(t){return{emojiObject:t,emojiView:new R(t,e.emojiProps.skin,e.emojiProps.set,e.emojiProps.native,e.emojiProps.fallback,e.emojiProps.emojiTooltip,e.emojiProps.emojiSize)}}))}},components:{Emoji:W}},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.isVisible&&(e.isSearch||e.hasResults)?i("section",{class:{"emoji-mart-category":!0,"emoji-mart-no-results":!e.hasResults},attrs:{"aria-label":e.i18n.categories[e.id]}},[i("div",{staticClass:"emoji-mart-category-label"},[i("h3",{staticClass:"emoji-mart-category-label"},[e._v(e._s(e.i18n.categories[e.id]))])]),e._v(" "),e._l(e.emojiObjects,(function(t){var n=t.emojiObject,o=t.emojiView;return[o.canRender?i("button",{key:n.id,staticClass:"emoji-mart-emoji",class:e.activeClass(n),attrs:{"aria-label":o.ariaLabel,role:"option","aria-selected":"false","aria-posinset":"1","aria-setsize":"1812",type:"button","data-title":n.short_name,title:o.title},on:{mouseenter:function(t){e.emojiProps.onEnter(o.getEmoji())},mouseleave:function(t){e.emojiProps.onLeave(o.getEmoji())},click:function(t){e.emojiProps.onClick(o.getEmoji())}}},[i("span",{class:o.cssClass,style:o.cssStyle},[e._v(e._s(o.content))])]):e._e()]})),e._v(" "),e.hasResults?e._e():i("div",[i("emoji",{attrs:{data:e.data,emoji:"sleuth_or_spy",native:e.emojiProps.native,skin:e.emojiProps.skin,set:e.emojiProps.set}}),e._v(" "),i("div",{staticClass:"emoji-mart-no-results-label"},[e._v(e._s(e.i18n.notfound))])],1)],2):e._e()}),[],!1,null,null,null).exports,X=C({props:{skin:{type:Number,required:!0}},data:function(){return{opened:!1}},methods:{onClick:function(e){this.opened&&e!=this.skin&&this.$emit("change",e),this.opened=!this.opened}}},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:{"emoji-mart-skin-swatches":!0,"emoji-mart-skin-swatches-opened":e.opened}},e._l(6,(function(t){return i("span",{key:t,class:{"emoji-mart-skin-swatch":!0,"emoji-mart-skin-swatch-selected":e.skin==t}},[i("span",{class:"emoji-mart-skin emoji-mart-skin-tone-"+t,on:{click:function(i){return e.onClick(t)}}})])})),0)}),[],!1,null,null,null).exports,Z=C({props:{data:{type:Object,required:!0},title:{type:String,required:!0},emoji:{type:[String,Object]},idleEmoji:{type:[String,Object],required:!0},showSkinTones:{type:Boolean,default:!0},emojiProps:{type:Object,required:!0},skinProps:{type:Object,required:!0},onSkinChange:{type:Function,required:!0}},computed:{emojiData:function(){return this.emoji?this.emoji:{}},emojiShortNames:function(){return this.emojiData.short_names},emojiEmoticons:function(){return this.emojiData.emoticons}},components:{Emoji:W,Skins:X}},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"emoji-mart-preview"},[e.emoji?[i("div",{staticClass:"emoji-mart-preview-emoji"},[i("emoji",{attrs:{data:e.data,emoji:e.emoji,native:e.emojiProps.native,skin:e.emojiProps.skin,set:e.emojiProps.set}})],1),e._v(" "),i("div",{staticClass:"emoji-mart-preview-data"},[i("div",{staticClass:"emoji-mart-preview-name"},[e._v(e._s(e.emoji.name))]),e._v(" "),i("div",{staticClass:"emoji-mart-preview-shortnames"},e._l(e.emojiShortNames,(function(t){return i("span",{key:t,staticClass:"emoji-mart-preview-shortname"},[e._v(":"+e._s(t)+":")])})),0),e._v(" "),i("div",{staticClass:"emoji-mart-preview-emoticons"},e._l(e.emojiEmoticons,(function(t){return i("span",{key:t,staticClass:"emoji-mart-preview-emoticon"},[e._v(e._s(t))])})),0)])]:[i("div",{staticClass:"emoji-mart-preview-emoji"},[i("emoji",{attrs:{data:e.data,emoji:e.idleEmoji,native:e.emojiProps.native,skin:e.emojiProps.skin,set:e.emojiProps.set}})],1),e._v(" "),i("div",{staticClass:"emoji-mart-preview-data"},[i("span",{staticClass:"emoji-mart-title-label"},[e._v(e._s(e.title))])]),e._v(" "),e.showSkinTones?i("div",{staticClass:"emoji-mart-preview-skins"},[i("skins",{attrs:{skin:e.skinProps.skin},on:{change:function(t){return e.onSkinChange(t)}}})],1):e._e()]],2)}),[],!1,null,null,null).exports,G=C({props:{data:{type:Object,required:!0},i18n:{type:Object,required:!0},autoFocus:{type:Boolean,default:!1},onSearch:{type:Function,required:!0},onArrowLeft:{type:Function,required:!1},onArrowRight:{type:Function,required:!1},onArrowDown:{type:Function,required:!1},onArrowUp:{type:Function,required:!1},onEnter:{type:Function,required:!1}},data:function(){return{value:""}},computed:{emojiIndex:function(){return this.data}},watch:{value:function(){this.$emit("search",this.value)}},methods:{clear:function(){this.value=""}},mounted:function(){var e=this.$el.querySelector("input");this.autoFocus&&e.focus()}},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"emoji-mart-search"},[i("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],attrs:{type:"text",placeholder:e.i18n.search,role:"textbox","aria-autocomplete":"list","aria-owns":"emoji-mart-list","aria-label":"Search for an emoji","aria-describedby":"emoji-mart-search-description"},domProps:{value:e.value},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:function(t){return e.$emit("arrowLeft",t)}.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"right",39,t.key,["Right","ArrowRight"])||"button"in t&&2!==t.button?null:function(){return e.$emit("arrowRight")}.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:function(){return e.$emit("arrowDown")}.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:function(t){return e.$emit("arrowUp",t)}.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:function(){return e.$emit("enter")}.apply(null,arguments)}],input:function(t){t.target.composing||(e.value=t.target.value)}}}),e._v(" "),i("span",{staticClass:"hidden",attrs:{id:"emoji-picker-search-description"}},[e._v("Use the left, right, up and down arrow keys to navigate the emoji search\n results.")])])}),[],!1,null,null,null),K=G.exports;function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i0})),this._categories[0].first=!0,Object.freeze(this._categories),this.activeCategory=this._categories[0],this.searchEmojis=null,this.previewEmoji=null,this.previewEmojiCategoryIdx=0,this.previewEmojiIdx=-1}return x(e,[{key:"onScroll",value:function(){for(var e=this._vm.$refs.scroll.scrollTop,t=this.filteredCategories[0],i=0,n=this.filteredCategories.length;ie)break;t=o}this.activeCategory=t}},{key:"allCategories",get:function(){return this._categories}},{key:"filteredCategories",get:function(){return this.searchEmojis?[{id:"search",name:"Search",emojis:this.searchEmojis}]:this._categories.filter((function(e){return e.emojis.length>0}))}},{key:"previewEmojiCategory",get:function(){return this.previewEmojiCategoryIdx>=0?this.filteredCategories[this.previewEmojiCategoryIdx]:null}},{key:"onAnchorClick",value:function(e){var t=this;if(!this.searchEmojis){var i=this.filteredCategories.indexOf(e),n=this._vm.getCategoryComponent(i);this._vm.infiniteScroll?function(){if(n){var i=n.$el.offsetTop;e.first&&(i=0),t._vm.$refs.scroll.scrollTop=i}}():this.activeCategory=this.filteredCategories[i]}}},{key:"onSearch",value:function(e){var t=this._data.search(e,this.maxSearchResults);this.searchEmojis=t,this.previewEmojiCategoryIdx=0,this.previewEmojiIdx=0,this.updatePreviewEmoji()}},{key:"onEmojiEnter",value:function(e){this.previewEmoji=e,this.previewEmojiIdx=-1,this.previewEmojiCategoryIdx=-1}},{key:"onEmojiLeave",value:function(e){this.previewEmoji=null}},{key:"onArrowLeft",value:function(){this.previewEmojiIdx>0?this.previewEmojiIdx-=1:(this.previewEmojiCategoryIdx-=1,this.previewEmojiCategoryIdx<0?this.previewEmojiCategoryIdx=0:this.previewEmojiIdx=this.filteredCategories[this.previewEmojiCategoryIdx].emojis.length-1),this.updatePreviewEmoji()}},{key:"onArrowRight",value:function(){this.previewEmojiIdx=this.filteredCategories.length?this.previewEmojiCategoryIdx=this.filteredCategories.length-1:this.previewEmojiIdx=0),this.updatePreviewEmoji()}},{key:"onArrowDown",value:function(){if(-1==this.previewEmojiIdx)return this.onArrowRight();var e=this.filteredCategories[this.previewEmojiCategoryIdx].emojis.length,t=this._perLine;this.previewEmojiIdx+t>e&&(t=e%this._perLine);for(var i=0;i0?this.filteredCategories[this.previewEmojiCategoryIdx-1].emojis.length%this._perLine:0);for(var t=0;tn+t.scrollTop&&(t.scrollTop+=i.offsetHeight),i&&i.offsetTop